Skip to content

Commit

Permalink
AG-30370 init logger library
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-30370 to master

Squashed commit of the following:

commit 115b027
Author: Maxim Topciu <[email protected]>
Date:   Mon Mar 25 18:05:45 2024 +0200

    AG-30370 update author name

commit e6952e0
Author: Maxim Topciu <[email protected]>
Date:   Mon Mar 25 17:00:21 2024 +0200

    AG-30370 use pnpm cache

commit 801daad
Author: Maxim Topciu <[email protected]>
Date:   Mon Mar 25 16:53:33 2024 +0200

    AG-30370 convert to pnpm

commit 55b0402
Author: Maxim Topciu <[email protected]>
Date:   Mon Mar 25 16:29:05 2024 +0200

    AG-30370 use booleans without quotes

commit d76f4f3
Merge: e5d0574 6091d39
Author: Maxim Topciu <[email protected]>
Date:   Mon Mar 25 16:26:05 2024 +0200

    Merge branch 'master' into fix/AG-30370

commit e5d0574
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 16:12:07 2024 +0200

    AG-30370 set version to 1.0.0

commit 5f1f36f
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 15:48:52 2024 +0200

    AG-30370 update docker image for logger

commit 1be1d1b
Merge: b79acae 07742fc
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 15:29:39 2024 +0200

    Merge branch 'fix/AG-30370' of ssh://bit.int.agrd.dev:7999/adguard-filters/tsurlfilter into fix/AG-30370

commit b79acae
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 15:29:02 2024 +0200

    AG-30370 setup CI

commit 07742fc
Author: Dávid Tóta <[email protected]>
Date:   Wed Mar 20 16:06:11 2024 +0300

    packages/logger/src/Logger.ts edited online with Bitbucket

commit 9ec3aea
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 12:25:20 2024 +0200

    AG-30370 remove files description

commit ec1008e
Author: Maxim Topciu <[email protected]>
Date:   Wed Mar 20 12:22:51 2024 +0200

    AG-30370 fix review notes

commit be0a47f
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 20:32:02 2024 +0200

    AG-30370 add author

commit 987546d
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 20:28:30 2024 +0200

    AG-30370 add file description

commit 2d0f60f
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 20:27:12 2024 +0200

    AG-30370 add readme

commit 7e5428a
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 19:48:29 2024 +0200

    add license

commit 198f3f9
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 18:18:54 2024 +0200

    AG-30370 add smoke tests for typescript

commit 6a34233
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 17:45:06 2024 +0200

    AG-30370 fix eslint warnings

commit 04c1871
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 17:43:14 2024 +0200

    AG-30370 yarn add smoke tests

commit 6d2bb5a
Author: Maxim Topciu <[email protected]>
Date:   Tue Mar 19 16:15:56 2024 +0200

    AG-30370 add linter

... and 1 more commit
  • Loading branch information
maximtop committed Mar 25, 2024
1 parent 6091d39 commit 15fa192
Show file tree
Hide file tree
Showing 60 changed files with 1,887 additions and 75 deletions.
6 changes: 3 additions & 3 deletions bamboo-specs/adguard-api-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Build:
manual: 'false'
final: 'false'
manual: false
final: false
jobs:
- Build

Expand Down Expand Up @@ -46,7 +46,7 @@ Build:
pnpm --filter @adguard/api build
cd packages/adguard-api
pnpm pack && mv $(ls adguard-api-*.tgz) adguard-api.tgz
pnpm pack && mv adguard-api-*.tgz adguard-api.tgz
- inject-variables:
file: ./packages/adguard-api/dist/build.txt
scope: RESULT
Expand Down
4 changes: 2 additions & 2 deletions bamboo-specs/adguard-api-increment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Increment:
manual: 'true'
final: 'false'
manual: true
final: false
jobs:
- Increment

Expand Down
6 changes: 3 additions & 3 deletions bamboo-specs/agtree-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Build:
manual: 'false'
final: 'false'
manual: false
final: false
jobs:
- Build

Expand Down Expand Up @@ -46,7 +46,7 @@ Build:
# Pack the AGTree package into a tarball
cd packages/agtree
pnpm pack && mv $(ls adguard-agtree-*.tgz) agtree.tgz
pnpm pack && mv adguard-agtree-*.tgz agtree.tgz
- inject-variables:
file: ./packages/agtree/dist/build.txt
scope: RESULT
Expand Down
4 changes: 2 additions & 2 deletions bamboo-specs/agtree-increment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Increment:
manual: 'true'
final: 'false'
manual: true
final: false
jobs:
- Increment

Expand Down
4 changes: 2 additions & 2 deletions bamboo-specs/agtree-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Test:
manual: 'false'
final: 'false'
manual: false
final: false
jobs:
- Test

Expand Down
15 changes: 15 additions & 0 deletions bamboo-specs/bamboo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,18 @@

---
!include 'css-tokenizer-permissions.yaml'

---
!include 'logger-build.yaml'

---
!include 'logger-deploy.yaml'

---
!include 'logger-increment.yaml'

---
!include 'logger-permissions.yaml'

---
!include 'logger-test.yaml'
6 changes: 3 additions & 3 deletions bamboo-specs/css-tokenizer-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Build:
manual: 'false'
final: 'false'
manual: false
final: false
jobs:
- Build

Expand Down Expand Up @@ -48,7 +48,7 @@ Build:
cd packages/css-tokenizer
# Pack
pnpm pack && mv $(ls adguard-css-tokenizer-*.tgz) css-tokenizer.tgz
pnpm pack && mv adguard-css-tokenizer-*.tgz css-tokenizer.tgz
- inject-variables:
file: ./packages/css-tokenizer/dist/build.txt
scope: RESULT
Expand Down
4 changes: 2 additions & 2 deletions bamboo-specs/css-tokenizer-increment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Increment:
manual: 'true'
final: 'false'
manual: true
final: false
jobs:
- Increment

Expand Down
4 changes: 2 additions & 2 deletions bamboo-specs/css-tokenizer-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:

stages:
- Test:
manual: 'false'
final: 'false'
manual: false
final: false
jobs:
- Test

Expand Down
107 changes: 107 additions & 0 deletions bamboo-specs/logger-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
version: 2
plan:
project-key: AJL
key: LOGGERBUILD
name: logger - build
variables:
dockerContainer: adguard/node-ssh:18.19--0

stages:
- Build:
manual: false
final: false
jobs:
- Build

Build:
key: BUILD
other:
clean-working-dir: true
docker:
image: "${bamboo.dockerContainer}"
volumes:
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
tasks:
- checkout:
force-clean-build: 'true'
- script:
interpreter: SHELL
scripts:
- |-
set -e
set -x
# Fix mixed logs
exec 2>&1
ls -alt
# Set cache directory
pnpm config set store-dir ${bamboo.cachePnpm}
# Install dependencies
pnpm install
# Build
npx lerna run --scope @adguard/logger build
# Pack the logger package into a tarball
cd packages/logger/
pnpm pack && mv adguard-logger-*.tgz logger.tgz
- inject-variables:
file: ./packages/logger/dist/build.txt
scope: RESULT
namespace: inject
- any-task:
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging
configuration:
selectedRepository: defaultRepository
tagName: logger-v${bamboo.inject.version}
final-tasks:
- script:
interpreter: SHELL
scripts:
- |-
set -x
set -e
# Fix mixed logs
exec 2>&1
ls -la
echo "Size before cleanup:" && du -h | tail -n 1
pnpm clean
echo "Size after cleanup:" && du -h | tail -n 1
# Store the logger package tarball as an artifact
artifacts:
- name: logger.tgz
location: packages/logger/
pattern: logger.tgz
shared: true
required: true
requirements:
- adg-docker: 'true'

triggers: []

branches:
create: manually
delete: never
link-to-jira: 'true'

notifications:
- events:
- plan-status-changed
recipients:
- webhook:
name: Build webhook
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo

labels: []

other:
concurrent-build-plugin: system-default
47 changes: 47 additions & 0 deletions bamboo-specs/logger-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
version: 2
deployment:
name: logger - deploy
source-plan: AJL-LOGGERBUILD
release-naming: ${bamboo.inject.version}
environments:
- npmjs

npmjs:
docker:
image: adguard/node-ssh:18.19--0
volumes:
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
triggers: [ ]
tasks:
- checkout:
force-clean-build: 'true'
# Download previously built tarball from Bamboo artifacts
- artifact-download:
artifacts:
- name: logger.tgz
- script:
interpreter: SHELL
scripts:
- |-
set -e
set -x
# Fix mixed logs
exec 2>&1
ls -alt
# Publish tarball to NPM package registry
export NPM_TOKEN=${bamboo.npmSecretToken}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish logger.tgz --access public
requirements:
- adg-docker: 'true'
notifications:
- events:
- deployment-started-and-finished
recipients:
- webhook:
name: Deploy webhook
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo
65 changes: 65 additions & 0 deletions bamboo-specs/logger-increment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
version: 2
plan:
project-key: AJL
key: LOGGERINCR
name: logger - increment
variables:
dockerContainer: adguard/node-ssh:18.19--0

stages:
- Increment:
manual: true
final: false
jobs:
- Increment

Increment:
key: INCRLOGGER
docker:
image: "${bamboo.dockerContainer}"
volumes:
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
tasks:
- checkout:
force-clean-build: 'true'
- script:
interpreter: SHELL
scripts:
- |-
branch="${bamboo.planRepository.branchName}"
# Throw error if current branch is not "master",
# because we do not deploy changes from other branches
if [ $branch != "master" ]
then
echo "increment is not supported on branch ${branch}"
exit 1;
fi
set -e
set -x
# Fix mixed logs
exec 2>&1
ls -alt
pnpm --filter @adguard/logger increment
- any-task:
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit
configuration:
commitMessage: 'skipci: Automatic increment build number'
selectedRepository: defaultRepository
requirements:
- adg-docker: 'true'

branches:
create: manually
delete: never
link-to-jira: 'true'

labels: [ ]

other:
concurrent-build-plugin: system-default
16 changes: 16 additions & 0 deletions bamboo-specs/logger-permissions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
version: 2
deployment:
name: logger - deploy
deployment-permissions:
- groups:
- extensions-developers
permissions:
- view
environment-permissions:
- npmjs:
- groups:
- extensions-developers
permissions:
- view
- deploy
Loading

0 comments on commit 15fa192

Please sign in to comment.