.gitlab-ci.yml 3.25 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
#

Erick Hitter's avatar
Erick Hitter committed
13
lint_dockerfile:
Erick Hitter's avatar
Erick Hitter committed
14
  stage: test
Erick Hitter's avatar
Erick Hitter committed
15
  image: hadolint/hadolint:latest-debian
16
  before_script:
17 18
    - mkdir ~/.config
    - cp ./.hadolint.yaml ~/.config/hadolint.yaml
Erick Hitter's avatar
Erick Hitter committed
19 20
  script:
    - find . -name "Dockerfile" -execdir hadolint {} \;
21

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

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

build-golang-dev:
Erick Hitter's avatar
Erick Hitter committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
  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
56
  script:
Erick Hitter's avatar
Erick Hitter committed
57 58
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.3-dev" ./php/7.3
    - docker push "$CI_REGISTRY_IMAGE/php:7.3-dev"
59 60
  except:
    - master
Erick Hitter's avatar
Erick Hitter committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153

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

build-php-7.2-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.2-dev" ./php/7.2
    - docker push "$CI_REGISTRY_IMAGE/php:7.2-dev"
  except:
    - master

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

build-php-7.1-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.1-dev" ./php/7.1
    - docker push "$CI_REGISTRY_IMAGE/php:7.1-dev"
  except:
    - master

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

build-php-7.0-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.0-dev" ./php/7.0
    - docker push "$CI_REGISTRY_IMAGE/php:7.0-dev"
  except:
    - master
  allow_failure: true

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

build-php-5.6-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:5.6-dev" ./php/5.6
    - docker push "$CI_REGISTRY_IMAGE/php:5.6-dev"
  except:
    - master
  allow_failure: true

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

build-php-5.3-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:5.3-dev" ./php/5.3
    - docker push "$CI_REGISTRY_IMAGE/php:5.3-dev"
  except:
    - master
  allow_failure: true