2021-04-08 10:55:12 +00:00
|
|
|
---
|
|
|
|
'version': 2
|
|
|
|
'plan':
|
|
|
|
'project-key': 'AGH'
|
|
|
|
'key': 'AGHBSNAPSPECS'
|
|
|
|
'name': 'AdGuard Home - Build and publish release'
|
2021-04-30 12:17:03 +00:00
|
|
|
# Make sure to sync any changes with the branch overrides below.
|
2021-04-08 10:55:12 +00:00
|
|
|
'variables':
|
|
|
|
'channel': 'edge'
|
2022-03-04 12:50:35 +00:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:4.2'
|
2021-04-08 10:55:12 +00:00
|
|
|
|
|
|
|
'stages':
|
2021-04-08 14:56:27 +00:00
|
|
|
- 'Make release':
|
2021-04-08 10:55:12 +00:00
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Make release'
|
|
|
|
|
|
|
|
- 'Make and publish docker':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Make and publish docker'
|
|
|
|
|
|
|
|
- 'Publish to static.adguard.com':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Publish to static.adguard.com'
|
|
|
|
|
|
|
|
- 'Publish to Snapstore':
|
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
|
|
|
- 'Publish to Snapstore'
|
|
|
|
|
2021-06-18 15:13:36 +00:00
|
|
|
- 'Publish to GitHub Releases':
|
2021-04-08 10:55:12 +00:00
|
|
|
'manual': false
|
|
|
|
'final': false
|
|
|
|
'jobs':
|
2021-06-18 15:13:36 +00:00
|
|
|
- 'Publish to GitHub Releases'
|
2021-04-08 10:55:12 +00:00
|
|
|
|
|
|
|
'Make release':
|
|
|
|
'docker':
|
|
|
|
'image': '${bamboo.dockerGo}'
|
|
|
|
'volumes':
|
|
|
|
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
|
|
|
|
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
|
|
|
|
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
|
|
|
|
'key': 'MR'
|
2021-04-14 09:40:48 +00:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 10:55:12 +00: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}\
|
|
|
|
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 09:40:48 +00:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 10:55:12 +00: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 15:24:42 +00:00
|
|
|
DOCKER_OUTPUT="type=image,name=adguard/adguardhome,push=true"\
|
2021-04-08 10:55:12 +00:00
|
|
|
VERBOSE='1'\
|
|
|
|
build-docker
|
|
|
|
'environment':
|
|
|
|
DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'Publish to static.adguard.com':
|
|
|
|
'key': 'PUB'
|
2021-04-14 09:40:48 +00:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 10:55:12 +00: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 13:24:59 +00:00
|
|
|
|
|
|
|
cd ./dist/
|
|
|
|
|
2021-05-19 17:31:20 +00:00
|
|
|
CHANNEL="${bamboo.channel}"
|
|
|
|
export CHANNEL
|
|
|
|
|
2021-04-08 13:44:01 +00:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-"$CHANNEL"
|
2021-04-08 10:55:12 +00:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'Publish to Snapstore':
|
2021-04-08 14:56:27 +00:00
|
|
|
'docker':
|
|
|
|
'image': '${bamboo.dockerGo}'
|
2021-04-08 10:55:12 +00:00
|
|
|
'key': 'PTS'
|
2021-04-14 09:40:48 +00:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 10:55:12 +00: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 13:24:59 +00:00
|
|
|
|
|
|
|
cd ./dist/
|
|
|
|
|
2022-04-08 13:43:49 +00: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 10:55:12 +00:00
|
|
|
env\
|
2022-04-08 13:43:49 +00:00
|
|
|
SNAPCRAFT_CHANNEL="$snapchannel"\
|
2021-04-08 10:55:12 +00:00
|
|
|
SNAPCRAFT_EMAIL="${bamboo.snapcraftEmail}"\
|
|
|
|
SNAPCRAFT_MACAROON="${bamboo.snapcraftMacaroonPassword}"\
|
|
|
|
SNAPCRAFT_UBUNTU_DISCHARGE="${bamboo.snapcraftUbuntuDischargePassword}"\
|
2021-04-08 13:44:01 +00:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-snap
|
2021-04-08 10:55:12 +00:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
2021-06-18 15:13:36 +00:00
|
|
|
'Publish to GitHub Releases':
|
2021-04-08 10:55:12 +00:00
|
|
|
'key': 'PTGR'
|
2021-04-14 09:40:48 +00:00
|
|
|
'other':
|
|
|
|
'clean-working-dir': true
|
2021-04-08 10:55:12 +00: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 12:07:18 +00:00
|
|
|
if [ "$CHANNEL" != 'release' ] && [ "${CHANNEL}" != 'beta' ]
|
2021-04-08 10:55:12 +00:00
|
|
|
then
|
2021-06-18 15:13:36 +00:00
|
|
|
echo "don't publish to GitHub Releases for this channel"
|
2021-04-08 10:55:12 +00:00
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-04-08 13:44:01 +00:00
|
|
|
cd ./dist/
|
|
|
|
|
2021-04-08 10:55:12 +00:00
|
|
|
env\
|
|
|
|
GITHUB_TOKEN="${bamboo.githubPublicRepoPassword}"\
|
2021-04-08 13:44:01 +00:00
|
|
|
../bamboo-deploy-publisher/deploy.sh adguard-home-github
|
2021-04-08 10:55:12 +00:00
|
|
|
'final-tasks':
|
|
|
|
- 'clean'
|
|
|
|
'requirements':
|
|
|
|
- 'adg-docker': 'true'
|
|
|
|
|
|
|
|
'triggers':
|
2021-05-13 11:30:40 +00: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 10:55:12 +00: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 14:35:58 +00:00
|
|
|
'url': 'http://prod.jirahub.service.eu.consul/v1/webhook/bamboo?channel=adguard-qa'
|
2021-04-08 10:55:12 +00:00
|
|
|
|
|
|
|
'labels': []
|
|
|
|
'other':
|
|
|
|
'concurrent-build-plugin': 'system-default'
|
2021-04-28 16:14:06 +00:00
|
|
|
|
|
|
|
'branch-overrides':
|
2021-04-30 12:07:40 +00: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 16:14:06 +00:00
|
|
|
'triggers': []
|
2021-04-30 12:07:40 +00: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-03-04 12:50:35 +00:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:4.2'
|
2021-04-30 12:07:40 +00: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 17:31:22 +00:00
|
|
|
# Disable integration branches for release branches.
|
|
|
|
'branch-config':
|
|
|
|
'integration':
|
|
|
|
'push-on-success': false
|
|
|
|
'merge-from': 'beta-v0.107'
|
2021-04-30 12:07:40 +00: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-03-04 12:50:35 +00:00
|
|
|
'dockerGo': 'adguard/golang-ubuntu:4.2'
|