dotfiles/.gitlab-ci.yml

59 lines
1.4 KiB
YAML
Raw Normal View History

2019-01-20 16:58:41 +00:00
.image:
2019-01-20 16:03:40 +00:00
stage: build
2019-01-20 16:10:14 +00:00
image: docker:stable
services:
- docker:dind
2019-01-20 16:20:01 +00:00
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker pull $CONTAINER_IMAGE:latest || true
2019-01-20 16:58:41 +00:00
- docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest ./$OS_NAME/
2019-01-20 16:20:01 +00:00
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest
2019-01-20 16:10:14 +00:00
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
2019-01-20 16:58:41 +00:00
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/$OS_NAME
image:fedora:
extends: .image
variables:
OS_NAME: fedora
2019-01-20 16:03:40 +00:00
image:ubuntu:
2019-01-20 16:58:41 +00:00
extends: .image
2019-01-20 16:10:14 +00:00
variables:
2019-01-20 16:58:41 +00:00
OS_NAME: ubuntu
2019-01-20 16:03:40 +00:00
2019-01-20 16:58:41 +00:00
.test:
2019-01-20 12:53:14 +00:00
before_script:
- apk add bash
2019-01-20 16:45:35 +00:00
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
2019-01-20 13:09:46 +00:00
script: ./test.sh
2019-01-20 12:34:54 +00:00
image: docker:stable
services:
- docker:dind
variables:
DETECTED_OS: fedora:29
2019-01-20 16:58:41 +00:00
DOCKER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/$OS_NAME:$CI_COMMIT_SHA
2019-01-20 12:34:54 +00:00
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
2019-01-20 16:03:40 +00:00
dependencies:
- image:fedora
2019-01-20 12:25:43 +00:00
2019-01-20 16:58:41 +00:00
fedora:
extends: .test
variables:
DETECTED_OS: fedora:29
OS_NAME: fedora
dependencies:
- image:fedora
2019-01-20 12:25:43 +00:00
ubuntu:
2019-01-20 16:58:41 +00:00
extends: .test
2019-01-20 12:25:43 +00:00
variables:
2019-01-20 12:34:54 +00:00
DETECTED_OS: ubuntu:cosmic
2019-01-20 16:58:41 +00:00
OS_NAME: ubuntu
2019-01-20 16:03:40 +00:00
dependencies:
- image:ubuntu