From c4f4a25f3618b3edbbf37d16608ec6c471b50709 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 15 Mar 2021 23:34:08 +1100 Subject: [PATCH] Added .gitlab-ci --- .gitlab-ci.yml | 19 +++++++++++++++++++ .gitlab-docker-armv7l.yml | 16 ++++++++++++++++ .gitlab-docker-x86_64.yml | 16 ++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .gitlab-docker-armv7l.yml create mode 100644 .gitlab-docker-x86_64.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..0aa411c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +stages: +- build + +variables: + CACHETAG: build-${VERSION} + DOCKER_HOST: tcp://docker:2375 + +services: +- docker:dind + +before_script: +- docker info +- docker version +- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin +# env|sort + +include: + - .gitlab-docker-x86_64.yml + - .gitlab-docker-armv7l.yml diff --git a/.gitlab-docker-armv7l.yml b/.gitlab-docker-armv7l.yml new file mode 100644 index 0000000..da35a4d --- /dev/null +++ b/.gitlab-docker-armv7l.yml @@ -0,0 +1,16 @@ +armv7l:build: + variables: + VERSION: armv7l-buster + stage: build + image: docker:latest + script: + - if [ -f init ]; then chmod 500 init; fi + - docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true + - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . + - docker push ${CI_REGISTRY_IMAGE}:${VERSION} + - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} + tags: + - docker + - armv7l + only: + - buster diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml new file mode 100644 index 0000000..7a80415 --- /dev/null +++ b/.gitlab-docker-x86_64.yml @@ -0,0 +1,16 @@ +x86_64:build: + variables: + VERSION: x86_64 + stage: build + image: docker:latest + script: + - if [ -f init ]; then chmod 500 init; fi + - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" + - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . + - docker push ${CI_REGISTRY_IMAGE}:${VERSION} + - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} + tags: + - docker + - x86_64 + only: + - master