Updated .gitlab* files to be consistent with other projects

This commit is contained in:
Deon George 2024-02-24 19:58:37 +11:00
parent b796dca4ba
commit 0f3dec07a8
3 changed files with 30 additions and 18 deletions

View File

@ -1,14 +1,26 @@
stages: stages:
- build - build
- build-manifest
variables: variables:
CACHETAG: build-${VERSION}
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
BRANCH: latest
VERSION: ${BRANCH}
VERSIONARCH: ${VERSION}-${ARCH}
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- docker/
image: docker:latest
services: services:
- docker:dind - docker:dind
before_script: before_script:
- if [ ! -d docker ]; then mkdir docker; fi
# sed -i -e s'/https/http/' /etc/apk/repositories
# HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
- docker info - docker info
- docker version - docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin - echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin

View File

@ -1,14 +1,14 @@
build:armv7l: armv7l:build:
variables: variables:
VERSION: armv7l ARCH: armv7l
stage: build stage: build
image: docker:latest image: docker:latest
script: script:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true - ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG}
tags: tags:
- docker - docker
- armv7l - armv7l

View File

@ -1,14 +1,14 @@
build:x86_64: x86_64:build:
variables: variables:
VERSION: x86_64 ARCH: x86_64
stage: build stage: build
image: docker:latest
script: script:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true - ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - rm build-cache/* || true
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG}
tags: tags:
- docker - docker
- x86_64 - x86_64