-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·37 lines (33 loc) · 977 Bytes
/
.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
stages:
- build
- deploy
variables:
APPLICATION_NAME: coincheck-scraper
CONTAINER_IMAGE: ${DOCKER_HUB_USERNAME}/${APPLICATION_NAME}
CONTAINER_IMAGE_TAGGED: ${DOCKER_HUB_USERNAME}/${APPLICATION_NAME}:${CI_COMMIT_SHORT_SHA}
image: moreillon/ci-dind
services:
- name: docker:24-dind
build:
only:
- master
stage: build
tags:
- dind
before_script:
- echo "${DOCKER_HUB_PASSWORD}" | docker login --username ${DOCKER_HUB_USERNAME} --password-stdin
script:
- docker build -t ${CONTAINER_IMAGE} .
- docker tag ${CONTAINER_IMAGE} ${CONTAINER_IMAGE_TAGGED}
- docker push ${CONTAINER_IMAGE}
- docker push ${CONTAINER_IMAGE_TAGGED}
deploy:
only:
- master
stage: deploy
tags:
- dind
before_script:
- kubectl config use-context moreillon_ci/moreillon_k8s_home/kubernetes-agent:home
script:
- envsubst < kubernetes_manifest.yml | kubectl apply -n ${KUBERNETES_NAMESPACE} -f -