Pull request 1885: AG-23334-fix-snap-plan

Merge in DNS/adguard-home from AG-23334-fix-snap-plan to master

Squashed commit of the following:

commit 5d632d1d63c56911e005d0e772e82a509302e948
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Jun 21 17:42:36 2023 +0300

    bamboo-specs: fix snap build; fmt
This commit is contained in:
Ainar Garipov 2023-06-21 17:47:16 +03:00
parent 994906fbd4
commit 123ca87388
3 changed files with 281 additions and 283 deletions

View File

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

View File

@ -117,8 +117,6 @@
env\ env\
VERBOSE='1'\ VERBOSE='1'\
sh ./scripts/snap/build.sh sh ./scripts/snap/build.sh
'final-tasks':
- 'clean'
'requirements': 'requirements':
- 'adg-docker': 'true' - 'adg-docker': 'true'

View File

@ -1,64 +1,64 @@
--- ---
'version': 2 'version': 2
'plan': 'plan':
'project-key': 'AGH' 'project-key': 'AGH'
'key': 'AHBRTSPECS' 'key': 'AHBRTSPECS'
'name': 'AdGuard Home - Build and run tests' 'name': 'AdGuard Home - Build and run tests'
'variables': 'variables':
'dockerGo': 'adguard/golang-ubuntu:6.7' 'dockerGo': 'adguard/golang-ubuntu:6.7'
'stages': 'stages':
- 'Tests': - 'Tests':
'manual': false 'manual': false
'final': false 'final': false
'jobs': 'jobs':
- 'Test' - 'Test'
'Test': 'Test':
'docker': 'docker':
'image': '${bamboo.dockerGo}' 'image': '${bamboo.dockerGo}'
'volumes': 'volumes':
'${system.YARN_DIR}': '${bamboo.cacheYarn}' '${system.YARN_DIR}': '${bamboo.cacheYarn}'
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}' '${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}' '${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'TEST' 'key': 'TEST'
'other': 'other':
'clean-working-dir': true 'clean-working-dir': true
'tasks': 'tasks':
- 'checkout': - 'checkout':
'force-clean-build': true 'force-clean-build': true
- 'script': - 'script':
'interpreter': 'SHELL' 'interpreter': 'SHELL'
'scripts': 'scripts':
- | - |
#!/bin/sh #!/bin/sh
set -e -f -u -x set -e -f -u -x
make VERBOSE=1 ci go-tools lint make VERBOSE=1 ci go-tools lint
'final-tasks': 'final-tasks':
- 'clean' - 'clean'
'requirements': 'requirements':
- 'adg-docker': 'true' - 'adg-docker': 'true'
'branches': 'branches':
'create': 'for-pull-request' 'create': 'for-pull-request'
'delete': 'delete':
'after-deleted-days': 1 'after-deleted-days': 1
'after-inactive-days': 5 'after-inactive-days': 5
'integration': 'integration':
'push-on-success': false 'push-on-success': false
'merge-from': 'AdGuard Home - Build and run tests' 'merge-from': 'AdGuard Home - Build and run tests'
'link-to-jira': true 'link-to-jira': true
'notifications': 'notifications':
- 'events': - 'events':
- 'plan-status-changed' - 'plan-status-changed'
'recipients': 'recipients':
- 'webhook': - 'webhook':
'name': 'Build webhook' 'name': 'Build webhook'
'url': 'http://prod.jirahub.service.eu.consul/v1/webhook/bamboo' 'url': 'http://prod.jirahub.service.eu.consul/v1/webhook/bamboo'
'labels': [] 'labels': []
'other': 'other':
'concurrent-build-plugin': 'system-default' 'concurrent-build-plugin': 'system-default'