.gitlab-ci.yml 496 Bytes
Newer Older
Nane Kratzke's avatar
Nane Kratzke committed
1
2
3
services:
- docker:dind

Nane Kratzke's avatar
Nane Kratzke committed
4
stages:
Nane Kratzke's avatar
Nane Kratzke committed
5
6
- test
- build
Nane Kratzke's avatar
Nane Kratzke committed
7
8
9
10
11
12

test:
    stage: test
    script:
    - docker build -t web:test .
    - docker run -d -p 80:80 web:test
Nane Kratzke's avatar
Nane Kratzke committed
13
    - wget http://localhost
Nane Kratzke's avatar
Nane Kratzke committed
14
15
16
17
18
19
20
21

build:
    stage: build
    script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE/web:$CI_COMMIT_SHA -t $CI_REGISTRY_IMAGE/web:latest .
    - docker push $CI_REGISTRY_IMAGE/web:$CI_COMMIT_SHA
    - docker push $CI_REGISTRY_IMAGE/web:latest