.gitlab-ci.yml 5.35 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
15
  image: hadolint/hadolint:latest-debian
16
  before_script:
17 18
    - mkdir ~/.config
    - cp ./.hadolint.yaml ~/.config/hadolint.yaml
19 20
  script:
    - find . -name "Dockerfile" -execdir hadolint {} \;
21

Erick Hitter's avatar
Erick Hitter committed
22 23 24 25 26 27 28 29
lint-shell-script:
  stage: test
  image: koalaman/shellcheck-alpine:latest
  before_script:
    - shellcheck -V
  script:
    - find . -name "*.sh" -exec shellcheck {} \;

Erick Hitter's avatar
Erick Hitter committed
30 31 32 33 34
#
# IMAGE BUILDS/PUSHES
#

# Golang
35
build-golang-master:
Erick Hitter's avatar
Erick Hitter committed
36
  stage: deploy
37
  script:
Erick Hitter's avatar
Erick Hitter committed
38 39
    - docker build --pull -t "$CI_REGISTRY_IMAGE/golang:latest" ./golang/latest
    - docker push "$CI_REGISTRY_IMAGE/golang:latest"
40 41
  only:
    - master
Erick Hitter's avatar
Erick Hitter committed
42
  when: manual
43 44

build-golang-dev:
Erick Hitter's avatar
Erick Hitter committed
45 46 47 48 49 50
  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
Erick Hitter's avatar
Erick Hitter committed
51

Erick Hitter's avatar
Erick Hitter committed
52
# Debian Buster builds
Erick Hitter's avatar
Erick Hitter committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
build-debian-buster-build-master:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:buster" ./debian/buster
    - docker push "$CI_REGISTRY_IMAGE/debian:buster"
  only:
    - master
  when: manual

build-debian-buster-build-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:buster-dev" ./debian/buster
    - docker push "$CI_REGISTRY_IMAGE/debian:buster-dev"
  except:
    - master
69

Erick Hitter's avatar
Erick Hitter committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
# Debian Stretch builds
build-debian-stretch-build-master:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:stretch" ./debian/stretch
    - docker push "$CI_REGISTRY_IMAGE/debian:stretch"
  only:
    - master
  when: manual

build-debian-stretch-build-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:stretch-dev" ./debian/stretch
    - docker push "$CI_REGISTRY_IMAGE/debian:stretch-dev"
  except:
    - master
Erick Hitter's avatar
Erick Hitter committed
87

Erick Hitter's avatar
Erick Hitter committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
# Debian Jessie builds
build-debian-jessie-build-master:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:jessie" ./debian/jessie
    - docker push "$CI_REGISTRY_IMAGE/debian:jessie"
  only:
    - master
  when: manual

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

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
# Debian WP.org Plugin deploy builds
build-debian-wp-org-deploy-build-master:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:wp-org-deploy" ./debian/wp-org-deploy
    - docker push "$CI_REGISTRY_IMAGE/debian:wp-org-deploy"
  only:
    - master
  when: manual

build-debian-wp-org-deploy-build-dev:
  stage: deploy
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/debian:wp-org-deploy-dev" ./debian/wp-org-deploy
    - docker push "$CI_REGISTRY_IMAGE/debian:wp-org-deploy-dev"
  except:
    - master

Erick Hitter's avatar
Erick Hitter committed
124 125 126 127 128 129 130 131 132 133 134 135
# 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
136
  script:
Erick Hitter's avatar
Erick Hitter committed
137 138
    - docker build --pull -t "$CI_REGISTRY_IMAGE/php:7.3-dev" ./php/7.3
    - docker push "$CI_REGISTRY_IMAGE/php:7.3-dev"
139 140
  except:
    - master
Erick Hitter's avatar
Erick Hitter committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233

# 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