diff mbox series

[XEN,2/3] automation: automatically build debian:stable container

Message ID 20220301121133.19271-3-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series automation: auto-build container, check generated file | expand

Commit Message

Anthony PERARD March 1, 2022, 12:11 p.m. UTC
Only run this on the staging branch, whenever the dockerfile changes.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 .gitlab-ci.yml                       |  2 ++
 automation/gitlab-ci/containers.yaml | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 automation/gitlab-ci/containers.yaml
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5..f934d3eff8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,9 @@ 
 stages:
+  - containers
   - build
   - test
 
 include:
+  - 'automation/gitlab-ci/containers.yaml'
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
diff --git a/automation/gitlab-ci/containers.yaml b/automation/gitlab-ci/containers.yaml
new file mode 100644
index 0000000000..2daf257f11
--- /dev/null
+++ b/automation/gitlab-ci/containers.yaml
@@ -0,0 +1,22 @@ 
+debian-stable-container:
+  stage: containers
+  image: docker:stable
+  variables:
+    BUILD_CONTAINER: debian/stable
+  tags:
+    - container-builder
+  only:
+    refs:
+      - staging
+    changes:
+      - automation/build/${BUILD_CONTAINER}.dockerfile
+  services:
+    - docker:dind
+  before_script:
+    - apk add make
+    - docker info
+    - docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
+  script:
+    - make -C automation/build ${BUILD_CONTAINER} PUSH=1
+  after_script:
+    - docker logout