2021-04-08 13:55:12 +03:00
|
|
|
---
|
|
|
|
'version': 2
|
|
|
|
'plan':
|
|
|
|
'project-key': 'AGH'
|
|
|
|
'key': 'AGHBSNAPSPECS'
|
|
|
|
'name': 'AdGuard Home - Build and publish release'
|
2021-04-30 15:17:03 +03:00
|
|
|
# Make sure to sync any changes with the branch overrides below.
|
2021-04-08 13:55:12 +03:00
|
|
|
'variables':
|
|
|
|
'channel': 'edge'
|
2022-08-03 14:36:18 +03:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:5.0'
|
2021-04-08 13:55:12 +03:00
|
|
|
|
|
|
|
'stages':
|
2022-08-15 18:46:19 +03:00
|
|
|
- 'Build frontend':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Build frontend'
|
|
|
|
|
2021-04-08 17:56:27 +03:00
|
|
|
- 'Make release':
|
2021-04-08 13:55:12 +03:00
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Make release'
|
|
|
|
|
|
|
|
- 'Make and publish docker':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Make and publish docker'
|
|
|
|
|
2022-07-28 20:18:07 +03:00
|
|
|
- 'Publish to static storage':
|
2021-04-08 13:55:12 +03:00
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
2022-07-28 20:18:07 +03:00
|
|
|
- 'Publish to static storage'
|
2021-04-08 13:55:12 +03:00
|
|
|
|
|
|
|
- 'Publish to Snapstore':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Publish to Snapstore'
|
|
|
|
|
2021-06-18 18:13:36 +03:00
|
|
|
- 'Publish to GitHub Releases':
|
2021-04-08 13:55:12 +03:00
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
2021-06-18 18:13:36 +03:00
|
|
|
- 'Publish to GitHub Releases'
|
2021-04-08 13:55:12 +03:00
|
|
|
|
2022-08-15 18:46:19 +03:00
|
|
|
'Build frontend':
|
2021-04-08 13:55:12 +03:00
|
|
|
'docker':
|
|
|
|
'image': '${bamboo.dockerGo}'
|
|
|
|
'volumes':
|
|
|
|
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
|
2022-08-15 18:46:19 +03:00
|
|
|
'key': 'BF'
|
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
|
|
|
'tasks':
|
|
|
|
- 'checkout':
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
|
|
|
|
|
|
|
# Explicitly checkout the revision that we need.
|
|
|
|
git checkout "${bamboo.repository.revision.number}"
|
|
|
|
|
2022-08-15 18:57:34 +03:00
|
|
|
make js-deps js-build
|
2022-08-15 18:46:19 +03:00
|
|
|
'artifacts':
|
|
|
|
- 'name': 'AdGuardHome frontend'
|
|
|
|
'pattern': 'build*/**'
|
|
|
|
'shared': true
|
|
|
|
'required': true
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'Make release':
|
|
|
|
'docker':
|
|
|
|
'image': '${bamboo.dockerGo}'
|
|
|
|
'volumes':
|
2021-04-08 13:55:12 +03:00
|
|
|
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
|
|
|
|
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
|
|
|
|
'key': 'MR'
|
2021-04-14 12:40:48 +03:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 13:55:12 +03:00
|
|
|
'tasks':
|
|
|
|
- 'checkout':
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
|
|
|
|
|
|
|
# Explicitly checkout the revision that we need.
|
|
|
|
git checkout "${bamboo.repository.revision.number}"
|
|
|
|
|
|
|
|
# Run the build with the specified channel.
|
|
|
|
echo "${bamboo.gpgSecretKey}"\
|
|
|
|
| awk '{ gsub(/\\n/, "\n"); print; }'\
|
|
|
|
| gpg --import --batch --yes
|
|
|
|
|
|
|
|
make\
|
|
|
|
CHANNEL=${bamboo.channel}\
|
|
|
|
GPG_KEY_PASSPHRASE=${bamboo.gpgPassword}\
|
2022-08-15 18:46:19 +03:00
|
|
|
FRONTEND_PREBUILT=1\
|
2021-04-08 13:55:12 +03:00
|
|
|
VERBOSE=1\
|
|
|
|
build-release
|
|
|
|
# TODO(a.garipov): Use more fine-grained artifact rules.
|
|
|
|
'artifacts':
|
|
|
|
- 'name': 'AdGuardHome dists'
|
|
|
|
'pattern': 'dist/**'
|
|
|
|
'shared': true
|
|
|
|
'required': true
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'Make and publish docker':
|
|
|
|
'key': 'MPD'
|
2021-04-14 12:40:48 +03:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 13:55:12 +03:00
|
|
|
'tasks':
|
|
|
|
- 'checkout':
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
|
|
|
|
|
|
|
# Explicitly checkout the revision that we need.
|
|
|
|
git checkout "${bamboo.repository.revision.number}"
|
|
|
|
|
|
|
|
# Install Qemu, create builder.
|
|
|
|
docker version -f '{{ .Server.Experimental }}'
|
|
|
|
docker buildx rm buildx-builder || :
|
|
|
|
docker buildx create --name buildx-builder --driver docker-container\
|
|
|
|
--use
|
|
|
|
docker buildx inspect --bootstrap
|
|
|
|
|
|
|
|
# Login to DockerHub.
|
|
|
|
docker login -u="${bamboo.dockerHubUsername}"\
|
|
|
|
-p="${bamboo.dockerHubPassword}"
|
|
|
|
|
|
|
|
# Boot the builder.
|
|
|
|
docker buildx inspect --bootstrap
|
|
|
|
|
|
|
|
# Print Docker info.
|
|
|
|
docker info
|
|
|
|
|
|
|
|
# Prepare and push the build.
|
|
|
|
make\
|
|
|
|
CHANNEL="${bamboo.channel}"\
|
|
|
|
DOCKER_IMAGE_NAME='adguard/adguardhome'\
|
2021-04-08 18:24:42 +03:00
|
|
|
DOCKER_OUTPUT="type=image,name=adguard/adguardhome,push=true"\
|
2021-04-08 13:55:12 +03:00
|
|
|
VERBOSE='1'\
|
|
|
|
build-docker
|
|
|
|
'environment':
|
|
|
|
DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
2022-07-28 20:18:07 +03:00
|
|
|
'Publish to static storage':
|
2021-04-08 13:55:12 +03:00
|
|
|
'key': 'PUB'
|
2021-04-14 12:40:48 +03:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 13:55:12 +03:00
|
|
|
'tasks':
|
|
|
|
- 'clean'
|
|
|
|
- 'checkout':
|
|
|
|
'repository': 'bamboo-deploy-publisher'
|
|
|
|
'path': 'bamboo-deploy-publisher'
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
2021-04-08 16:24:59 +03:00
|
|
|
|
|
|
|
cd ./dist/
|
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
CHANNEL="${bamboo.channel}"
|
|
|
|
export CHANNEL
|
|
|
|
|
2021-04-08 16:44:01 +03:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-"$CHANNEL"
|
2021-04-08 13:55:12 +03:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'Publish to Snapstore':
|
2021-04-08 17:56:27 +03:00
|
|
|
'docker':
|
|
|
|
'image': '${bamboo.dockerGo}'
|
2021-04-08 13:55:12 +03:00
|
|
|
'key': 'PTS'
|
2021-04-14 12:40:48 +03:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 13:55:12 +03:00
|
|
|
'tasks':
|
|
|
|
- 'clean'
|
|
|
|
- 'checkout':
|
|
|
|
'repository': 'bamboo-deploy-publisher'
|
|
|
|
'path': 'bamboo-deploy-publisher'
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
2021-04-08 16:24:59 +03:00
|
|
|
|
|
|
|
cd ./dist/
|
|
|
|
|
2022-04-08 16:43:49 +03:00
|
|
|
channel="${bamboo.channel}"
|
|
|
|
readonly channel
|
|
|
|
case "$channel"
|
|
|
|
in
|
|
|
|
('release')
|
|
|
|
snapchannel='candidate'
|
|
|
|
;;
|
|
|
|
('beta')
|
|
|
|
snapchannel='beta'
|
|
|
|
;;
|
|
|
|
('edge')
|
|
|
|
snapchannel='edge'
|
|
|
|
;;
|
|
|
|
(*)
|
|
|
|
echo "invalid channel '$channel'"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-04-08 13:55:12 +03:00
|
|
|
env\
|
2022-04-08 16:43:49 +03:00
|
|
|
SNAPCRAFT_CHANNEL="$snapchannel"\
|
2021-04-08 13:55:12 +03:00
|
|
|
SNAPCRAFT_EMAIL="${bamboo.snapcraftEmail}"\
|
|
|
|
SNAPCRAFT_MACAROON="${bamboo.snapcraftMacaroonPassword}"\
|
|
|
|
SNAPCRAFT_UBUNTU_DISCHARGE="${bamboo.snapcraftUbuntuDischargePassword}"\
|
2021-04-08 16:44:01 +03:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-snap
|
2021-04-08 13:55:12 +03:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
2021-06-18 18:13:36 +03:00
|
|
|
'Publish to GitHub Releases':
|
2021-04-08 13:55:12 +03:00
|
|
|
'key': 'PTGR'
|
2021-04-14 12:40:48 +03:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 13:55:12 +03:00
|
|
|
'tasks':
|
|
|
|
- 'clean'
|
|
|
|
- 'checkout':
|
|
|
|
'repository': 'bamboo-deploy-publisher'
|
|
|
|
'path': 'bamboo-deploy-publisher'
|
|
|
|
'force-clean-build': true
|
|
|
|
- 'script':
|
|
|
|
'interpreter': 'SHELL'
|
|
|
|
'scripts':
|
|
|
|
- |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e -f -u -x
|
|
|
|
|
|
|
|
export CHANNEL="${bamboo.channel}"
|
2021-04-09 15:07:18 +03:00
|
|
|
if [ "$CHANNEL" != 'release' ] && [ "${CHANNEL}" != 'beta' ]
|
2021-04-08 13:55:12 +03:00
|
|
|
then
|
2021-06-18 18:13:36 +03:00
|
|
|
echo "don't publish to GitHub Releases for this channel"
|
2021-04-08 13:55:12 +03:00
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-04-08 16:44:01 +03:00
|
|
|
cd ./dist/
|
|
|
|
|
2021-04-08 13:55:12 +03:00
|
|
|
env\
|
|
|
|
GITHUB_TOKEN="${bamboo.githubPublicRepoPassword}"\
|
2021-04-08 16:44:01 +03:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-github
|
2021-04-08 13:55:12 +03:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'triggers':
|
2021-05-13 14:30:40 +03:00
|
|
|
# Don't use minute values that end with a zero or a five as these are often used
|
|
|
|
# in CI and so resources during these minutes can be quite busy.
|
|
|
|
- 'cron': '0 42 13 ? * MON-FRI *'
|
2021-04-08 13:55:12 +03:00
|
|
|
'branches':
|
|
|
|
'create': 'manually'
|
|
|
|
'delete':
|
|
|
|
'after-deleted-days': 1
|
|
|
|
'after-inactive-days': 30
|
|
|
|
'integration':
|
|
|
|
'push-on-success': false
|
|
|
|
'merge-from': 'AdGuard Home - Build and publish release'
|
|
|
|
'link-to-jira': true
|
|
|
|
|
|
|
|
'notifications':
|
|
|
|
- 'events':
|
|
|
|
- 'plan-completed'
|
|
|
|
'recipients':
|
|
|
|
- 'webhook':
|
|
|
|
'name': 'Build webhook'
|
2021-04-13 17:35:58 +03:00
|
|
|
'url': 'http://prod.jirahub.service.eu.consul/v1/webhook/bamboo?channel=adguard-qa'
|
2021-04-08 13:55:12 +03:00
|
|
|
|
|
|
|
'labels': []
|
|
|
|
'other':
|
|
|
|
'concurrent-build-plugin': 'system-default'
|
2021-04-28 19:14:06 +03:00
|
|
|
|
|
|
|
'branch-overrides':
|
2021-04-30 15:07:40 +03:00
|
|
|
# beta-vX.Y branches are the branches into which the commits that are needed to
|
|
|
|
# release a new patch version are initially cherry-picked.
|
|
|
|
- '^beta-v[0-9]+\.[0-9]+':
|
|
|
|
# Build betas on release branches manually.
|
2021-04-28 19:14:06 +03:00
|
|
|
'triggers': []
|
2021-04-30 15:07:40 +03:00
|
|
|
# Set the default release channel on the release branch to beta, as we may
|
|
|
|
# need to build a few of these.
|
|
|
|
'variables':
|
|
|
|
'channel': 'beta'
|
2022-08-03 14:36:18 +03:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:5.0'
|
2021-04-30 15:07:40 +03:00
|
|
|
# release-vX.Y.Z branches are the branches from which the actual final release
|
|
|
|
# is built.
|
|
|
|
- '^release-v[0-9]+\.[0-9]+\.[0-9]+':
|
2021-12-29 19:20:16 +03:00
|
|
|
# Disable integration branches for release branches.
|
|
|
|
'branch-config':
|
|
|
|
'integration':
|
|
|
|
'push-on-success': false
|
|
|
|
'merge-from': 'beta-v0.107'
|
2021-04-30 15:07:40 +03:00
|
|
|
# Build final releases on release branches manually.
|
|
|
|
'triggers': []
|
|
|
|
# Set the default release channel on the final branch to release, as these
|
|
|
|
# are the ones that actually get released.
|
|
|
|
'variables':
|
|
|
|
'channel': 'release'
|
2022-08-03 14:36:18 +03:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:5.0'
|