-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
31 lines (27 loc) · 1011 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
image: docker:stable
stages:
- build
- deploy
variables:
CONTAINER_IMAGE: registry.docker.neuro.ukm.ms/${CI_PROJECT_NAMESPACE}/nps-webui
build:
stage: build
script:
- docker build -t $CONTAINER_IMAGE:${CI_COMMIT_SHA:0:10} .
- docker push $CONTAINER_IMAGE:${CI_COMMIT_SHA:0:10}
- docker tag $CONTAINER_IMAGE:${CI_COMMIT_SHA:0:10} $CONTAINER_IMAGE:${CI_COMMIT_REF_NAME}
- docker push $CONTAINER_IMAGE:${CI_COMMIT_REF_NAME}
- echo "$CONTAINER_IMAGE:${CI_COMMIT_REF_NAME}"
deploy to production:
stage: deploy
only:
- master
script:
- apk add --no-cache curl
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- mv ./kubectl /usr/local/bin/kubectl
- kubectl set image deployment/search web-ui=$CONTAINER_IMAGE:${CI_COMMIT_SHA:0:10}
environment:
name: production
url: https://search.nps.neuro.ukm.ms