[buildbot] ci: docker: deploy automatically only on default branch and tags
LEDE Commits
lede-commits at lists.infradead.org
Wed Nov 3 07:05:41 PDT 2021
ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/46c1b080d3eadebbb504150788ddd2d9424eb28f
commit 46c1b080d3eadebbb504150788ddd2d9424eb28f
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Wed Nov 3 14:59:26 2021 +0100
ci: docker: deploy automatically only on default branch and tags
In commit fecd899e8189 ("docker: deploy only manually and on
master/tags") we've introduced manual deployment of the Docker images,
but this is unneeded additional manual step, so rather prefer automatic
deployment. While at it, convert to usage of `rules:` as `only:` is
deprecated and `rules:` are preferred.
Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
.gitlab/docker.yml | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/.gitlab/docker.yml b/.gitlab/docker.yml
index 9140432..5cc4951 100644
--- a/.gitlab/docker.yml
+++ b/.gitlab/docker.yml
@@ -23,10 +23,9 @@
.deploy Docker image:
extends: .docker in docker
- only:
- - master
- - tags
- when: manual
+ rules:
+ - if: $CI_COMMIT_TAG
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- export IMAGE_NAME="$(echo $CI_JOB_NAME | sed 's/deploy Docker image \(.*\)/\1/')"
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
More information about the lede-commits
mailing list