Commit 7631a304 authored by Ľuboslav Pivarč's avatar Ľuboslav Pivarč
Browse files

Merge branch '8-divide-k8s-on-existing-cluster-to-master-dev-beta' into 'master'

Resolve "Divide K8s on existing cluster to Master / Dev / Beta"

Closes #8

See merge request !4
parents ba7e8a31 05345999
Pipeline #22438 passed with stages
in 14 minutes and 2 seconds
......@@ -10,16 +10,30 @@ stages:
.docker-login: &docker-login
before_script:
# - echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
.kube-deploy:
script: &kube-deploy
- sed -i "s^__IMAGE__^${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}^" ./k8s/deployment.yml
- sed -i "s^__NAMESPACE__^${NAMESPACE}^" ./k8s/deployment.yml ./k8s/service.yml
- kubectl version
- kubectl get pods -n cbio-on-demand
- kubectl apply -f ./k8s
- kubectl rollout status -f ./k8s/deployment.yml
.docker-build:
script: &docker-build
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}" ./cbioondemandK8S
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}"
#PRODUCTION
API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" ./cbioondemandK8S
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_SHA}"
*docker-build
only:
refs:
- master
......@@ -31,12 +45,56 @@ API Kube deploy:
variables:
NAMESPACE: cbio-on-demand
script:
- sed -i "s^__IMAGE__^${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}^" ./k8s/deployment.yml
- sed -i "s^__NAMESPACE__^${NAMESPACE}^" ./k8s/deployment.yml ./k8s/service.yml
- kubectl version
- kubectl get pods -n cbio-on-demand
- kubectl apply -f ./k8s
- kubectl rollout status -f ./k8s/deployment.yml
*kube-deploy
only:
refs:
- master
when:
manual
allow_failure: false
#BETA
Beta-API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
*docker-build
only:
refs:
- beta
Beta-API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
variables:
NAMESPACE: cbio-on-demand-beta
script:
*kube-deploy
only:
refs:
- beta
#DEV
Dev-API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
*docker-build
only:
refs:
- dev
Dev-API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
variables:
NAMESPACE: cbio-on-demand-dev
script:
*kube-deploy
only:
refs:
- dev
......@@ -21,7 +21,6 @@ spec:
app: cbio-api
type: ondemand
spec:
# TODO apply Always
imagePullSecrets:
- name: temporary
containers:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment