Improvements to the build system imported from other projects

This commit is contained in:
Héctor Molinero Fernández
2019-09-02 21:52:36 +02:00
parent 3657a753e1
commit 357e5c5c9b
7 changed files with 127 additions and 127 deletions

View File

@@ -1,137 +1,137 @@
image: docker:stable
image: "docker.io/docker:stable"
services:
- docker:dind
- "docker:dind"
stages:
- build:images
- push:images
- push:manifests
- "build:images"
- "push:images"
- "push:manifests"
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_HOST: "tcp://docker:2375"
DOCKER_DRIVER: "overlay2"
build:native-image:
stage: build:images
stage: "build:images"
before_script:
- docker info
- apk add --no-cache coreutils git m4 make xz
- "docker info"
- "apk add --no-cache coreutils git m4 make xz"
script:
- make build-native-image save-native-image
- "make build-native-image save-native-image"
except:
- tags
- "tags"
artifacts:
expire_in: 1 day
expire_in: "1 day"
paths:
- dist/
- "dist/"
build:amd64-image:
stage: build:images
stage: "build:images"
before_script:
- docker info
- apk add --no-cache coreutils git m4 make xz
- make binfmt-register
- "docker info"
- "apk add --no-cache coreutils git m4 make xz"
- "make binfmt-register"
script:
- make build-amd64-image save-amd64-image
- "make build-amd64-image save-amd64-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
artifacts:
expire_in: 1 week
expire_in: "1 week"
paths:
- dist/
- "dist/"
build:arm32v7-image:
stage: build:images
stage: "build:images"
before_script:
- docker info
- apk add --no-cache coreutils git m4 make xz
- make binfmt-register
- "docker info"
- "apk add --no-cache coreutils git m4 make xz"
- "make binfmt-register"
script:
- make build-arm32v7-image save-arm32v7-image
- "make build-arm32v7-image save-arm32v7-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
artifacts:
expire_in: 1 week
expire_in: "1 week"
paths:
- dist/
- "dist/"
build:arm64v8-image:
stage: build:images
stage: "build:images"
before_script:
- docker info
- apk add --no-cache coreutils git m4 make xz
- make binfmt-register
- "docker info"
- "apk add --no-cache coreutils git m4 make xz"
- "make binfmt-register"
script:
- make build-arm64v8-image save-arm64v8-image
- "make build-arm64v8-image save-arm64v8-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
artifacts:
expire_in: 1 week
expire_in: "1 week"
paths:
- dist/
- "dist/"
push:amd64-image:
stage: push:images
stage: "push:images"
before_script:
- apk add --no-cache coreutils git make xz
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}" >/dev/null 2>&1
- "apk add --no-cache coreutils git make xz"
- "docker login -u \"${CI_REGISTRY_USER:?}\" -p \"${CI_REGISTRY_PASSWORD:?}\" \"${CI_REGISTRY:?}\" >/dev/null 2>&1"
script:
- make load-amd64-image push-amd64-image
- "make load-amd64-image push-amd64-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
dependencies:
- build:amd64-image
- "build:amd64-image"
push:arm32v7-image:
stage: push:images
stage: "push:images"
before_script:
- apk add --no-cache coreutils git make xz
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}" >/dev/null 2>&1
- "apk add --no-cache coreutils git make xz"
- "docker login -u \"${CI_REGISTRY_USER:?}\" -p \"${CI_REGISTRY_PASSWORD:?}\" \"${CI_REGISTRY:?}\" >/dev/null 2>&1"
script:
- make load-arm32v7-image push-arm32v7-image
- "make load-arm32v7-image push-arm32v7-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
dependencies:
- build:arm32v7-image
- "build:arm32v7-image"
push:arm64v8-image:
stage: push:images
stage: "push:images"
before_script:
- apk add --no-cache coreutils git make xz
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}" >/dev/null 2>&1
- "apk add --no-cache coreutils git make xz"
- "docker login -u \"${CI_REGISTRY_USER:?}\" -p \"${CI_REGISTRY_PASSWORD:?}\" \"${CI_REGISTRY:?}\" >/dev/null 2>&1"
script:
- make load-arm64v8-image push-arm64v8-image
- "make load-arm64v8-image push-arm64v8-image"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
dependencies:
- build:arm64v8-image
- "build:arm64v8-image"
push:cross-manifest:
stage: push:manifests
stage: "push:manifests"
before_script:
- apk add --no-cache coreutils git make xz
- "apk add --no-cache coreutils git make"
- "mkdir -p ~/.docker/ && printf '%s\n' '{\"experimental\": \"enabled\"}' > ~/.docker/config.json"
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}" >/dev/null 2>&1
- "docker login -u \"${CI_REGISTRY_USER:?}\" -p \"${CI_REGISTRY_PASSWORD:?}\" \"${CI_REGISTRY:?}\" >/dev/null 2>&1"
script:
- make push-cross-manifest
- "make push-cross-manifest"
only:
- /^v([0-9.]+)(-.+)?$/
- "/^v([0-9.]+)(-.+)?$/"
except:
- branches
- "branches"
dependencies:
- push:amd64-image
- push:arm32v7-image
- push:arm64v8-image
- "push:amd64-image"
- "push:arm32v7-image"
- "push:arm64v8-image"