[Git][reproducible-builds/diffoscope][master] CI: automatically deploy Docker images

Chris Lamb gitlab at salsa.debian.org
Mon Sep 14 11:10:52 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
53d1aad1 by Paul Spooren at 2020-09-13T11:09:18-10:00
CI: automatically deploy Docker images

Tags and master branch are deployed automatically.

Signed-off-by: Paul Spooren <mail at aparcar.org>

- - - - -


1 changed file:

- .gitlab-ci.yml


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1,11 +1,17 @@
-before_script:
-  - apt-get -q update
-  - mount -o remount,rw /dev
-  - env DEBIAN_FRONTEND=noninteractive apt-get -q -y install --no-install-recommends aspcud apt-cudf
-  - env DEBIAN_FRONTEND=noninteractive apt-get -q -y --solver aspcud -o APT::Solver::Strict-Pinning=0 -o Debug::pkgProblemResolver=yes build-dep .
+stages:
+  - test
+  - deploy
 
 .test_template: &test
+  stage: test
+  variables:
+    DEBIAN_FRONTEND: noninteractive
   script:
+    - apt-get -q update
+    - mount -o remount,rw /dev
+    - apt-get -q -y install --no-install-recommends aspcud apt-cudf
+    - apt-get -q -y --solver aspcud -o APT::Solver::Strict-Pinning=0
+        -o Debug::pkgProblemResolver=yes build-dep .
     - py.test-3 -vv -l -r a --cov=diffoscope --cov-report=term-missing
 
 unstable:
@@ -24,3 +30,31 @@ ubuntu-devel:
   <<: *test
   image: ubuntu:devel
   allow_failure: true
+
+.deploy:
+  image: docker:latest
+  stage: deploy
+  only:
+    - master
+  services:
+    - docker:dind
+  before_script:
+    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+
+deploy-devel:
+  extends: .deploy
+  only:
+    - master
+  script:
+    - docker build -t "$CI_REGISTRY_IMAGE:devel" .
+    - docker push "$CI_REGISTRY_IMAGE:devel"
+
+deploy-tag:
+  extends: .deploy
+  only:
+    - /^[0-9]+$/
+
+  script:
+    - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" .
+    - docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
+    - docker push "$CI_REGISTRY_IMAGE"



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/53d1aad1c0e440b6a632112719ba537f73e9bfa0

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/53d1aad1c0e440b6a632112719ba537f73e9bfa0
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200914/1f87b376/attachment.htm>


More information about the rb-commits mailing list