forked from Rappsilber-Laboratory/xiview-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
51 lines (48 loc) · 1.81 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
variables:
DOCKER_PULL_SECRET: pride-gitlab-docker-secret
IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
DATABASE_INI: application-db-config
docker_build:
image: docker:18.09
stage: build
services:
- docker:18.09-dind
script:
- apk add --update bash gettext tzdata coreutils ca-certificates wget
- update-ca-certificates
- ls
- envsubst '${PORT} ${URL_PREFIX} ${APP_ENTRY}' < .Dockerfile > Dockerfile
- cat Dockerfile
- docker info
- docker build -t $IMAGE .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push $IMAGE
only:
- pride
when: manual
kube_deploy_prod_ec:
environment: embassy_cloud_proteomics
extends: .kube_deploy_script
.kube_deploy_script:
stage: deploy
image: dtzar/helm-kubectl
script:
- apk add --update bash gettext tzdata coreutils
- mkdir -p ~/.kube
- echo $KUBE_CONFIG > kubeconfig
- base64 -d kubeconfig > ~/.kube/config
- kubectl config get-contexts
- kubectl create namespace $k8s_namespace || true
- kubectl -n $k8s_namespace delete secret $DOCKER_PULL_SECRET || true
- kubectl -n $k8s_namespace create secret docker-registry $DOCKER_PULL_SECRET --docker-server=$CI_REGISTRY --docker-username=$CI_DEPLOY_USER --docker-password=$CI_DEPLOY_PASSWORD
- envsubst < default.database.ini > database.ini
# create configmap for first time
- kubectl -n $k8s_namespace create configmap $DATABASE_INI --from-file=database.ini || true
# replace configmap if it already exists
- kubectl -n $k8s_namespace create configmap $DATABASE_INI --from-file=database.ini -o yaml --dry-run=client | kubectl replace -f -
- envsubst < .kubernetes.yml > kubernetes.yml
- cat kubernetes.yml
- kubectl -n $k8s_namespace apply -f kubernetes.yml
only:
- pride
when: manual