.gitlab-ci.yml 3.19 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
Erick Hitter's avatar
Erick Hitter committed
60 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

# 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