dotfiles/.gitlab-ci.yml

70 lines
1.5 KiB
YAML
Raw Normal View History

2019-01-20 16:58:41 +00:00
.image:
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 17:05:32 +00:00
stage: build
image: docker:stable
services:
- docker:dind
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 13:09:46 +00:00
script: ./test.sh
2019-01-20 17:05:32 +00:00
stage: test
2019-01-20 12:34:54 +00:00
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
2019-01-20 18:10:09 +00:00
DOCKER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/$OS_NAME:$CI_COMMIT_SHA
2019-01-20 12:25:43 +00:00
2019-01-20 18:10:09 +00:00
fedora:cached:
2019-01-20 16:58:41 +00:00
extends: .test
variables:
2019-05-01 16:40:38 +01:00
DETECTED_OS: fedora:30
2019-01-20 16:58:41 +00:00
OS_NAME: fedora
dependencies:
- image:fedora
2019-01-20 18:10:09 +00:00
ubuntu:cached:
2019-01-20 16:58:41 +00:00
extends: .test
2019-01-20 12:25:43 +00:00
variables:
2019-05-19 22:05:07 +01:00
DETECTED_OS: ubuntu:disco
2019-01-20 16:58:41 +00:00
OS_NAME: ubuntu
2019-01-20 16:03:40 +00:00
dependencies:
- image:ubuntu
2019-03-04 15:29:11 +00:00
fedora:fresh:
extends: .test
variables:
2019-05-01 16:40:38 +01:00
DETECTED_OS: fedora:30
2019-03-04 15:29:11 +00:00
OS_NAME: fedora
2019-05-01 16:40:38 +01:00
DOCKER_IMAGE: fedora:30
2019-03-04 15:29:11 +00:00
ubuntu:fresh:
extends: .test
variables:
2019-05-19 22:05:07 +01:00
DETECTED_OS: ubuntu:disco
2019-03-04 15:29:11 +00:00
OS_NAME: ubuntu
2019-05-19 22:05:07 +01:00
DOCKER_IMAGE: ubuntu:disco