.gitlab-ci.yml 1.13 KB
Newer Older
1 2 3 4 5 6 7 8
image: docker:latest

services:
  - docker:dind

before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

Erick Hitter's avatar
Erick Hitter committed
9 10 11 12
#
# TESTS
#

13
lint_dockerfile:
Erick Hitter's avatar
Erick Hitter committed
14
  stage: test
15 16 17
  image: hadolint/hadolint:latest-debian
  script:
    - find . -name "Dockerfile" -execdir hadolint {} \;
18

Erick Hitter's avatar
Erick Hitter committed
19 20 21 22 23
#
# IMAGE BUILDS/PUSHES
#

# Golang
24
build-golang-master:
Erick Hitter's avatar
Erick Hitter committed
25
  stage: deploy
26
  script:
Erick Hitter's avatar
Erick Hitter committed
27 28
    - docker build --pull -t "$CI_REGISTRY_IMAGE/golang:latest" ./golang/latest
    - docker push "$CI_REGISTRY_IMAGE/golang:latest"
29 30
  only:
    - master
Erick Hitter's avatar
Erick Hitter committed
31
  when: manual
32 33

build-golang-dev:
Erick Hitter's avatar
Erick Hitter committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/golang:latest-dev" ./golang/latest
    - docker push "$CI_REGISTRY_IMAGE/golang:latest-dev"
  except:
    - master

# PHP 7.3
build-php-7.3-master:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.3" ./php/7.3
    - docker push "$CI_REGISTRY_IMAGE/php:7.3"
  only:
    - master
  when: manual

build-php-7.3-dev:
  stage: deploy
53
  script:
Erick Hitter's avatar
Erick Hitter committed
54 55
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.3-dev" ./php/7.3
    - docker push "$CI_REGISTRY_IMAGE/php:7.3-dev"
56 57
  except:
    - master