From 0344a1b4cc3ba1d2d9c49e3bee7dcc4ea63c9107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 11 May 2021 16:03:41 +0200 Subject: [PATCH 01/12] =?UTF-8?q?Implement=20use=20of=20package.json=20've?= =?UTF-8?q?rsion'=20etc.=20for=20'$=20docker=20build=20=E2=80=A6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 12 +++++++++--- docker/webapp.Dockerfile | 3 ++- package.json | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3a28d0c..fe37236 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -61,10 +61,16 @@ jobs: ########################################################################## - name: ENV - VERSION run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_NUMBER + run: echo "BUILD_NUMBER=$(node -p -e "require('./package.json').build-number")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION_SOURCE + run: echo "DOCKER_ORGANISATION_SOURCE=$(node -p -e "require('./package.json').docker-organisation-source")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION_PUSH + run: echo "DOCKER_ORGANISATION_PUSH=$(node -p -e "require('./package.json').docker-organisation-push")" >> $GITHUB_ENV - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${BUILD_NUMBER}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## @@ -72,8 +78,8 @@ jobs: ########################################################################## - name: webapp | Build `branded` image run: | - docker build --target branded -t "ocelotsocialnetwork/webapp-branded:latest" -t "ocelotsocialnetwork/webapp-branded:${VERSION}" -t "ocelotsocialnetwork/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile . - docker save "ocelotsocialnetwork/webapp-branded" > /tmp/webapp-branded.tar + docker build --target branded -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:latest" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${VERSION}" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=${DOCKER_ORGANISATION_SOURCE}/webapp:${BUILD_VERSION} . + docker save "${DOCKER_ORGANISATION_PUSH}/webapp-branded" > /tmp/webapp-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: diff --git a/docker/webapp.Dockerfile b/docker/webapp.Dockerfile index cec47cc..58516f3 100644 --- a/docker/webapp.Dockerfile +++ b/docker/webapp.Dockerfile @@ -1,7 +1,8 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -FROM ocelotsocialnetwork/webapp:latest as branded +ARG APP_IMAGE=ocelotsocialnetwork/webapp:latest +FROM $APP_IMAGE as branded # Copy public constants to the docker image branding it COPY branding/static/ static/ diff --git a/package.json b/package.json index adb67e8..b483e1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,9 @@ { "name": "ocelot-social-branded", - "version": "0.0.6", + "version": "1.0.2", + "build-number": "79", + "docker-organisation-source": "ocelotsocialnetwork", + "docker-organisation-push": "ocelotsocialnetwork", "description": "Ocelot Social Branded", "author": "ocelot.social Community", "license": "MIT", From 1afe893fb6a2ceac5ab5f97a863591fe1023cdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 11 May 2021 16:50:52 +0200 Subject: [PATCH 02/12] Build branded Neo4j as well --- .github/workflows/publish.yml | 39 ++++++++++++++++++++++++++++++++++- docker/neo4j.Dockerfile | 9 ++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 docker/neo4j.Dockerfile diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fe37236..878bd1b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,43 @@ on: - master jobs: + ############################################################################## + # JOB: DOCKER BUILD COMMUNITY NEO4J ########################################## + ############################################################################## + build_production_neo4j: + name: Docker Build Branded - Neo4j Community + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # BUILD NEO4J DOCKER IMAGE (community-branded) ########################### + ########################################################################## + - name: Neo4j | Build `community-branded` image + run: | + docker build --target community-branded -t "ocelotsocialnetwork/neo4j-community-branded:latest" -t "ocelotsocialnetwork/neo4j-community-branded:${VERSION}" -t "ocelotsocialnetwork/neo4j-community-branded:${BUILD_VERSION}" -f docker/neo4j.Dockerfile . + docker save "ocelotsocialnetwork/neo4j-community-branded" > /tmp/neo4j-community-branded.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-neo4j-community-branded + path: /tmp/neo4j-community-branded.tar + ############################################################################## # JOB: DOCKER BUILD BRANDED BACKEND ########################################## ############################################################################## @@ -27,7 +64,7 @@ jobs: - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## diff --git a/docker/neo4j.Dockerfile b/docker/neo4j.Dockerfile new file mode 100644 index 0000000..f303154 --- /dev/null +++ b/docker/neo4j.Dockerfile @@ -0,0 +1,9 @@ +################################################################################## +# COMMUNITY ###################################################################### +################################################################################## +FROM ocelotsocialnetwork/neo4j:latest as community-branded + +################################################################################## +# ENTERPRISE ##################################################################### +################################################################################## +FROM ocelotsocialnetwork/neo4j-enterprise:latest as enterprise-branded From b57e1f23e2da6172f9fb16a3a0051a5b6d5f15ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 11 May 2021 17:27:31 +0200 Subject: [PATCH 03/12] Refine Helm charts --- deployment/kubernetes/Chart.yaml | 6 +++--- deployment/kubernetes/README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/kubernetes/Chart.yaml b/deployment/kubernetes/Chart.yaml index e7f36a7..14a8032 100644 --- a/deployment/kubernetes/Chart.yaml +++ b/deployment/kubernetes/Chart.yaml @@ -5,9 +5,9 @@ version: "1.0.0" # The appVersion defines which docker image is pulled. # Having it set to latest will pull the latest build on dockerhub. # You are free to define a specific version here tho. -# e.g. appVersion: "0.6.10" -# Be aware that this requires all dockers to have the same version available. -appVersion: "latest" +# e.g. appVersion: "1.0.2-79" +# Be aware that this requires all your apps to have the same docker image version available. +appVersion: "1.0.2-79" description: The Helm chart for ocelot.social home: https://ocelot.social sources: diff --git a/deployment/kubernetes/README.md b/deployment/kubernetes/README.md index e71eced..c48da6d 100644 --- a/deployment/kubernetes/README.md +++ b/deployment/kubernetes/README.md @@ -1,6 +1,6 @@ # Helm installation of Ocelot.social -Deploying Ocelot.social with Helm is very straight forward. All you have to do is to change certain parameters, like domain names and API keys, then you just install our provided Helm chart to your cluster. +Deploying *ocelot.social* with Helm is very straight forward. All you have to do is to change certain parameters, like domain names and API keys, then you just install our provided Helm chart to your cluster. ## Configuration From ef1b2e7b7f566c31cd2d10f8e1b8c87d2bae5e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 12 May 2021 08:52:39 +0200 Subject: [PATCH 04/12] Refactor to Ulf's suggestions --- .github/workflows/publish.yml | 30 +++++++++++++----------------- deployment/kubernetes/Chart.yaml | 4 ++-- package.json | 5 ++--- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 878bd1b..f6d521a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,10 @@ name: ocelot.social publish branded CI -on: - push: - branches: - - master +# Wolle on: +# push: +# branches: +# - master +on: [push] jobs: ############################################################################## @@ -98,25 +99,20 @@ jobs: ########################################################################## - name: ENV - VERSION run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - - name: ENV - BUILD_NUMBER - run: echo "BUILD_NUMBER=$(node -p -e "require('./package.json').build-number")" >> $GITHUB_ENV - - name: ENV - DOCKER_ORGANISATION_SOURCE - run: echo "DOCKER_ORGANISATION_SOURCE=$(node -p -e "require('./package.json').docker-organisation-source")" >> $GITHUB_ENV - - name: ENV - DOCKER_ORGANISATION_PUSH - run: echo "DOCKER_ORGANISATION_PUSH=$(node -p -e "require('./package.json').docker-organisation-push")" >> $GITHUB_ENV - - name: ENV - BUILD_DATE - run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelot-docker-version-tag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').docker-organisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}-${BUILD_NUMBER}" >> $GITHUB_ENV - - name: ENV - BUILD_COMMIT - run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV ########################################################################## # BUILD WEBAPP DOCKER IMAGE (build) ###################################### ########################################################################## - name: webapp | Build `branded` image run: | - docker build --target branded -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:latest" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${VERSION}" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=${DOCKER_ORGANISATION_SOURCE}/webapp:${BUILD_VERSION} . - docker save "${DOCKER_ORGANISATION_PUSH}/webapp-branded" > /tmp/webapp-branded.tar + docker build --target branded -t "${DOCKER_ORGANISATION}/webapp-branded:latest" -t "${DOCKER_ORGANISATION}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/webapp:${OCELOT_DOCKER_VERSION_TAG} . + docker save "${DOCKER_ORGANISATION}/webapp-branded" > /tmp/webapp-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: diff --git a/deployment/kubernetes/Chart.yaml b/deployment/kubernetes/Chart.yaml index 14a8032..5b953e3 100644 --- a/deployment/kubernetes/Chart.yaml +++ b/deployment/kubernetes/Chart.yaml @@ -5,9 +5,9 @@ version: "1.0.0" # The appVersion defines which docker image is pulled. # Having it set to latest will pull the latest build on dockerhub. # You are free to define a specific version here tho. -# e.g. appVersion: "1.0.2-79" +# e.g. appVersion: "latest" or "1.0.2-3-ocelot.social1.0.2-79" # Be aware that this requires all your apps to have the same docker image version available. -appVersion: "1.0.2-79" +appVersion: "latest" description: The Helm chart for ocelot.social home: https://ocelot.social sources: diff --git a/package.json b/package.json index b483e1f..7b6a8de 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "ocelot-social-branded", "version": "1.0.2", - "build-number": "79", - "docker-organisation-source": "ocelotsocialnetwork", - "docker-organisation-push": "ocelotsocialnetwork", + "ocelot-docker-version-tag": "1.0.2-79", + "docker-organisation": "ocelotsocialnetwork", "description": "Ocelot Social Branded", "author": "ocelot.social Community", "license": "MIT", From 278317095aff70e6341d1cec0863945ef6f054fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 12 May 2021 09:03:06 +0200 Subject: [PATCH 05/12] Fix package.json entries --- .github/workflows/publish.yml | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6d521a..820d2a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -100,9 +100,9 @@ jobs: - name: ENV - VERSION run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - name: ENV - OCELOT_DOCKER_VERSION_TAG - run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelot-docker-version-tag")" >> $GITHUB_ENV + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV - name: ENV - DOCKER_ORGANISATION - run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').docker-organisation")" >> $GITHUB_ENV + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV diff --git a/package.json b/package.json index 7b6a8de..e73be6c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "ocelot-social-branded", "version": "1.0.2", - "ocelot-docker-version-tag": "1.0.2-79", - "docker-organisation": "ocelotsocialnetwork", + "ocelotDockerVersionTag": "1.0.2-79", + "dockerOrganisation": "ocelotsocialnetwork", "description": "Ocelot Social Branded", "author": "ocelot.social Community", "license": "MIT", From 272a485f673210abdedae0ab4a60173bc6a01cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 12 May 2021 11:30:16 +0200 Subject: [PATCH 06/12] Add the other docker images --- .github/workflows/publish.yml | 89 ++++++++++++++++++++++++++++------- docker/backend.Dockerfile | 5 +- docker/maintenance.Dockerfile | 5 +- docker/neo4j.Dockerfile | 4 +- docker/webapp.Dockerfile | 2 +- 5 files changed, 81 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 820d2a0..bd80ce3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,8 +27,13 @@ jobs: run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## @@ -36,8 +41,8 @@ jobs: ########################################################################## - name: Neo4j | Build `community-branded` image run: | - docker build --target community-branded -t "ocelotsocialnetwork/neo4j-community-branded:latest" -t "ocelotsocialnetwork/neo4j-community-branded:${VERSION}" -t "ocelotsocialnetwork/neo4j-community-branded:${BUILD_VERSION}" -f docker/neo4j.Dockerfile . - docker save "ocelotsocialnetwork/neo4j-community-branded" > /tmp/neo4j-community-branded.tar + docker build --target community-branded -t "${DOCKER_ORGANISATION}/neo4j-community-branded:latest" -t "${DOCKER_ORGANISATION}/neo4j-community-branded:${VERSION}" -t "${DOCKER_ORGANISATION}/neo4j-community-branded:${BUILD_VERSION}" -f docker/neo4j.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/neo4j:${OCELOT_DOCKER_VERSION_TAG} . + docker save "${DOCKER_ORGANISATION}/neo4j-community-branded" > /tmp/neo4j-community-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: @@ -64,8 +69,13 @@ jobs: run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## @@ -73,8 +83,8 @@ jobs: ########################################################################## - name: backend | Build `branded` image run: | - docker build --target branded -t "ocelotsocialnetwork/backend-branded:latest" -t "ocelotsocialnetwork/backend-branded:${VERSION}" -t "ocelotsocialnetwork/backend-branded:${BUILD_VERSION}" -f docker/backend.Dockerfile . - docker save "ocelotsocialnetwork/backend-branded" > /tmp/backend-branded.tar + docker build --target branded -t "${DOCKER_ORGANISATION}/backend-branded:latest" -t "${DOCKER_ORGANISATION}/backend-branded:${VERSION}" -t "${DOCKER_ORGANISATION}/backend-branded:${BUILD_VERSION}" -f docker/backend.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/backend:${OCELOT_DOCKER_VERSION_TAG} . + docker save "${DOCKER_ORGANISATION}/backend-branded" > /tmp/backend-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: @@ -99,6 +109,8 @@ jobs: ########################################################################## - name: ENV - VERSION run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV - name: ENV - OCELOT_DOCKER_VERSION_TAG run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV - name: ENV - DOCKER_ORGANISATION @@ -106,12 +118,14 @@ jobs: # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## # BUILD WEBAPP DOCKER IMAGE (build) ###################################### ########################################################################## - name: webapp | Build `branded` image run: | - docker build --target branded -t "${DOCKER_ORGANISATION}/webapp-branded:latest" -t "${DOCKER_ORGANISATION}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/webapp:${OCELOT_DOCKER_VERSION_TAG} . + docker build --target branded -t "${DOCKER_ORGANISATION}/webapp-branded:latest" -t "${DOCKER_ORGANISATION}/webapp-branded:${VERSION}" -t "${DOCKER_ORGANISATION}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/webapp:${OCELOT_DOCKER_VERSION_TAG} . docker save "${DOCKER_ORGANISATION}/webapp-branded" > /tmp/webapp-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 @@ -139,8 +153,13 @@ jobs: run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## @@ -148,8 +167,8 @@ jobs: ########################################################################## - name: maintenance | Build `branded` image run: | - docker build --target branded -t "ocelotsocialnetwork/maintenance-branded:latest" -t "ocelotsocialnetwork/maintenance-branded:${VERSION}" -t "ocelotsocialnetwork/maintenance-branded:${BUILD_VERSION}" -f docker/maintenance.Dockerfile . - docker save "ocelotsocialnetwork/maintenance-branded" > /tmp/maintenance-branded.tar + docker build --target branded -t "${DOCKER_ORGANISATION}/maintenance-branded:latest" -t "${DOCKER_ORGANISATION}/maintenance-branded:${VERSION}" -t "${DOCKER_ORGANISATION}/maintenance-branded:${BUILD_VERSION}" -f docker/maintenance.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/maintenance:${OCELOT_DOCKER_VERSION_TAG} . + docker save "${DOCKER_ORGANISATION}/maintenance-branded" > /tmp/maintenance-branded.tar - name: Upload Artifact uses: actions/upload-artifact@v2 with: @@ -173,8 +192,33 @@ jobs: - name: Checkout code uses: actions/checkout@v2 ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## # DOWNLOAD DOCKER IMAGES ################################################# ########################################################################## + # Neo4j Community + - name: Download Docker Image (Neo4j Community) + uses: actions/download-artifact@v2 + with: + name: docker-neo4j-community-branded + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/neo4j-community-branded.tar + # Backend - name: Download Docker Image (Backend) uses: actions/download-artifact@v2 with: @@ -182,13 +226,15 @@ jobs: path: /tmp - name: Load Docker Image run: docker load < /tmp/backend-branded.tar - - name: Download Docker Image (WebApp) + # Webapp + - name: Download Docker Image (Webapp) uses: actions/download-artifact@v2 with: name: docker-webapp-branded path: /tmp - name: Load Docker Image run: docker load < /tmp/webapp-branded.tar + # Maintenance - name: Download Docker Image (Maintenance) uses: actions/download-artifact@v2 with: @@ -201,12 +247,14 @@ jobs: ########################################################################## - name: login to dockerhub run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin - - name: Push backend - run: docker push --all-tags ocelotsocialnetwork/backend-branded - - name: Push webapp - run: docker push --all-tags ocelotsocialnetwork/webapp-branded - - name: Push maintenance - run: docker push --all-tags ocelotsocialnetwork/maintenance-branded + - name: Push Neo4j Community + run: docker push --all-tags ${DOCKER_ORGANISATION}/neo4j-community-branded + - name: Push Backend + run: docker push --all-tags ${DOCKER_ORGANISATION}/backend-branded + - name: Push Webapp + run: docker push --all-tags ${DOCKER_ORGANISATION}/webapp-branded + - name: Push Maintenance + run: docker push --all-tags ${DOCKER_ORGANISATION}/maintenance-branded ############################################################################## # JOB: GITHUB TAG LATEST VERSION ############################################# @@ -230,8 +278,13 @@ jobs: run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV - name: ENV - BUILD_DATE run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - OCELOT_DOCKER_VERSION_TAG + run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV + - name: ENV - DOCKER_ORGANISATION + run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV + # this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79" - name: ENV - BUILD_VERSION - run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV - name: ENV - BUILD_COMMIT run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV ########################################################################## diff --git a/docker/backend.Dockerfile b/docker/backend.Dockerfile index db234aa..9b68fb8 100644 --- a/docker/backend.Dockerfile +++ b/docker/backend.Dockerfile @@ -1,8 +1,9 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -FROM ocelotsocialnetwork/backend:latest as branded +ARG APP_IMAGE=ocelotsocialnetwork/backend:latest +FROM $APP_IMAGE as branded -# Copy public constants to the docker image branding it +# Copy public constants to the docker image and branding it COPY branding/constants/links.js src/config/ COPY branding/constants/metadata.js src/config/ diff --git a/docker/maintenance.Dockerfile b/docker/maintenance.Dockerfile index 585947c..8b05fe7 100644 --- a/docker/maintenance.Dockerfile +++ b/docker/maintenance.Dockerfile @@ -1,8 +1,9 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -FROM ocelotsocialnetwork/maintenance:latest as branded +ARG APP_IMAGE=ocelotsocialnetwork/maintenance:latest +FROM $APP_IMAGE as branded -# Copy public constants to the docker image branding it +# Copy public constants to the docker image and branding it COPY branding/static/ static/ COPY branding/constants/ constants/ diff --git a/docker/neo4j.Dockerfile b/docker/neo4j.Dockerfile index f303154..dff5209 100644 --- a/docker/neo4j.Dockerfile +++ b/docker/neo4j.Dockerfile @@ -1,7 +1,9 @@ +ARG APP_IMAGE=ocelotsocialnetwork/neo4j:latest + ################################################################################## # COMMUNITY ###################################################################### ################################################################################## -FROM ocelotsocialnetwork/neo4j:latest as community-branded +FROM $APP_IMAGE as community-branded ################################################################################## # ENTERPRISE ##################################################################### diff --git a/docker/webapp.Dockerfile b/docker/webapp.Dockerfile index 58516f3..bfdb899 100644 --- a/docker/webapp.Dockerfile +++ b/docker/webapp.Dockerfile @@ -4,6 +4,6 @@ ARG APP_IMAGE=ocelotsocialnetwork/webapp:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image branding it +# Copy public constants to the docker image and branding it COPY branding/static/ static/ COPY branding/constants/ constants/ From 3fe2ec64507565c38ca81ae45869c81afc6302f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 12 May 2021 12:04:20 +0200 Subject: [PATCH 07/12] Use correct Neo4j docker image --- deployment/kubernetes/values.yaml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/kubernetes/values.yaml.dist b/deployment/kubernetes/values.yaml.dist index 5357a22..d20e2bc 100644 --- a/deployment/kubernetes/values.yaml.dist +++ b/deployment/kubernetes/values.yaml.dist @@ -47,7 +47,7 @@ WEBAPP: NEO4J: # Most likely you don't need to change this REVISIONS_HISTORY_LIMIT: "25" - DOCKER_IMAGE_REPO: "ocelotsocialnetwork/neo4j" + DOCKER_IMAGE_REPO: "ocelotsocialnetwork/neo4j-community-branded" DOCKER_IMAGE_PULL_POLICY: "Always" CONTAINER_RESTART_POLICY: "Always" CONTAINER_TERMINATION_GRACE_PERIOD_SECONDS: "30" From c0a1028eb7fce888f96fbd2f52a7531c074a5822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 12 May 2021 12:53:15 +0200 Subject: [PATCH 08/12] Rename *.yaml.dist files to *.template.yaml --- .../{dns.values.yaml.dist => dns.values.template.yaml} | 2 ++ .../{nginx.values.yaml.dist => nginx.values.template.yaml} | 2 ++ .../kubernetes/{values.yaml.dist => values.template.yaml} | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) rename deployment/kubernetes/{dns.values.yaml.dist => dns.values.template.yaml} (74%) rename deployment/kubernetes/{nginx.values.yaml.dist => nginx.values.template.yaml} (68%) rename deployment/kubernetes/{values.yaml.dist => values.template.yaml} (97%) diff --git a/deployment/kubernetes/dns.values.yaml.dist b/deployment/kubernetes/dns.values.template.yaml similarity index 74% rename from deployment/kubernetes/dns.values.yaml.dist rename to deployment/kubernetes/dns.values.template.yaml index 16d2975..09539e3 100644 --- a/deployment/kubernetes/dns.values.yaml.dist +++ b/deployment/kubernetes/dns.values.template.yaml @@ -1,3 +1,5 @@ +# please duplicate template file and rename to "dns.values.yaml" and fill in your value + provider: digitalocean digitalocean: # create the API token at https://cloud.digitalocean.com/account/api/tokens diff --git a/deployment/kubernetes/nginx.values.yaml.dist b/deployment/kubernetes/nginx.values.template.yaml similarity index 68% rename from deployment/kubernetes/nginx.values.yaml.dist rename to deployment/kubernetes/nginx.values.template.yaml index 06dad81..8035104 100644 --- a/deployment/kubernetes/nginx.values.yaml.dist +++ b/deployment/kubernetes/nginx.values.template.yaml @@ -1,3 +1,5 @@ +# please duplicate template file and rename to "nginx.values.yaml" and fill in your value + controller: kind: DaemonSet hostNetwork: true diff --git a/deployment/kubernetes/values.yaml.dist b/deployment/kubernetes/values.template.yaml similarity index 97% rename from deployment/kubernetes/values.yaml.dist rename to deployment/kubernetes/values.template.yaml index d20e2bc..21bcd9c 100644 --- a/deployment/kubernetes/values.yaml.dist +++ b/deployment/kubernetes/values.template.yaml @@ -1,4 +1,6 @@ -# Change all the below if needed +# please duplicate template file and rename to "values.yaml" and fill in your value + +# change all the below if needed PUBLIC_REGISTRATION: false INVITE_REGISTRATION: false From 050d0c3ea89ebb078bd7f3b82c4582758f56d288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 14 May 2021 12:27:33 +0200 Subject: [PATCH 09/12] Refine README and values.template.yaml --- .github/workflows/publish.yml | 10 +- deployment/kubernetes/README.md | 130 +++++++++++++++------ deployment/kubernetes/values.template.yaml | 25 ++-- 3 files changed, 115 insertions(+), 50 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bd80ce3..76ac7e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,10 @@ name: ocelot.social publish branded CI -# Wolle on: -# push: -# branches: -# - master -on: [push] +on: + push: + branches: + - master +# on: [push] # for testing while developing jobs: ############################################################################## diff --git a/deployment/kubernetes/README.md b/deployment/kubernetes/README.md index c48da6d..ce0ff19 100644 --- a/deployment/kubernetes/README.md +++ b/deployment/kubernetes/README.md @@ -1,40 +1,54 @@ -# Helm installation of Ocelot.social +# Helm Installation Of Ocelot.Social Deploying *ocelot.social* with Helm is very straight forward. All you have to do is to change certain parameters, like domain names and API keys, then you just install our provided Helm chart to your cluster. ## Configuration -You can customize the network with your configuration by changing the `values.yaml`, all variables will be available as environment variables in your deployed kubernetes pods. For more details refer to the `values.yaml.dist` file. +You can customize the network with your configuration by duplicate the `values.template.yaml` to a new `values.yaml` file and change it to your need. All included variables will be available as environment variables in your deployed kubernetes pods. -Besides the `values.yaml.dist` file we provide a `nginx.values.yaml.dist` and `dns.values.yaml.dist`. The `nginx.values.yaml` is the configuration for the ingress-nginx helm chart, while the `dns.values.yaml` file is for automatically updating the dns values on digital ocean and therefore optional. - -As hinted above you should copy the given files and rename them accordingly. Then go ahead and modify the values in the newly created files accordingly. +Besides the `values.template.yaml` file we provide a `nginx.values.template.yaml` and `dns.values.template.yaml` for a similar procedure. The new `nginx.values.yaml` is the configuration for the ingress-nginx Helm chart, while the `dns.values.yaml` file is for automatically updating the dns values on digital ocean and therefore optional. ## Installation -Due to the many limitations of Helm you still have to do several manual steps. Those occur before you run the actual ocelot helm chart. Obviously it is expected of you to have `helm` and `kubectl` installed. For Digital Ocean you might require `doctl` aswell. +Due to the many limitations of Helm you still have to do several manual steps. Those occur before you run the actual *ocelot.social* Helm chart. Obviously it is expected of you to have `helm` and `kubectl` installed. For Digital Ocean you might require `doctl` aswell. ### Cert Manager (https) Please refer to [cert-manager.io docs](https://cert-manager.io/docs/installation/kubernetes/) for more details. +***ATTENTION:*** *Be with the Terminal in your repository in the folder of this README.* + 1. Create Namespace ```bash -kubectl --kubeconfig=/../kubeconfig.yaml create namespace cert-manager +# kubeconfig.yaml set globaly +$ kubectl create namespace cert-manager +# or kubeconfig.yaml in your repo, then adjust +$ kubectl --kubeconfig=/../kubeconfig.yaml create namespace cert-manager ``` -2. Add Helm Repo & update +2. Add Helm repository and update ```bash -helm repo add jetstack https://charts.jetstack.io -helm repo update +$ helm repo add jetstack https://charts.jetstack.io +$ helm repo update ``` 3. Install Cert-Manager Helm chart + ```bash -# this can not be included sine the CRDs cant be installed properly via helm... -helm --kubeconfig=/../kubeconfig.yaml \ +# option 1 +# this can't be applied via kubectl to our cluster since the CRDs can't be installed properly this way ... +# $ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.crds.yaml + +# option 2 +# kubeconfig.yaml set globaly +$ helm install cert-manager jetstack/cert-manager \ + --namespace cert-manager \ + --version v1.1.0 \ + --set installCRDs=true +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml \ install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --version v1.1.0 \ @@ -43,15 +57,20 @@ helm --kubeconfig=/../kubeconfig.yaml \ ### Ingress-Nginx -1. Add Helm Repo & update +1. Add Helm repository and update + ```bash -helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx -helm repo update +$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx +$ helm repo update ``` 2. Install ingress-nginx + ```bash -helm --kubeconfig=/../kubeconfig.yaml install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +# kubeconfig.yaml set globaly +$ helm install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml ``` ### Digital Ocean Firewall @@ -61,56 +80,101 @@ This is only necessary if you run Digital Ocean without load balancer ([see here 1. Authenticate towards DO with your local `doctl` You will need a DO token for that. + ```bash -doctl auth init +# without doctl context +$ doctl auth init +# with doctl new context to be filled in +$ doctl auth init --context ``` +You will need an API token, which you can generate in the control panel at . + 2. Generate DO firewall + +Fill in the `CLUSTER_UUID` and `your-domain` (Get the `CLUSTER_UUID` value from the dashboard or the ID column from doctl kubernetes cluster list.): + ```bash -doctl compute firewall create \ +# without doctl context +$ doctl compute firewall create \ --inbound-rules="protocol:tcp,ports:80,address:0.0.0.0/0,address:::/0 protocol:tcp,ports:443,address:0.0.0.0/0,address:::/0" \ ---tag-names=k8s:1ebf0cdc-86c9-4384-936b-40010b71d049 \ ---name=my-domain-http-https +--tag-names=k8s: \ +--name=-http-https +# with doctl context to be filled in +$ doctl compute firewall create \ +--inbound-rules="protocol:tcp,ports:80,address:0.0.0.0/0,address:::/0 protocol:tcp,ports:443,address:0.0.0.0/0,address:::/0" \ +--tag-names=k8s: \ +--name=-http-https --context +``` + +To get informations about your success use this command. (Fill in the `ID` you got at creation.): + +```bash +# without doctl context +$ doctl compute firewall get +# with doctl context to be filled in +$ doctl compute firewall get --context ``` ### DNS -This chart is only necessary (recommended is more precise) if you run Digital Ocean without load balancer. -You need to generate a token for the `dns.values.yaml`. +This chart is only necessary (recommended is more precise) if you run Digital Ocean without load balancer. +You need to generate an access token with read + write for the `dns.values.yaml` at and fill it in. + +1. Add Helm repository and update -1. Add Helm Repo & update ```bash -helm repo add bitnami https://charts.bitnami.com/bitnami -helm repo update +$ helm repo add bitnami https://charts.bitnami.com/bitnami +$ helm repo update ``` 2. Install DNS + ```bash -helm --kubeconfig=/../kubeconfig.yaml install dns bitnami/external-dns -f dns.values.yaml +# kubeconfig.yaml set globaly +$ helm install dns bitnami/external-dns -f dns.values.yaml +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml install dns bitnami/external-dns -f dns.values.yaml ``` -### Ocelot.social +### Ocelot.Social All commands for ocelot need to be executed in the kubernetes folder. Therefore `cd deployment/kubernetes/` is expected to be run before every command. Furthermore the given commands will install ocelot into the default namespace. This can be modified to by attaching `--namespace not.default`. #### Install + +Only run once for the first time of installation: + ```bash -helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ +# kubeconfig.yaml set globaly +$ helm install ocelot ./ +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ ``` -#### Upgrade +#### Upgrade & Update + +Run for all upgrades and updates: + ```bash -helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ +# kubeconfig.yaml set globaly +$ helm upgrade ocelot ./ +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ ``` #### Uninstall + Be aware that if you uninstall ocelot the formerly bound volumes become unbound. Those volumes contain all data from uploads and database. You have to manually free their reference in order to bind them again when reinstalling. Once unbound from their former container references they should automatically be rebound (considering the sizes did not change) ```bash -helm --kubeconfig=/../kubeconfig.yaml uninstall ocelot +# kubeconfig.yaml set globaly +$ helm uninstall ocelot +# or kubeconfig.yaml in your repo, then adjust +$ helm --kubeconfig=/../kubeconfig.yaml uninstall ocelot ``` -## Error reporting +## Error Reporting We use [Sentry](https://github.com/getsentry/sentry) for error reporting in both our backend and web frontend. You can either use a hosted or a self-hosted @@ -125,4 +189,4 @@ If you are lucky enough to have a kubernetes cluster with the required hardware support, try this [helm chart](https://github.com/helm/charts/tree/master/stable/sentry). On our kubernetes cluster we get "mult-attach" errors for persistent volumes. -Apparently Digital Ocean's kubernetes clusters do not fulfill the requirements. \ No newline at end of file +Apparently Digital Ocean's kubernetes clusters do not fulfill the requirements. diff --git a/deployment/kubernetes/values.template.yaml b/deployment/kubernetes/values.template.yaml index 21bcd9c..a525a3b 100644 --- a/deployment/kubernetes/values.template.yaml +++ b/deployment/kubernetes/values.template.yaml @@ -5,11 +5,12 @@ PUBLIC_REGISTRATION: false INVITE_REGISTRATION: false BACKEND: - # Change all the below if needed + # change all the below if needed # DOCKER_IMAGE_REPO - change that to your branded docker image - # Label is appended based on .Chart.appVersion + # label is appended based on .Chart.appVersion DOCKER_IMAGE_REPO: "ocelotsocialnetwork/backend-branded" CLIENT_URI: "https://staging.ocelot.social" + # create a new one for your network JWT_SECRET: "b/&&7b78BF&fv/Vd" MAPBOX_TOKEN: "pk.eyJ1IjoiYnVzZmFrdG9yIiwiYSI6ImNraDNiM3JxcDBhaWQydG1uczhpZWtpOW4ifQ.7TNRTO-o9aK1Y6MyW_Nd4g" PRIVATE_KEY_PASSPHRASE: "a7dsf78sadg87ad87sfagsadg78" @@ -21,7 +22,7 @@ BACKEND: SMTP_IGNORE_TLS: 'true' SMTP_SECURE: 'false' - # Most likely you don't need to change this + # most likely you don't need to change this MIN_READY_SECONDS: "15" PROGRESS_DEADLINE_SECONDS: "60" REVISIONS_HISTORY_LIMIT: "25" @@ -31,9 +32,9 @@ BACKEND: STORAGE_UPLOADS: "25Gi" WEBAPP: - # Change all the below if needed + # change all the below if needed # DOCKER_IMAGE_REPO - change that to your branded docker image - # Label is appended based on .Chart.appVersion + # label is appended based on .Chart.appVersion DOCKER_IMAGE_REPO: "ocelotsocialnetwork/webapp-branded" WEBSOCKETS_URI: "wss://staging.ocelot.social/api/graphql" @@ -47,7 +48,7 @@ WEBAPP: DOCKER_IMAGE_PULL_POLICY: "Always" NEO4J: - # Most likely you don't need to change this + # most likely you don't need to change this REVISIONS_HISTORY_LIMIT: "25" DOCKER_IMAGE_REPO: "ocelotsocialnetwork/neo4j-community-branded" DOCKER_IMAGE_PULL_POLICY: "Always" @@ -75,9 +76,9 @@ NEO4J: DBMS_SECURITY_PROCEDURES_UNRESTRICTED: "algo.*,apoc.*" MAINTENANCE: - # Change all the below if needed + # change all the below if needed # DOCKER_IMAGE_REPO - change that to your branded docker image - # Label is appended based on .Chart.appVersion + # label is appended based on .Chart.appVersion DOCKER_IMAGE_REPO: "ocelotsocialnetwork/maintenance-branded" # Most likely you don't need to change this @@ -87,7 +88,7 @@ MAINTENANCE: DOCKER_IMAGE_PULL_POLICY: "Always" LETSENCRYPT: - # Change all the below if needed + # change all the below if needed # ISSUER is used by cert-manager to set up certificates with the given provider. # change it to "letsencrypt-production" once you are ready to have valid cetrificates. # Be aware that the is an issuing limit with letsencrypt, so a dry run with staging might be wise @@ -98,14 +99,14 @@ LETSENCRYPT: - "www.staging.ocelot.social" NGINX: - # Most likely you don't need to change this + # most likely you don't need to change this PROXY_BODY_SIZE: "10m" STORAGE: - # Change all the below if needed + # change all the below if needed PROVISIONER: "dobs.csi.digitalocean.com" - # Most likely you don't need to change this + # most likely you don't need to change this RECLAIM_POLICY: "Retain" VOLUME_BINDING_MODE: "Immediate" ALLOW_VOLUME_EXPANSION: true \ No newline at end of file From d478a5af7e8908952663ad4742bdb4b1a4ae249c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 14 May 2021 13:07:50 +0200 Subject: [PATCH 10/12] Correct needs for 'upload_to_dockerhub' --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 76ac7e2..6c455c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: ############################################################################## # JOB: DOCKER BUILD COMMUNITY NEO4J ########################################## ############################################################################## - build_production_neo4j: + build_branded_neo4j: name: Docker Build Branded - Neo4j Community runs-on: ubuntu-latest #needs: [nothing] @@ -181,7 +181,7 @@ jobs: upload_to_dockerhub: name: Upload to Dockerhub runs-on: ubuntu-latest - needs: [build_branded_backend,build_branded_webapp,build_branded_maintenance] + needs: [build_branded_neo4j,build_branded_backend,build_branded_webapp,build_branded_maintenance] env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} From 825b05f43ee63f6250497edfa0e6c84a663fdc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 14 May 2021 13:12:53 +0200 Subject: [PATCH 11/12] Fix comments --- docker/backend.Dockerfile | 2 +- docker/maintenance.Dockerfile | 2 +- docker/webapp.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/backend.Dockerfile b/docker/backend.Dockerfile index 9b68fb8..0021950 100644 --- a/docker/backend.Dockerfile +++ b/docker/backend.Dockerfile @@ -4,6 +4,6 @@ ARG APP_IMAGE=ocelotsocialnetwork/backend:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and branding it +# Copy public constants to the docker image and brand it COPY branding/constants/links.js src/config/ COPY branding/constants/metadata.js src/config/ diff --git a/docker/maintenance.Dockerfile b/docker/maintenance.Dockerfile index 8b05fe7..29ea4fd 100644 --- a/docker/maintenance.Dockerfile +++ b/docker/maintenance.Dockerfile @@ -4,6 +4,6 @@ ARG APP_IMAGE=ocelotsocialnetwork/maintenance:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and branding it +# Copy public constants to the docker image and brand it COPY branding/static/ static/ COPY branding/constants/ constants/ diff --git a/docker/webapp.Dockerfile b/docker/webapp.Dockerfile index bfdb899..fef4796 100644 --- a/docker/webapp.Dockerfile +++ b/docker/webapp.Dockerfile @@ -4,6 +4,6 @@ ARG APP_IMAGE=ocelotsocialnetwork/webapp:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and branding it +# Copy public constants to the docker image and brand it COPY branding/static/ static/ COPY branding/constants/ constants/ From 936743d8b533a7de75c71dda1347a01393afe2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 14 May 2021 20:37:49 +0200 Subject: [PATCH 12/12] Refine comments and default Docker image names --- docker/backend.Dockerfile | 4 ++-- docker/maintenance.Dockerfile | 4 ++-- docker/neo4j.Dockerfile | 2 +- docker/webapp.Dockerfile | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/backend.Dockerfile b/docker/backend.Dockerfile index 0021950..ef39c14 100644 --- a/docker/backend.Dockerfile +++ b/docker/backend.Dockerfile @@ -1,9 +1,9 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -ARG APP_IMAGE=ocelotsocialnetwork/backend:latest +ARG APP_IMAGE=ocelotsocialnetwork/backend-branded:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and brand it +# copy public constants into the Docker image to brand it COPY branding/constants/links.js src/config/ COPY branding/constants/metadata.js src/config/ diff --git a/docker/maintenance.Dockerfile b/docker/maintenance.Dockerfile index 29ea4fd..0f273b0 100644 --- a/docker/maintenance.Dockerfile +++ b/docker/maintenance.Dockerfile @@ -1,9 +1,9 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -ARG APP_IMAGE=ocelotsocialnetwork/maintenance:latest +ARG APP_IMAGE=ocelotsocialnetwork/maintenance-branded:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and brand it +# copy public constants into the Docker image to brand it COPY branding/static/ static/ COPY branding/constants/ constants/ diff --git a/docker/neo4j.Dockerfile b/docker/neo4j.Dockerfile index dff5209..2220b6b 100644 --- a/docker/neo4j.Dockerfile +++ b/docker/neo4j.Dockerfile @@ -1,4 +1,4 @@ -ARG APP_IMAGE=ocelotsocialnetwork/neo4j:latest +ARG APP_IMAGE=ocelotsocialnetwork/neo4j-community-branded:latest ################################################################################## # COMMUNITY ###################################################################### diff --git a/docker/webapp.Dockerfile b/docker/webapp.Dockerfile index fef4796..c530a1f 100644 --- a/docker/webapp.Dockerfile +++ b/docker/webapp.Dockerfile @@ -1,9 +1,9 @@ ################################################################################## # BRANDED ######################################################################## ################################################################################## -ARG APP_IMAGE=ocelotsocialnetwork/webapp:latest +ARG APP_IMAGE=ocelotsocialnetwork/webapp-branded:latest FROM $APP_IMAGE as branded -# Copy public constants to the docker image and brand it +# copy public constants into the Docker image to brand it COPY branding/static/ static/ COPY branding/constants/ constants/