github
This commit is contained in:
parent
989c2b036b
commit
ebbc27bcba
11
.github/ISSUE_TEMPLATE/---bug-report.md
vendored
11
.github/ISSUE_TEMPLATE/---bug-report.md
vendored
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F41B Bug Report"
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: "\U0001F41B [Bug] XXX"
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## :bug: Bug Report
|
|
||||||
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the bug is.-->
|
|
||||||
11
.github/ISSUE_TEMPLATE/---devops-ticket.md
vendored
11
.github/ISSUE_TEMPLATE/---devops-ticket.md
vendored
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F4A5 DevOps Ticket"
|
|
||||||
about: Help us manage our deployed app.
|
|
||||||
title: "\U0001F4A5 [DevOps] XXX"
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 💥 DevOps Ticket
|
|
||||||
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the problem is.-->
|
|
||||||
15
.github/ISSUE_TEMPLATE/---epic.md
vendored
15
.github/ISSUE_TEMPLATE/---epic.md
vendored
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F31F Epic"
|
|
||||||
about: Define a big development step.
|
|
||||||
title: "\U0001F31F [EPIC] XXX"
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- THIS ISSUE-TYPE IS NOT FOR YOU! -->
|
|
||||||
<!-- If you need an answer right away, visit the ocelot.social Discord:
|
|
||||||
https://discord.gg/AJSX9DCSUA -->
|
|
||||||
|
|
||||||
## 🌟 EPIC
|
|
||||||
<!-- Describe your Epic in detail. Include screenshots and drawings -->
|
|
||||||
11
.github/ISSUE_TEMPLATE/---feature-request.md
vendored
11
.github/ISSUE_TEMPLATE/---feature-request.md
vendored
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F680 Feature Request"
|
|
||||||
about: Suggest an idea for this project.
|
|
||||||
title: "\U0001F680 [Feature] XXX"
|
|
||||||
labels: enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## :rocket: Feature Request
|
|
||||||
<!-- Give a short summary of the Feature. Use Screenshots if you want. -->
|
|
||||||
15
.github/ISSUE_TEMPLATE/---question.md
vendored
15
.github/ISSUE_TEMPLATE/---question.md
vendored
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F4AC Question"
|
|
||||||
about: If you need help understanding ocelot.social.
|
|
||||||
title: "\U0001F4AC [Question] XXX"
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- Chat with ocelot.social team -->
|
|
||||||
<!-- If you need an answer right away, visit the ocelot.social Discord:
|
|
||||||
https://discord.gg/AJSX9DCSUA -->
|
|
||||||
|
|
||||||
## 💬 Question
|
|
||||||
<!-- Describe your Question in detail. Include screenshots and drawings if needed. -->
|
|
||||||
11
.github/ISSUE_TEMPLATE/---refactor.md
vendored
11
.github/ISSUE_TEMPLATE/---refactor.md
vendored
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F527 Refactor"
|
|
||||||
about: Help us improve our code by refactoring it.
|
|
||||||
title: "\U0001F527 [Refactor] XXX"
|
|
||||||
labels: enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔧 Refactor
|
|
||||||
<!-- Describe your issue in detail. Include screenshots if needed. Give us as much information as possible. Use a clear and concise description of what the problem is.-->
|
|
||||||
10
.github/ISSUE_TEMPLATE/custom.md
vendored
10
.github/ISSUE_TEMPLATE/custom.md
vendored
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
name: Custom issue template
|
|
||||||
about: Describe this issue template's purpose here.
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
57
.github/workflows/deploy.yml
vendored
Normal file
57
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
name: deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [trigger-ocelot-brand-build-success]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
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: Deploy defined version to cluster
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SECRET: ${{ secrets.SECRET }}
|
||||||
|
CONFIGURATION: "this"
|
||||||
|
GITHUB_OCELOT_REF_JUST_BUILT: ${{ github.event.client_payload.ocelot_ref }}
|
||||||
|
DOCKERHUB_OCELOT_TAG_JUST_BUILT: ${{ github.event.client_payload.BUILD_VERSION }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Decrypt .env
|
||||||
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ env.SECRET }}" --output .env .env.enc
|
||||||
|
- name: Load .env
|
||||||
|
uses: aarcangeli/load-dotenv@v1.0.0
|
||||||
|
with:
|
||||||
|
quiet: true
|
||||||
|
- name: Set GITHUB_OCELOT_REF
|
||||||
|
run: |
|
||||||
|
if [ -z ${GITHUB_OCELOT_REF} ]; then
|
||||||
|
echo "GITHUB_OCELOT_REF=${GITHUB_OCELOT_REF_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Checkout Ocelot code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
||||||
|
ref: ${{ env.GITHUB_OCELOT_REF }}
|
||||||
|
path: 'ocelot/'
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: "ocelot/deployment/configurations/${{ env.CONFIGURATION }}"
|
||||||
|
- name: Set DOCKERHUB_OCELOT_TAG
|
||||||
|
run: |
|
||||||
|
if [ -z ${DOCKERHUB_OCELOT_TAG} ]; then
|
||||||
|
echo "DOCKERHUB_OCELOT_TAG=${DOCKERHUB_OCELOT_TAG_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Decrypt all secrets
|
||||||
|
run: ocelot/deployment/scripts/secrets.decrypt.sh
|
||||||
|
- name: Upgrade Cluster
|
||||||
|
run: ocelot/deployment/scripts/cluster.upgrade.sh
|
||||||
|
#- name: Sleep for 4 minutes
|
||||||
|
# run: sleep 240s
|
||||||
|
#- name: Reset and seed Neo4j database
|
||||||
|
# run: ocelot/deployment/scripts/cluster.reseed.sh
|
||||||
424
.github/workflows/publish.yml
vendored
424
.github/workflows/publish.yml
vendored
@ -1,224 +1,119 @@
|
|||||||
name: ocelot.social publish branded CI
|
name: publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [trigger-ocelot-build-success]
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
# - wir-social # for testing while developing
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
##############################################################################
|
build_branded:
|
||||||
# JOB: DOCKER BUILD COMMUNITY NEO4J ##########################################
|
name: Docker Build Branded
|
||||||
##############################################################################
|
|
||||||
build_branded_neo4j:
|
|
||||||
name: Docker Build Branded - Neo4j Community
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
#needs: [nothing]
|
env:
|
||||||
|
SECRET: ${{ secrets.SECRET }}
|
||||||
|
CONFIGURATION: "this"
|
||||||
|
GITHUB_OCELOT_REF_JUST_BUILT: ${{ github.event.client_payload.ref }}
|
||||||
|
OCELOT_GITHUB_RUN_NUMBER: ${{ github.event.client_payload.GITHUB_RUN_NUMBER }}
|
||||||
steps:
|
steps:
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
##########################################################################
|
- name: Decrypt .env
|
||||||
# SET ENVS ###############################################################
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ env.SECRET }}" --output .env .env.enc
|
||||||
##########################################################################
|
- name: Load .env
|
||||||
- name: ENV - VERSION
|
uses: aarcangeli/load-dotenv@v1.0.0
|
||||||
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
|
|
||||||
- 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 "${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_TAG=${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:
|
with:
|
||||||
name: docker-neo4j-community-branded
|
quiet: true
|
||||||
path: /tmp/neo4j-community-branded.tar
|
- name: Set GITHUB_OCELOT_REF
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: DOCKER BUILD BRANDED BACKEND ##########################################
|
|
||||||
##############################################################################
|
|
||||||
build_branded_backend:
|
|
||||||
name: Docker Build Branded - Backend
|
|
||||||
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 - 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
|
|
||||||
- name: ENV - BUILD_COMMIT
|
|
||||||
run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
|
||||||
##########################################################################
|
|
||||||
# BUILD BACKEND DOCKER IMAGE (branded) ################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Backend | Build `branded` image
|
|
||||||
run: |
|
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" .
|
if [ -z ${GITHUB_OCELOT_REF} ]; then
|
||||||
docker save "${DOCKER_ORGANISATION}/backend-branded" > /tmp/backend-branded.tar
|
echo "GITHUB_OCELOT_REF=${GITHUB_OCELOT_REF_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
- name: Upload Artifact
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Set DOCKERHUB_ORGANISATION
|
||||||
|
run: |
|
||||||
|
if [ -z ${DOCKERHUB_ORGANISATION} ]; then
|
||||||
|
echo "DOCKERHUB_ORGANISATION=ocelotsocialnetwork" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
- name: Checkout Ocelot code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
||||||
|
ref: ${{ env.GITHUB_OCELOT_REF }}
|
||||||
|
path: 'ocelot/'
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Set OCELOT_GITHUB_RUN_NUMBER
|
||||||
|
run: |
|
||||||
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
|
echo "OCELOT_GITHUB_RUN_NUMBER=${GITHUB_OCELOT_REF}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
|
echo "OCELOT_GITHUB_RUN_NUMBER=master" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Checkout Branded Repo code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: 'master'
|
||||||
|
path: "ocelot/deployment/configurations/${{ env.CONFIGURATION }}"
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Build branded images
|
||||||
|
run: |
|
||||||
|
ocelot/deployment/scripts/branded-images.build.sh
|
||||||
|
docker save "${DOCKERHUB_ORGANISATION}/backend-${DOCKERHUB_BRAND_VARRIANT}" > /tmp/backend-branded.tar
|
||||||
|
docker save "${DOCKERHUB_ORGANISATION}/webapp-${DOCKERHUB_BRAND_VARRIANT}" > /tmp/webapp-branded.tar
|
||||||
|
docker save "${DOCKERHUB_ORGANISATION}/maintenance-${DOCKERHUB_BRAND_VARRIANT}" > /tmp/maintenance-branded.tar
|
||||||
|
|
||||||
|
- name: Upload Artifact (Backend)
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: docker-backend-branded
|
name: docker-backend-branded
|
||||||
path: /tmp/backend-branded.tar
|
path: /tmp/backend-branded.tar
|
||||||
|
|
||||||
##############################################################################
|
- name: Upload Artifact (Webapp)
|
||||||
# JOB: DOCKER BUILD BRANDED WEBAPP ###########################################
|
|
||||||
##############################################################################
|
|
||||||
build_branded_webapp:
|
|
||||||
name: Docker Build Branded - WebApp
|
|
||||||
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 - 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
|
|
||||||
- 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:${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 save "${DOCKER_ORGANISATION}/webapp-branded" > /tmp/webapp-branded.tar
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: docker-webapp-branded
|
name: docker-webapp-branded
|
||||||
path: /tmp/webapp-branded.tar
|
path: /tmp/webapp-branded.tar
|
||||||
|
|
||||||
##############################################################################
|
- name: Upload Artifact (Maintenance)
|
||||||
# JOB: DOCKER BUILD BRANDED MAINTENANCE ######################################
|
|
||||||
##############################################################################
|
|
||||||
build_branded_maintenance:
|
|
||||||
name: Docker Build Branded - Maintenance
|
|
||||||
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 - 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
|
|
||||||
- name: ENV - BUILD_COMMIT
|
|
||||||
run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
|
||||||
##########################################################################
|
|
||||||
# BUILD MAINTENANCE DOCKER IMAGE (build) #################################
|
|
||||||
##########################################################################
|
|
||||||
- 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 save "${DOCKER_ORGANISATION}/maintenance-branded" > /tmp/maintenance-branded.tar
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: docker-maintenance-branded
|
name: docker-maintenance-branded
|
||||||
path: /tmp/maintenance-branded.tar
|
path: /tmp/maintenance-branded.tar
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: UPLOAD TO DOCKERHUB ###################################################
|
|
||||||
##############################################################################
|
|
||||||
upload_to_dockerhub:
|
upload_to_dockerhub:
|
||||||
name: Upload to Dockerhub
|
name: Upload to Dockerhub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build_branded_neo4j,build_branded_backend,build_branded_webapp,build_branded_maintenance]
|
needs: [build_branded]
|
||||||
env:
|
env:
|
||||||
|
SECRET: ${{ secrets.SECRET }}
|
||||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
GITHUB_OCELOT_REF_JUST_BUILT: ${{ github.event.client_payload.ref }}
|
||||||
steps:
|
steps:
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
##########################################################################
|
- name: Decrypt .env
|
||||||
# SET ENVS ###############################################################
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ env.SECRET }}" --output .env .env.enc
|
||||||
##########################################################################
|
- name: Load .env
|
||||||
- name: ENV - VERSION
|
uses: aarcangeli/load-dotenv@v1.0.0
|
||||||
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
|
|
||||||
- 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:
|
with:
|
||||||
name: docker-neo4j-community-branded
|
quiet: true
|
||||||
path: /tmp
|
- name: Set GITHUB_OCELOT_REF
|
||||||
- name: Load Docker Image
|
run: |
|
||||||
run: docker load < /tmp/neo4j-community-branded.tar
|
if [ -z ${GITHUB_OCELOT_REF} ]; then
|
||||||
# Backend
|
echo "GITHUB_OCELOT_REF=${GITHUB_OCELOT_REF_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Checkout Ocelot code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
||||||
|
ref: ${{ env.GITHUB_OCELOT_REF }}
|
||||||
|
path: 'ocelot/'
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Download Docker Image (Backend)
|
- name: Download Docker Image (Backend)
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@ -226,7 +121,7 @@ jobs:
|
|||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Load Docker Image
|
- name: Load Docker Image
|
||||||
run: docker load < /tmp/backend-branded.tar
|
run: docker load < /tmp/backend-branded.tar
|
||||||
# Webapp
|
|
||||||
- name: Download Docker Image (Webapp)
|
- name: Download Docker Image (Webapp)
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@ -234,7 +129,7 @@ jobs:
|
|||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Load Docker Image
|
- name: Load Docker Image
|
||||||
run: docker load < /tmp/webapp-branded.tar
|
run: docker load < /tmp/webapp-branded.tar
|
||||||
# Maintenance
|
|
||||||
- name: Download Docker Image (Maintenance)
|
- name: Download Docker Image (Maintenance)
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@ -242,74 +137,131 @@ jobs:
|
|||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Load Docker Image
|
- name: Load Docker Image
|
||||||
run: docker load < /tmp/maintenance-branded.tar
|
run: docker load < /tmp/maintenance-branded.tar
|
||||||
##########################################################################
|
|
||||||
# Upload #################################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: login to dockerhub
|
|
||||||
run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
|
|
||||||
- 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
|
|
||||||
|
|
||||||
##############################################################################
|
- name: Upload to dockerhub
|
||||||
# JOB: GITHUB TAG LATEST VERSION #############################################
|
run: ocelot/deployment/scripts/branded-images.upload.sh
|
||||||
##############################################################################
|
|
||||||
github_tag:
|
github_tag:
|
||||||
name: Tag latest version on Github
|
name: Tag latest version on Github
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [upload_to_dockerhub]
|
needs: [upload_to_dockerhub]
|
||||||
|
env:
|
||||||
|
SECRET: ${{ secrets.SECRET }}
|
||||||
|
GITHUB_OCELOT_REF_JUST_BUILT: ${{ github.event.client_payload.ref }}
|
||||||
|
OCELOT_GITHUB_RUN_NUMBER: ${{ github.event.client_payload.GITHUB_RUN_NUMBER }}
|
||||||
steps:
|
steps:
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
- name: Decrypt .env
|
||||||
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ env.SECRET }}" --output .env .env.enc
|
||||||
|
- name: Load .env
|
||||||
|
uses: aarcangeli/load-dotenv@v1.0.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch full History for changelog
|
quiet: true
|
||||||
##########################################################################
|
- name: Set GITHUB_OCELOT_REF
|
||||||
# SET ENVS ###############################################################
|
run: |
|
||||||
##########################################################################
|
if [ -z ${GITHUB_OCELOT_REF} ]; then
|
||||||
- name: ENV - VERSION
|
echo "GITHUB_OCELOT_REF=${GITHUB_OCELOT_REF_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
fi
|
||||||
- name: ENV - BUILD_DATE
|
shell: bash
|
||||||
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
|
- name: Checkout Ocelot code
|
||||||
- name: ENV - OCELOT_DOCKER_VERSION_TAG
|
uses: actions/checkout@v3
|
||||||
run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelotDockerVersionTag")" >> $GITHUB_ENV
|
with:
|
||||||
- name: ENV - DOCKER_ORGANISATION
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
||||||
run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').dockerOrganisation")" >> $GITHUB_ENV
|
ref: ${{ env.GITHUB_OCELOT_REF }}
|
||||||
# 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"
|
path: 'ocelot/'
|
||||||
- name: ENV - BUILD_VERSION
|
fetch-depth: 0
|
||||||
run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV
|
- name: Set OCELOT_GITHUB_RUN_NUMBER
|
||||||
- name: ENV - BUILD_COMMIT
|
run: |
|
||||||
run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
##########################################################################
|
echo "OCELOT_GITHUB_RUN_NUMBER=${GITHUB_OCELOT_REF}" >> $GITHUB_ENV
|
||||||
# Push build tag to GitHub ###############################################
|
fi
|
||||||
##########################################################################
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
|
echo "OCELOT_GITHUB_RUN_NUMBER=master" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Setup env
|
||||||
|
run: |
|
||||||
|
echo "OCELOT_VERSION=$(node -p -e "require('./ocelot/package.json').version")" >> $GITHUB_ENV
|
||||||
|
echo "BRANDED_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||||
|
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
|
||||||
|
echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
||||||
|
- run: echo "BUILD_VERSION=${BRANDED_VERSION}-ocelot.social${OCELOT_VERSION}-${OCELOT_GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||||
- name: package-version-to-git-tag + build number
|
- name: package-version-to-git-tag + build number
|
||||||
uses: pkgdeps/git-tag-action@v2
|
uses: pkgdeps/git-tag-action@v2
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ github.token }} #${{ secrets.GITHUB_TOKEN }}
|
||||||
github_repo: ${{ github.repository }}
|
github_repo: ${{ github.repository }}
|
||||||
version: ${{ env.BUILD_VERSION }}
|
version: ${{ env.BUILD_VERSION }}
|
||||||
git_commit_sha: ${{ github.sha }}
|
git_commit_sha: ${{ github.sha }}
|
||||||
git_tag_prefix: "b"
|
git_tag_prefix: "b"
|
||||||
##########################################################################
|
#- name: Generate changelog
|
||||||
# Push release tag to GitHub #############################################
|
# run: |
|
||||||
##########################################################################
|
# yarn install
|
||||||
|
# yarn auto-changelog --latest-version ${{ env.VERSION }} --unreleased-only
|
||||||
- name: package-version-to-git-release
|
- name: package-version-to-git-release
|
||||||
continue-on-error: true # Will fail if tag exists
|
continue-on-error: true # Will fail if tag exists
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
GITHUB_TOKEN: ${{ github.token }} #${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.VERSION }}
|
tag_name: ${{ env.BUILD_VERSION }}
|
||||||
release_name: ${{ env.VERSION }}
|
release_name: ${{ env.BUILD_VERSION }}
|
||||||
#body_path: ./CHANGELOG.md
|
#body_path: ./CHANGELOG.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
# TODO correct version
|
||||||
|
build_trigger:
|
||||||
|
name: Trigger successful brand build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [github_tag]
|
||||||
|
env:
|
||||||
|
SECRET: ${{ secrets.SECRET }}
|
||||||
|
GITHUB_OCELOT_REF_JUST_BUILT: ${{ github.event.client_payload.ref }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Decrypt .env
|
||||||
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ env.SECRET }}" --output .env .env.enc
|
||||||
|
- name: Load .env
|
||||||
|
uses: aarcangeli/load-dotenv@v1.0.0
|
||||||
|
with:
|
||||||
|
quiet: true
|
||||||
|
- name: Set GITHUB_OCELOT_REF
|
||||||
|
run: |
|
||||||
|
if [ -z ${GITHUB_OCELOT_REF} ]; then
|
||||||
|
echo "GITHUB_OCELOT_REF=${GITHUB_OCELOT_REF_JUST_BUILT}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Checkout Ocelot code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
||||||
|
ref: ${{ env.GITHUB_OCELOT_REF }}
|
||||||
|
path: 'ocelot/'
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Set OCELOT_GITHUB_RUN_NUMBER
|
||||||
|
run: |
|
||||||
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
|
echo "OCELOT_GITHUB_RUN_NUMBER=${GITHUB_OCELOT_REF}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
if [ -z ${OCELOT_GITHUB_RUN_NUMBER} ]; then
|
||||||
|
echo "OCELOT_GITHUB_RUN_NUMBER=master" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- name: Setup env
|
||||||
|
run: |
|
||||||
|
echo "OCELOT_VERSION=$(node -p -e "require('./ocelot/package.json').version")" >> $GITHUB_ENV
|
||||||
|
echo "BRANDED_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||||
|
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
|
||||||
|
echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
|
||||||
|
- run: echo "BUILD_VERSION=${BRANDED_VERSION}-ocelot.social${OCELOT_VERSION}-${OCELOT_GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||||
|
- name: Repository Dispatch
|
||||||
|
uses: peter-evans/repository-dispatch@v2
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
event-type: trigger-ocelot-brand-build-success
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "ref_ocelot": "${{ github.event.client_payload.ref }}", "sha_ocelot": "${{ github.event.client_payload.sha }}", "OCELOT_VERSION": "${{ env.OCELOT_VERSION }}", "BRANDED_VERSION": "${{ env.BRANDED_VERSION }}", "BUILD_DATE": "${{ env.BUILD_DATE }}", "BUILD_COMMIT": "${{ env.BUILD_COMMIT }}", "BUILD_VERSION": "${{ env.BUILD_VERSION }}"}'
|
||||||
Loading…
x
Reference in New Issue
Block a user