Revize 08cc2479
Přidáno uživatelem Marek Lovčí před téměř 5 roky(ů)
- ID 08cc2479b59f828b58c4acd1c44ae1413341f8fe
- Rodič bcd08947
.gitlab-ci.yml | ||
---|---|---|
1 |
image: docker:latest |
|
2 |
services: |
|
3 |
- docker:dind |
|
4 | ||
1 | 5 |
stages: |
2 | 6 |
- build |
3 | 7 |
- test |
4 | 8 | |
9 |
variables: |
|
10 |
# When using dind service, we need to instruct docker, to talk with |
|
11 |
# the daemon started inside of the service. The daemon is available |
|
12 |
# with a network connection instead of the default |
|
13 |
# /var/run/docker.sock socket. Docker 19.03 does this automatically |
|
14 |
# by setting the DOCKER_HOST in |
|
15 |
# https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29 |
|
16 |
# |
|
17 |
# The 'docker' hostname is the alias of the service container as described at |
|
18 |
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services. |
|
19 |
# |
|
20 |
# Note that if you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier, |
|
21 |
# the variable must be set to tcp://localhost:2376 because of how the |
|
22 |
# Kubernetes executor connects services to the job container |
|
23 |
# DOCKER_HOST: tcp://localhost:2376 |
|
24 |
# |
|
25 |
# Specify to Docker where to create the certificates, Docker will |
|
26 |
# create them automatically on boot, and will create |
|
27 |
# `/certs/client` that will be shared between the service and job |
|
28 |
# container, thanks to volume mount from config.toml |
|
29 |
DOCKER_TLS_CERTDIR: "/certs" |
|
30 | ||
31 |
before_script: |
|
32 |
- docker info |
|
33 | ||
5 | 34 |
build: |
6 | 35 |
stage: build |
7 | 36 |
# only: |
8 | 37 |
# refs: |
9 | 38 |
# - master |
10 | 39 |
script: |
11 |
- composer install |
|
12 |
- cp .env.example .env |
|
13 |
- php artisan key:generate |
|
14 |
- php artisan migrate --seed |
|
40 |
- docker build -t kaplicky . |
|
15 | 41 | |
16 | 42 |
unit_test: |
17 | 43 |
stage: test |
... | ... | |
19 | 45 |
# refs: |
20 | 46 |
# - master |
21 | 47 |
script: |
22 |
- php ./vendor/bin/phpunit |
|
48 |
- cp .env.example .env |
|
49 |
- composer install |
|
50 |
- php artisan key:generate |
|
51 |
- php artisan migrate |
|
52 |
- vendor/bin/phpunit |
Dockerfile | ||
---|---|---|
1 | 1 |
# Set the base image for subsequent instructions |
2 |
FROM php:7.1
|
|
2 |
FROM php:7.2.5
|
|
3 | 3 | |
4 | 4 |
# Update packages |
5 | 5 |
RUN apt-get update |
Také k dispozici: Unified diff
Try new CI/CD setup