-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.example.yml
53 lines (47 loc) · 1.37 KB
/
.gitlab-ci.example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
image: docker:stable
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker-cert"
before_script:
- apk add --no-cache py-pip
- pip install --no-cache-dir docker-compose
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$DOCKER_KEY" > $DOCKER_CERT_PATH/key.pem
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
after_script:
- docker logout $CI_REGISTRY
- rm -rf $DOCKER_CERT_PATH
.dedicated-runner: &dedicated-runner
tags:
- docker
- linux
build:
<<: *dedicated-runner
stage: build
variables:
DOCKER_HOST: "tcp://docker-host:2376"
COMPOSE_FILE: ".docker/build.yml:.docker/env.gitlab.yml"
script:
- docker-compose build --pull
- docker-compose push
deploy:live:
<<: *dedicated-runner
stage: deploy
variables:
DOCKER_HOST: "tcp://docker-host:2376"
COMPOSE_FILE: "docker-compose.yml:\
.docker/service.redis-cache.yml:\
.docker/service.redis-session.yml:\
.docker/env.prod.yml:\
.docker/env.gitlab.yml"
VHOST: "www.domain.tld"
FRONTEND_NETWORK: "frontend"
RESTART: "always"
DB_IMAGE: "mariadb:10.2"
script:
- docker-compose pull
- docker-compose up -d
- docker-compose exec -u www-data typo3 typo3cms extension:setupactive
- docker-compose exec -u www-data typo3 typo3cms cache:flush --force