Added .gitlab-ci

This commit is contained in:
Deon George 2021-03-15 23:34:08 +11:00
parent abcbc6cada
commit c4f4a25f36
3 changed files with 51 additions and 0 deletions

19
.gitlab-ci.yml Normal file
View File

@ -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

16
.gitlab-docker-armv7l.yml Normal file
View File

@ -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

16
.gitlab-docker-x86_64.yml Normal file
View File

@ -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