Commit 5a87726e authored by Ľuboslav Pivarč's avatar Ľuboslav Pivarč
Browse files

CI

parent 6cd96415
Pipeline #21089 failed with stages
in 15 seconds
stages:
- build
- deploy
.kube-auth: &kube-auth
before_script:
- echo "$KUBE_CONFIG" > ~/.kube/config
.docker-login: &docker-login
before_script:
- echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
API docker image build:
stage: build
<<: *docker-login
image: docker:latest
script:
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME}"
only:
refs:
- master
API Kube deploy:
stage: deploy
<<: *kube-auth
image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
variables:
NAMESPACE: cbio-on-demand
script:
- sed -i "s/__IMAGE__/${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
- sed -i "s/__NAMESPACE__/${NAMESPACE}"
- kubectl get pods -n cbio-on-demand
- kubectl apply -f ./k8s
- kubectl rollout status -f ./k8s/deployment.yaml
only:
refs:
- master
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: __NAMESPACE__
name: cbio-api
annotations:
maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
selector:
matchLabels:
app: cbio-api
type: ondemand
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: cbio-api
type: ondemand
spec:
containers:
- name: cbio-api
image: __IMAGE__
ports:
- name: http
containerPort: 8080
livenessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 2
readinessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 1
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 2
apiVersion: example.com/v1beta1
kind: identifier
metadata:
generateName: cod
namespace: __NAMESPACE__
# annotations:
# maintainer: Luboslav Pivarc <456130@muni.cz>
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: identifiers.example.com
annotations:
maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
scope: Namespaced
group: example.com
version: v1beta1
names:
kind: identifier
singular: identifier
plural: identifiers
apiVersion: v1
kind: Service
metadata:
name: cbio-api
namespace: __NAMESPACE__
labels:
app: cbio-api
type: ondemand
annotations:
maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
selector:
app: cbio-api
type: ondemand
ports:
- port: 80
targetPort: http
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