fix(build): tag images with architecture
This commit is contained in:
parent
1304cf5f02
commit
d2c50a1353
|
@ -36,6 +36,7 @@ stages:
|
|||
allow_failure: false
|
||||
|
||||
.build-docker: &build-docker
|
||||
stage: image
|
||||
image: docker:18.09.9
|
||||
services:
|
||||
- docker:18.09.9-dind
|
||||
|
@ -50,11 +51,13 @@ stages:
|
|||
- echo "${DOCKER_SECRET}" | base64 -d > ${HOME}/.docker/config.json
|
||||
- docker info
|
||||
script:
|
||||
- docker build -t $IMAGE_TAG .
|
||||
- docker push $IMAGE_TAG
|
||||
- docker build -f Dockerfile.${IMAGE_ARCH} -t ${IMAGE_TAG}-${IMAGE_ARCH} .
|
||||
- docker push ${IMAGE_TAG}-${IMAGE_ARCH}
|
||||
after_script:
|
||||
- rm -rfv ${HOME}/.docker
|
||||
|
||||
dependencies:
|
||||
- build-node
|
||||
variables: &vars-docker
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_HOST: tcp://localhost:2375
|
||||
|
@ -98,28 +101,40 @@ build-node:
|
|||
- node_modules
|
||||
- out/cache
|
||||
|
||||
build-image-branch:
|
||||
.build-image-alpine-branch:
|
||||
<<: [*build-docker]
|
||||
stage: image
|
||||
except:
|
||||
- tags
|
||||
|
||||
dependencies:
|
||||
- build-node
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_ARCH: alpine
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_REF_SLUG}"
|
||||
|
||||
build-image-tag:
|
||||
.build-image-alpine-tag:
|
||||
<<: [*build-docker]
|
||||
stage: image
|
||||
only:
|
||||
- tags
|
||||
|
||||
dependencies:
|
||||
- build-node
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_ARCH: alpine
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_TAG}"
|
||||
|
||||
build-image-stretch-branch:
|
||||
<<: [*build-docker]
|
||||
except:
|
||||
- tags
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_ARCH: stretch
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_REF_SLUG}"
|
||||
|
||||
build-image-stretch-tag:
|
||||
<<: [*build-docker]
|
||||
only:
|
||||
- tags
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_ARCH: stretch
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_TAG}"
|
||||
|
||||
# publish jobs
|
||||
|
|
Loading…
Reference in New Issue