.gitlab-ci.yml 1.16 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
  image: hadolint/hadolint:latest-debian
16 17
  before_script:
    - date
18 19
  script:
    - find . -name "Dockerfile" -execdir hadolint {} \;
20

Erick Hitter's avatar
Erick Hitter committed
21 22 23 24 25
#
# IMAGE BUILDS/PUSHES
#

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

build-golang-dev:
Erick Hitter's avatar
Erick Hitter committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
  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
55
  script:
Erick Hitter's avatar
Erick Hitter committed
56 57
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.3-dev" ./php/7.3
    - docker push "$CI_REGISTRY_IMAGE/php:7.3-dev"
58 59
  except:
    - master