-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
54 lines (48 loc) · 1.28 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
image: docker:latest
variables:
DOCKER_DRIVER: overlay
services:
- docker:dind
stages:
- build
- package
- deploy
ontology-build:
image: openjdk:8-jdk-alpine
stage: build
tags:
- docker
script:
- "apk add --update make"
- "apk add --update curl"
- "cd src/ontology ; ./get_mirrors.sh"
- "curl https://raw.githubusercontent.com/EBISPOT/efo/master/src/ontology/efo-edit.owl > efo-edit.owl"
- "make all_imports"
- "make"
- "cp build/efo.owl ../../efo.owl"
artifacts:
paths:
- efo.owl
docker-build:
stage: package
dependencies:
- ontology-build
tags:
- docker-socket
script:
- docker build -t efo3-ols .
- docker tag efo3-ols eu.gcr.io/$GOOGLE_PROJECT_KEY/efo3-ols
- echo "$GOOGLE_KEY" > key.json
- docker login -u _json_key --password-stdin https://eu.gcr.io < key.json
- docker push eu.gcr.io/$GOOGLE_PROJECT_KEY/efo3-ols:latest
k8s-deploy:
image: google/cloud-sdk
stage: deploy
script:
- echo "$GOOGLE_KEY" > key.json
- gcloud auth activate-service-account --key-file key.json
- gcloud config set compute/zone europe-west1
- gcloud config set project efo3-ols
- gcloud container clusters get-credentials efo3-ols
- kubectl delete --ignore-not-found=true deployment efo3-ols
- kubectl apply -f deployment.yml