forked from quadeare/gitpod-kubectl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (33 loc) · 1.4 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
image: docker:latest
stages:
- build
.build:
stage: build
image: docker:dind
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p "$CI_REGISTRY_PASSWORD"
- apk add curl
rules:
- changes:
- Dockerfile
- if: $CI_PIPELINE_SOURCE == "schedule"
build-base:
extends: .build
script:
- KUBECTL_VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- docker build --build-arg KUBECTL_VERSION=$KUBECTL_VERSION -t quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION .
- docker push quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION
- docker tag quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION quadeare/$CI_PROJECT_NAME:latest
- docker push quadeare/$CI_PROJECT_NAME:latest
- docker tag quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION quadeare/$CI_PROJECT_NAME:base
- docker push quadeare/$CI_PROJECT_NAME:base
build-full:
extends: .build
script:
- KUBECTL_VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
- docker build --build-arg KUBECTL_VERSION=$KUBECTL_VERSION --build-arg GITPOD_IMAGE=gitpod/workspace-full:latest -t quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION-full .
- docker push quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION-full
- docker tag quadeare/$CI_PROJECT_NAME:$KUBECTL_VERSION-full quadeare/$CI_PROJECT_NAME:full
- docker push quadeare/$CI_PROJECT_NAME:full