gitlab-build-images/.gitlab-ci.yml
Z.J. van de Weg 863b0ba48f Create Alpine image for static analyses
In the case of rspec or spinach, we can't take the risk to run a couple
of other implementation for C libraries and the like. For static
analyses however, we can take this risk.
2016-11-09 22:44:33 +01:00

40 lines
1 KiB
YAML

image: docker:git
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
before_script:
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
.test_build: &test_build
stage: test
script:
# Hack to set an array in /bin/sh
# http://unix.stackexchange.com/a/137571
- set -- $CI_BUILD_NAME
- docker build -f "Dockerfile.$1" .
except:
- master
.build_and_deploy: &build_and_deploy
stage: build
script:
- docker build -t "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME" -f "Dockerfile.$CI_BUILD_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_NAME"
only:
- master
ruby-2.1-git-2.7-phantomjs-2.1 test: *test_build
ruby-2.3-git-2.7-phantomjs-2.1 test: *test_build
ruby-2.3-static-analyses test: *test_build
www-gitlab-com test: *test_build
doc-gitlab-com test: *test_build
ruby-2.1-git-2.7-phantomjs-2.1: *build_and_deploy
ruby-2.3-git-2.7-phantomjs-2.1: *build_and_deploy
ruby-2.3-static-analyses: *build_and_deploy
www-gitlab-com: *build_and_deploy
doc-gitlab-com: *build_and_deploy