Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #12 from Yunite-Net/5059-epic-groups
Browse files Browse the repository at this point in the history
chore: 🍰 Release v2.1.0-253 – Merge Groups Into master – Epic Groups
  • Loading branch information
Tirokk authored Oct 25, 2022
2 parents e757e34 + 0d1eac9 commit 1d3d6ee
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 19 deletions.
80 changes: 76 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
# - 55-implement-PRODUCTION_DB_CLEAN_ALLOW-for-staging-production-evironments # for testing while developing
# - 5059-epic-groups # for testing while developing

jobs:
##############################################################################
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
##########################################################################
- name: Backend | Build `branded` image
run: |
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_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
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" --build-arg "APP_IMAGE_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
docker save "${DOCKER_ORGANISATION}/backend-branded" > /tmp/backend-branded.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
##########################################################################
- name: Webapp | Build `branded` image
run: |
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_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
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" --build-arg "APP_IMAGE_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
docker save "${DOCKER_ORGANISATION}/webapp-branded" > /tmp/webapp-branded.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
##########################################################################
- name: Maintenance | Build `branded` image
run: |
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_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
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" --build-arg "APP_IMAGE_TAG_CODE=${OCELOT_DOCKER_VERSION_TAG}-code" --build-arg "APP_IMAGE_TAG_BASE=${OCELOT_DOCKER_VERSION_TAG}-base" .
docker save "${DOCKER_ORGANISATION}/maintenance-branded" > /tmp/maintenance-branded.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -256,6 +256,78 @@ jobs:
- name: Push Maintenance
run: docker push --all-tags ${DOCKER_ORGANISATION}/maintenance-branded

##############################################################################
# JOB: KUBERNETES DEPLOY ACTUAL/LATEST VERSION ######################################
##############################################################################
kubernetes_deploy:
# see example https://github.com/do-community/example-doctl-action
# see example https://github.com/do-community/example-doctl-action/blob/main/.github/workflows/workflow.yaml
name: Kubernetes deploy of latest version to stage.ocelot.social cluster at DigitalOcean
runs-on: ubuntu-latest
needs: [upload_to_dockerhub]
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 - 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 based 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
##########################################################################
# Install DigitalOceans doctl and set kubeconfig #########################
##########################################################################
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 cluster-stage-yunite-me
##########################################################################
# Deploy new Docker images to DigitalOcean Kubernetes cluster ############
##########################################################################
- name: Deploy actual version '$BUILD_VERSION' to DigitalOcean Kubernetes
run: |
kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=${DOCKER_ORGANISATION}/webapp-branded:${BUILD_VERSION}
kubectl -n default rollout restart deployment/ocelot-webapp
kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=${DOCKER_ORGANISATION}/backend-branded:${BUILD_VERSION}
kubectl -n default rollout restart deployment/ocelot-backend
kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=${DOCKER_ORGANISATION}/maintenance-branded:${BUILD_VERSION}
kubectl -n default rollout restart deployment/ocelot-maintenance
kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=${DOCKER_ORGANISATION}/neo4j-community-branded:${BUILD_VERSION}
kubectl -n default rollout restart deployment/ocelot-neo4j
# because this step 'kubectl -n default rollout status deployment/* --timeout=600s' does not work as expected
# and we need the pods to be up again for cleaning and seeding the Neo4j database and the backend.
# !!! this is not a perfect solution !!!
# deployments are regularly up again after 3 minutes and 10 seconds
- name: Sleep for 4 minutes, means 240 seconds
run: sleep 240s
shell: bash
- name: Verify deployment and wait for the pods of each deployment to get ready for cleaning and seeding of the database
run: |
kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
- name: Run migrations for Neo4j database via backend for staging
run: |
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate up"
- name: Reset and seed Neo4j database via backend for staging
# db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
run: |
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await dist/db/clean.js && node --experimental-repl-await dist/db/seed.js"
##############################################################################
# JOB: GITHUB TAG LATEST VERSION #############################################
##############################################################################
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ __Try out our deployed [development environment](https://stage.ocelot.social).__

Visit our staging networks:

- central staging network: [stage.ocelot.social](https://stage.ocelot.social).
- central staging network: [stage.ocelot.social](https://stage.ocelot.social)
- Yunite staging network: [stage.yunite.me](https://stage.yunite.me)
<!-- - rebranded staging network: [rebrand.ocelot.social](https://stage.ocelot.social). -->

Logins:
Expand Down
14 changes: 12 additions & 2 deletions TODO-next-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

When you overtake this deploy and rebrand repo to your network you have to recognize the following changes and doings …

## This Latest Version >= 2.0.0 with 'ocelotDockerVersionTag' 2.0.0-250

### Main Code PR – feat: 🍰 Implement LOGO_HEADER_CLICK As Configuration #5525

- You have to set `LOGO_HEADER_CLICK` in `branding/constants/logos.js` originally in main code file `webapp/constants/logos.js` to your prevered value.

### Main Code Issue – 🌟 [EPIC] Release v2.0.0 – Beta Test β†’ Final #5547

- You have to set `SHOW_GROUP_BUTTON_IN_HEADER` in `branding/constants/groups.js` originally in main code file `webapp/constants/groups.js` to your prevered value.

## This Latest Version >= 1.1.0 with 'ocelotDockerVersionTag' 1.1.0-205

### Deployment/Rebranding PR – chore: 🍰 Release v1.1.0 - Implement Categories Again #63
### Deployment/Rebranding PR – chore: 🍰 Release v1.1.0 - Implement Categories Again #63

- You have to add the `CATEGORIES_ACTIVE` from the `deployment/kubernetes/values.template.yaml` to your `deployment/kubernetes/values.yaml` and set it to your prevered value.
- You have to add the `CATEGORIES_ACTIVE` from the `deployment/kubernetes/values.template.yaml` to your `deployment/kubernetes/values.yaml` and set it to your preferred value.
- Make sure the correct categories are in your Neo4j database on the server.

## Version >= 1.0.9 with 'ocelotDockerVersionTag' 1.0.9-199
Expand Down
5 changes: 5 additions & 0 deletions branding/constants/groups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// this file is duplicated in `backend/src/constants/group.js` and `webapp/constants/group.js`
export const NAME_LENGTH_MIN = 3
export const NAME_LENGTH_MAX = 50
export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 100 // with removed HTML tags
export const SHOW_GROUP_BUTTON_IN_HEADER = false
14 changes: 11 additions & 3 deletions branding/constants/headerMenu.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
export default {
MENU: [
{
name: 'BeitrΓ€ge',
path: '/#',
nameIdent: 'yuniteRebranding.header.newsFeed',
path: '/',
},
{
name: 'Über Yunite',
nameIdent: 'yuniteRebranding.header.myGroups',
path: '/my-groups',
},
{
nameIdent: 'yuniteRebranding.header.topics',
url: 'https://yunite.org/themen/',
},
{
nameIdent: 'yuniteRebranding.header.about',
url: 'https://yunite.org',
},
],
Expand Down
12 changes: 6 additions & 6 deletions branding/constants/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ORGANIZATION = defaultPageParamsPages.ORGANIZATION.overwrite({
})
const DONATE = defaultPageParamsPages.DONATE.overwrite({
// we use 'ocelot-social.herokuapp.com' at the moment, because redirections of 'ocelot.social' subpages are not working correctly
externalLink: 'https://yunite.org/brand-guidelines/', // if string is defined and not empty it's dominating
externalLink: 'https://yunite.org/spenden/', // if string is defined and not empty it's dominating

internalPage: {
// footerIdent: 'site.donate', // localized string identifier, if undefined default is used
Expand All @@ -34,7 +34,7 @@ const IMPRINT = defaultPageParamsPages.IMPRINT.overwrite({
externalLink: 'https://yunite.org/impressum/', // if string is defined and not empty it's dominating

internalPage: {
// footerIdent: 'site.imprint', // localized string identifier, if undefined default is used
footerIdent: 'yuniteRebranding.footer.imprint', // localized string identifier, if undefined default is used
// headTitleIdent: 'site.imprint', // localized string identifier, if undefined default is used
// headlineIdent: 'site.imprint', // localized string identifier, on null it's hidden, if undefined default is used
hasContainer: true,
Expand Down Expand Up @@ -73,7 +73,7 @@ const DATA_PRIVACY = defaultPageParamsPages.DATA_PRIVACY.overwrite({
externalLink: 'https://yunite.org/datenschutz/', // if string is defined and not empty it's dominating

internalPage: {
// footerIdent: 'site.data-privacy', // localized string identifier, if undefined default is used
footerIdent: 'yuniteRebranding.footer.dataPrivacy', // localized string identifier, if undefined default is used
// headTitleIdent: 'site.data-privacy', // localized string identifier, if undefined default is used
// headlineIdent: 'site.data-privacy', // localized string identifier, on null it's hidden, if undefined default is used
hasContainer: true,
Expand Down Expand Up @@ -124,11 +124,11 @@ export default {
SUPPORT,

FOOTER_LINK_LIST: [
ORGANIZATION,
// ORGANIZATION,
// TERMS_AND_CONDITIONS,
CODE_OF_CONDUCT,
// CODE_OF_CONDUCT,
DATA_PRIVACY,
FAQ,
// FAQ,
// DONATE,
// SUPPORT,
IMPRINT,
Expand Down
4 changes: 4 additions & 0 deletions branding/constants/logos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
export default {
LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg',
LOGO_HEADER_WIDTH: '47px',
LOGO_HEADER_CLICK: {
externalLink: 'https://yunite.org',
internalPath: null,
},
LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg',
LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg',
LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg',
Expand Down
14 changes: 14 additions & 0 deletions branding/locales/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"yuniteRebranding": {
"header": {
"about": "Über Yunite",
"myGroups": "Gruppen",
"newsFeed": "BeitrΓ€ge",
"topics": "Themen"
},
"footer": {
"dataPrivacy": "Datenschutz",
"imprint": "Impressum"
}
}
}
14 changes: 14 additions & 0 deletions branding/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"yuniteRebranding": {
"header": {
"about": "About Yunite",
"myGroups": "Groups",
"newsFeed": "News Feed",
"topics": "Topics"
},
"footer": {
"dataPrivacy": "Data privacy",
"imprint": "Imprint"
}
}
}
1 change: 1 addition & 0 deletions deployment/kubernetes/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/dns.values.yaml
/dns.values*-ME.yaml
/nginx.values.yaml
/values.yaml
/values*-ME.yaml
9 changes: 8 additions & 1 deletion docker/webapp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE}
FROM $APP_IMAGE_CODE as code

# copy public constants into the Docker image to brand it
COPY tools/ tools/
COPY branding/static/ static/
COPY branding/constants/ constants/
COPY branding/locales/ locales/
COPY branding/locales/html/ locales/html/
# COPY branding/locales/index.js locales/index.js
COPY branding/locales/*.json locales/tmp/
COPY branding/assets/styles/imports/ assets/styles/imports/

RUN apk add --no-cache bash jq

RUN tools/merge-locales.sh

##################################################################################
# BUILD ##########################################################################
##################################################################################
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yunite.net",
"version": "1.1.1",
"ocelotDockerVersionTag": "1.1.1-228",
"version": "2.1.0",
"ocelotDockerVersionTag": "2.1.0-253",
"dockerOrganisation": "tirokk",
"description": "yunite.net Branded",
"author": "yunite.net Community",
Expand Down
12 changes: 12 additions & 0 deletions tools/merge-locales.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

for locale in `ls locales/*.json`;
do
file=$(basename $locale);
if [ -f locales/tmp/$file ]; then
jq -s '.[0] * .[1]' $locale locales/tmp/$file > locales/tmp/tmp.json;
mv locales/tmp/tmp.json $locale;
fi;
done;

rm -r locales/tmp/

0 comments on commit 1d3d6ee

Please sign in to comment.