Updated .gitlab* files to be consistent with other projects

This commit is contained in:
Deon George 2024-02-24 21:50:01 +11:00
parent a1e32b6a2c
commit acb0777640
2 changed files with 25 additions and 11 deletions

View File

@ -1,17 +1,31 @@
stages: stages:
- build - build
- build-manifest
variables: variables:
CACHETAG: build-${VERSION} VERSION: latest
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
VERSIONARCH: ${VERSION}-${ARCH}
cache:
key: ${CI_JOB_NAME_SLUG}-${CI_COMMIT_REF_SLUG}
paths:
- build-cache
image: docker:latest
services: services:
- docker:dind - docker:dind
before_script: before_script:
- docker info - if [ ! -d build-cache ]; then mkdir build-cache; fi
- docker version - sed -i -e s'/https/http/' /etc/apk/repositories
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
- docker info && docker version
# env|sort
- 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
- env|sort
include: .gitlab-docker-x86_64.yml include:
- .gitlab-docker-x86_64.yml
# .gitlab-docker-armv7l.yml
# .gitlab-docker-arm64.yml
- .gitlab-docker-manifest.yml

View File

@ -1,14 +1,14 @@
x86_64:build: 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}) || echo "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