Commit 8497ad6d authored by Ľuboslav Pivarč's avatar Ľuboslav Pivarč
Browse files

changed image to refer ci-images & refactor CI

parent c25617f6
Pipeline #25676 passed with stages
in 15 minutes and 11 seconds
......@@ -12,89 +12,65 @@ stages:
before_script:
- echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
.kube-deploy:
script: &kube-deploy
.kube-deploy: &kube-deploy
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/ci-images/ci:latest
script:
- 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 ${NAMESPACE}
- kubectl apply -f ./k8s
- kubectl rollout status -f ./k8s/deployment.yml
allow_failure: false
.docker-build:
script: &docker-build
.docker-build: &docker-build
stage: build
<<: *docker-login
image: docker:latest
script:
- 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
<<: *docker-build
only:
refs:
- master
- master
API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
<<: *kube-deploy
variables:
NAMESPACE: cbio-on-demand
script:
*kube-deploy
only:
refs:
- master
- master
when:
manual
allow_failure: false
#BETA
Beta-API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
*docker-build
<<: *docker-build
only:
refs:
- beta
- beta
Beta-API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
<<: *kube-deploy
variables:
NAMESPACE: cbio-on-demand-beta
script:
*kube-deploy
only:
refs:
- beta
- beta
#DEV
Dev-API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
*docker-build
<<: *docker-build
only:
refs:
- dev
- dev
Dev-API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
<<: *kube-deploy
variables:
NAMESPACE: cbio-on-demand-dev
script:
*kube-deploy
only:
refs:
- dev
#
- dev
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