Skip to content
Snippets Groups Projects
Commit fcb22acf authored by Tobias Petrasch's avatar Tobias Petrasch
Browse files

Merge branch 'dev' into 'main'

add production deployment

See merge request !11
parents 5247785d 75168894
No related branches found
No related tags found
1 merge request!11add production deployment
Pipeline #22881 passed
...@@ -86,18 +86,6 @@ deploy_development: ...@@ -86,18 +86,6 @@ deploy_development:
- kubectl set image -f ./kubernetes/deployment.yaml b-container=registry.opencode.de/opencode-analyzer/data-provider:dev_${CI_COMMIT_SHORT_SHA} --namespace=fraunhofer --local -o yaml | kubectl apply --namespace=fraunhofer -f - - kubectl set image -f ./kubernetes/deployment.yaml b-container=registry.opencode.de/opencode-analyzer/data-provider:dev_${CI_COMMIT_SHORT_SHA} --namespace=fraunhofer --local -o yaml | kubectl apply --namespace=fraunhofer -f -
- kubectl apply --namespace=fraunhofer -f ./kubernetes/service.yaml - kubectl apply --namespace=fraunhofer -f ./kubernetes/service.yaml
deploy_development_2:
image: bitnami/kubectl
before_script:
- export KUBECONFIG=$KUBECONFIG_FILE
stage: deploy
only:
- dev
script:
- kubectl apply --namespace=fraunhofer -f ./kubernetes/configmap-dev.yaml
- kubectl set image -f ./kubernetes/deployment-dev.yaml b-dev-container=registry.opencode.de/opencode-analyzer/data-provider:dev_${CI_COMMIT_SHORT_SHA} --namespace=fraunhofer --local -o yaml | kubectl apply --namespace=fraunhofer -f -
- kubectl apply --namespace=fraunhofer -f ./kubernetes/service-dev.yaml
deploy_production: deploy_production:
image: bitnami/kubectl image: bitnami/kubectl
before_script: before_script:
...@@ -106,6 +94,6 @@ deploy_production: ...@@ -106,6 +94,6 @@ deploy_production:
only: only:
- main - main
script: script:
- kubectl apply --namespace=fraunhoferprod -f ./kubernetes/configmap.yaml - kubectl apply --namespace=fraunhoferprod -f ./kubernetes/configmap-prod.yaml
- kubectl set image -f ./kubernetes/deployment.yaml b-container=registry.opencode.de/opencode-analyzer/data-provider:${CI_COMMIT_SHORT_SHA} --namespace=fraunhoferprod --local -o yaml | kubectl apply --namespace=fraunhoferprod -f - - kubectl set image -f ./kubernetes/deployment-prod.yaml b-container=registry.opencode.de/opencode-analyzer/data-provider:${CI_COMMIT_SHORT_SHA} --namespace=fraunhoferprod --local -o yaml | kubectl apply --namespace=fraunhoferprod -f -
- kubectl apply --namespace=fraunhoferprod -f ./kubernetes/service.yaml - kubectl apply --namespace=fraunhoferprod -f ./kubernetes/service.yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: data-provider-dev-config-map name: data-provider-config-map
data: data:
GIT_CLONE_TARGET_DIRECTORY: "/app/git" GIT_CLONE_TARGET_DIRECTORY: "/app/git"
OCCMD_PATH: "/app/scripts/occmd.sh" OCCMD_PATH: "/app/scripts/occmd.sh"
PORT: "5000" PORT: "5000"
MANAGEMENT_PORT: "5001" MANAGEMENT_PORT: "5001"
XDG_CONFIG_HOME: "/app/.config" XDG_CONFIG_HOME: "/app/.config"
CORS_ORIGIN: "https://dev-kpi.o4oe.de" CORS_ORIGIN: "https://sec-kpi.opencode.de"
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: b-dev-deployment name: b-deployment
annotations: annotations:
field.cattle.io/description: Backend of Fraunhofer OpenCoDE Analyzer field.cattle.io/description: Backend of Fraunhofer OpenCoDE Analyzer
labels: labels:
workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-dev-deployment workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-deployment
spec: spec:
selector: selector:
matchLabels: matchLabels:
workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-dev-deployment workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-deployment
template: template:
metadata: metadata:
labels: labels:
workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-dev-deployment workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-deployment
spec: spec:
securityContext: securityContext:
runAsNonRoot: true runAsNonRoot: true
volumes: volumes:
- name: db-secret-volume - name: db-secret-volume
secret: secret:
secretName: cockroachdb.client.fraunhoferpoc secretName: cockroachdb.client.fraunhoferpocprod
containers: containers:
- imagePullPolicy: Always - imagePullPolicy: Always
name: b-dev-container name: b-container
image: registry.opencode.de/opencode-analyzer/data-provider:latest image: registry.opencode.de/opencode-analyzer/data-provider:latest
volumeMounts: volumeMounts:
- mountPath: "/cockroach-certs" - mountPath: "/cockroach-certs"
...@@ -37,7 +37,7 @@ spec: ...@@ -37,7 +37,7 @@ spec:
cpu: 4000m cpu: 4000m
memory: 8G memory: 8G
ports: ports:
- name: b-dev-service - name: b-service
containerPort: 5000 containerPort: 5000
env: env:
- name: ADMIN_PASSWORD - name: ADMIN_PASSWORD
...@@ -64,6 +64,6 @@ spec: ...@@ -64,6 +64,6 @@ spec:
- configMapRef: - configMapRef:
name: crdbconf name: crdbconf
- configMapRef: - configMapRef:
name: data-provider-dev-config-map name: data-provider-config-map
restartPolicy: Always restartPolicy: Always
replicas: 1 replicas: 1
apiVersion: v1
kind: Service
metadata:
name: b-dev-service
spec:
selector:
workload.user.cattle.io/workloadselector: apps.deployment-fraunhofer-b-dev-deployment
ports:
- port: 5000
targetPort: 5000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.