Skip to content

Commit fe786c6

Browse files
committed
Pull request 695: AG-38549 update scriptlets deployment to build on build stage and deploy on deploy stage
Squashed commit of the following: commit feda068 Author: Maxim Topciu <mtopciu@adguard.com> Date: Wed Dec 18 16:36:39 2024 +0200 AG-38549 fix path commit b186abb Author: Maxim Topciu <mtopciu@adguard.com> Date: Wed Dec 18 16:34:38 2024 +0200 AG-38549 Refactor npmjs deployment configuration in deploy.yaml by consolidating variable definitions and improving clarity for alpha and beta environments. commit 46e7206 Author: Maxim Topciu <mtopciu@adguard.com> Date: Wed Dec 18 16:29:25 2024 +0200 AG-38549 Refactor npmjs deployment configuration by removing unused variables and clarifying tagSuffix behavior in deploy.yaml commit 1f8759d Author: Maxim Topciu <mtopciu@adguard.com> Date: Wed Dec 18 13:51:42 2024 +0200 AG-38549 update deployment
1 parent 8feb2d0 commit fe786c6

File tree

2 files changed

+35
-31
lines changed

2 files changed

+35
-31
lines changed

bamboo-specs/build.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,14 @@ Build:
3535
3636
pnpm install
3737
pnpm build
38+
pnpm pack && mv adguard-scriptlets-*.tgz scriptlets.tgz
3839
3940
# TODO fix building wiki, ubo changed format of their source
4041
# pnpm wiki
4142
- inject-variables:
4243
file: dist/build.txt
4344
scope: RESULT
4445
namespace: inject
45-
- any-task:
46-
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit
47-
configuration:
48-
# do not change commitMessage as it does not trigger increment after deploy
49-
commitMessage: 'deploy: update dist v${bamboo.inject.version}'
50-
selectedRepository: defaultRepository
51-
- any-task:
52-
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging
53-
configuration:
54-
selectedRepository: defaultRepository
55-
tagName: v${bamboo.inject.version}
5646
final-tasks:
5747
- script:
5848
interpreter: SHELL
@@ -69,6 +59,12 @@ Build:
6959
echo "Size before cleanup:" && du -h | tail -n 1
7060
rm -rf node_modules
7161
echo "Size after cleanup:" && du -h | tail -n 1
62+
artifacts:
63+
- name: scriptlets.tgz
64+
location: .
65+
pattern: scriptlets.tgz
66+
shared: true
67+
required: true
7268
requirements:
7369
- adg-docker: 'true'
7470

bamboo-specs/deploy.yaml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ deployment:
66
release-naming: ${bamboo.inject.version}
77
environments:
88
- npmjs
9+
- npmjs • alpha
10+
- npmjs • beta
911

10-
npmjs:
12+
npmjs: &npmjs
1113
docker:
1214
image: adguard/puppeteer-runner:23.3--1
1315
volumes:
1416
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
17+
variables: &npmjs-variables
18+
publishArgs: --access public
1519
triggers: [ ]
1620
tasks:
17-
- checkout:
18-
force-clean-build: 'true'
21+
- artifact-download:
22+
artifacts:
23+
- name: scriptlets.tgz
1924
- script:
2025
interpreter: SHELL
2126
scripts:
@@ -26,24 +31,13 @@ npmjs:
2631
2732
export NPM_TOKEN=${bamboo.npmSecretToken}
2833
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
29-
pnpm install
30-
npm publish --access public
31-
final-tasks:
32-
- script:
33-
interpreter: SHELL
34-
scripts:
35-
- |-
36-
set -x
37-
set -e
38-
39-
# Fix mixed logs
40-
exec 2>&1
41-
42-
ls -la
4334
44-
echo "Size before cleanup:" && du -h | tail -n 1
45-
rm -rf node_modules
46-
echo "Size after cleanup:" && du -h | tail -n 1
35+
npm publish scriptlets.tgz ${bamboo_publishArgs}
36+
- any-task:
37+
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging
38+
configuration:
39+
selectedRepository: defaultRepository
40+
tagName: v${bamboo.inject.version}${bamboo_tagSuffix}
4741
requirements:
4842
- adg-docker: 'true'
4943
notifications:
@@ -53,3 +47,17 @@ npmjs:
5347
- webhook:
5448
name: Deploy webhook
5549
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo
50+
51+
npmjs • alpha:
52+
<<: *npmjs
53+
variables:
54+
<<: *npmjs-variables
55+
publishArgs: --tag alpha --access public
56+
tagSuffix: '-alpha'
57+
58+
npmjs • beta:
59+
<<: *npmjs
60+
variables:
61+
<<: *npmjs-variables
62+
publishArgs: --tag beta --access public
63+
tagSuffix: '-beta'

0 commit comments

Comments
 (0)