Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #291 from ImisDevelopers/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wobkenh authored May 11, 2020
2 parents 9525556 + 0822a9c commit 9dbf7ef
Show file tree
Hide file tree
Showing 294 changed files with 10,572 additions and 3,238 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
end_of_line = lf
insert_final_newline = false

[*.{yml,yaml}]
indent_style = space
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
- feature/*
- master
- dev
- pilot
pull_request:
branches:
- master
- dev
- pilot

# Environment variables available to all jobs and steps in this workflow
env:
Expand All @@ -24,7 +26,6 @@ jobs:
with:
java-version: 1.11
- uses: actions/checkout@v2

# Configure docker to use the gcloud command-line tool as a credential helper
- run: |
git fetch --unshallow
gradle build lint test
23 changes: 16 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches:
- dev
- jib-integration
- pilot

# Environment variables available to all jobs and steps in this workflow
env:
Expand Down Expand Up @@ -67,8 +67,11 @@ jobs:
# Build and push image to Google Container Registry
- name: Build
run: |-
gradle server:test --tests "*GenerateSwagger" -x processResources
gradle client:generateClient
gradle jib --image "$REGISTRY_HOSTNAME/$GKE_PROJECT_ID/imis:$GITHUB_SHA"
# Deploy the Docker image to the GKE cluster
- name: Prepare Helm
uses: azure/setup-helm@v1
Expand All @@ -82,12 +85,18 @@ jobs:
echo -n "${CLOUD_STORE_SERVICE_ACCOUNT}" > chart/cloudstore.base64.json
helm repo add stable "https://kubernetes-charts.storage.googleapis.com"
helm upgrade --install traefik stable/traefik -f chart/traefik.values.yaml
values=""
target="${GITHUB_REF//refs\/heads\//}"
if [[ "$GITHUB_EVENT_NAME" == "release" ]]; then
helm upgrade --install imis-production chart \
--set gitSha=${GITHUB_SHA} --set "secrets.postgres=$(echo -n ${POSTGRES_PASSWORD} | base64)"
kubectl rollout status deployment/imis-production
target="production"
elif [[ -f "chart/values.${target}.yml" ]]; then
values="-f chart/values.${target}.yml"
else
helm upgrade --install imis-staging chart -f chart/values.staging.yml \
--set gitSha=${GITHUB_SHA} --set "secrets.postgres=$(echo -n ${POSTGRES_PASSWORD} | base64)"
kubectl rollout status deployment/imis-staging
echo "unkown target ${target}"
exit 42
fi
helm upgrade --install "imis-${target}" chart $values \
--set gitSha=${GITHUB_SHA} --set "secrets.postgres=$(echo -n ${POSTGRES_PASSWORD} | base64)"
kubectl rollout status "deployment/imis-${target}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
.idea
.gradle
.DS_Store
**/.project
**/.settings
/.classpath
# CMake
cmake-build-*/

Expand Down Expand Up @@ -72,3 +75,4 @@ client/npm-debug.log*
client/yarn-debug.log*
client/yarn-error.log*
/build/
/venv/
13 changes: 0 additions & 13 deletions chart/cluster-setup.sh

This file was deleted.

15 changes: 11 additions & 4 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{- include "imis.fullname" . -}}"
labels:
{{- include "imis.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
Expand All @@ -26,10 +28,8 @@ spec:
value: {{ .Values.env }}
- name: SPRING_PROFILES_ACTIVE
value: production
- name: SPRING_DATASOURCE_URL{{ if eq .Values.env "production" }}
value: jdbc:postgresql://localhost:5432/postgres
{{ else }}
value: jdbc:postgresql://localhost:5432/staging{{ end }}
- name: SPRING_DATASOURCE_URL
value: jdbc:postgresql://localhost:5432/{{- .Values.database }}
- name: SPRING_DATASOURCE_USERNAME
value: postgres
- name: SPRING_DATASOURCE_PASSWORD
Expand Down Expand Up @@ -57,6 +57,13 @@ spec:
timeoutSeconds: 2
periodSeconds: 8
failureThreshold: 1
resources:
requests:
cpu: 10m
memory: 350Mi
limits: # exactly 1 * g1-small
cpu: 940m
memory: 1.2Gi
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.14
command: ["/cloud_sql_proxy",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chart/traefik.values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# setting LoadBalancerIP or using k8s.ingress annotation doesn't work reliably
loadBalancerIP: 34.89.244.246
loadBalancerIP: 34.91.170.168
replicas: 1
service:
annotations:
Expand Down
2 changes: 2 additions & 0 deletions chart/values.staging.yml → chart/values.dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
env: staging
database: staging

ingress:
domain: staging.imis-prototyp.de
5 changes: 5 additions & 0 deletions chart/values.pilot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
env: pilot
database: pilot

ingress:
domain: pilot.imis-prototyp.de
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
gitSha: "SHA" ## will be replaced during deployment
nameOverride: "imis"
env: "production"
database: postgres

image:
repository: "eu.gcr.io/onyx-yeti-271818"
Expand Down
Loading

0 comments on commit 9dbf7ef

Please sign in to comment.