From 20e8f4ec107a2f384103779b6b8444d0e0576088 Mon Sep 17 00:00:00 2001 From: Sheogorath <sheogorath@shivering-isles.com> Date: Thu, 9 Apr 2020 23:16:40 +0200 Subject: [PATCH] Rework build process for SI-GitLab Update base image, add `.gitlab-ci.yml`, integrate build process with SI-GitLab features. All in all, getting a first image build ready to use. --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ Dockerfile | 5 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..eca61f9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,28 @@ +image: quay.io/sheogorath/build-ah-engine + +before_script: + - podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + +stages: + - analyse + - build + - test + - tag + - deploy + +build: + stage: build + script: + - podman build --pull --build-arg "VCS_REF=$CI_COMMIT_SHA" --build-arg "BUILD_DATE=$(date --rfc-3339 ns)" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . + - podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + +tagging-master: + stage: tag + script: + - podman pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + - si-tagging -l "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE" "$(grep -e 'FROM docker.io/library/haproxy:' Dockerfile | sed -e 's/.*://' -e 's/-alpine$//')" + - podman images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | grep "$CI_REGISTRY_IMAGE" | xargs -L 1 podman push + only: + - master + + diff --git a/Dockerfile b/Dockerfile index a3e5611..e27d19b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -ARG REPO=library -FROM ${REPO}/haproxy:1.9-alpine +FROM docker.io/library/haproxy:1.9.15-alpine EXPOSE 2375 ENV ALLOW_RESTARTS=0 \ @@ -37,4 +36,4 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.license=Apache-2.0 \ org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-ref="$VCS_REF" \ - org.label-schema.vcs-url="https://github.com/Tecnativa/docker-socket-proxy" + org.label-schema.vcs-url="https://git.shivering-isles.com/container-library/docker-socket-proxy" -- GitLab