Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
athomaj authored Dec 8, 2023
0 parents commit 8875ff3
Show file tree
Hide file tree
Showing 65 changed files with 39,363 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/deployment-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Main Workflow
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_call:
outputs:
repo_name:
description: "API URL"
value: ${{ jobs.get-repo-name.outputs.repo_name }}
jobs:
get-repo-name:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.get_name.outputs.repo_name }}
steps:
- name: get_name
id: get_name
run: |
echo "repo_name=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT
- name: print_name
run: |
echo "TOTO ${{ steps.get_name.outputs.repo_name }}"
run-build-job-back:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-back.yaml@main
needs: get-repo-name
with:
BUILD_FOLDER: ./back
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-back
PROJECT_DB: ${{ needs.get-repo-name.outputs.repo_name }}
PROJECT_BUCKET: ${{ needs.get-repo-name.outputs.repo_name }}
NAMESPACE: 'default'
DOMAIN: 'development.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.IONOS_KUBE_CONFIG }}
run-build-job-front:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-front.yaml@main
needs: [get-repo-name, run-build-job-back]
with:
BUILD_FOLDER: ./front
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-front
API_URL: https://${{ needs.run-build-job-back.outputs.output_api_url }}
NAMESPACE: 'default'
DOMAIN: 'development.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.IONOS_KUBE_CONFIG }}
run-build-job-notif:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-notification-chat.yaml@main
needs: [run-build-job-back, run-build-job-front]
with:
FRONT_URL: ${{ needs.run-build-job-front.outputs.output_front_url }}
API_URL: ${{ needs.run-build-job-back.outputs.output_api_url }}
CHAT_WEBHOOK: https://chat.googleapis.com/v1/spaces/AAAA8O2Mmwo/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=GmCyFbLHoBlwMgFynO008fEdnQclWgtE3U-cG1Qlpvg%3D
56 changes: 56 additions & 0 deletions .github/workflows/deployment-preprod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Main Workflow
on:
push:
branches:
- preprod
workflow_call:
outputs:
repo_name:
description: "API URL"
value: ${{ jobs.get-repo-name.outputs.repo_name }}
jobs:
get-repo-name:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.get_name.outputs.repo_name }}
steps:
- name: get_name
id: get_name
run: |
echo "repo_name=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT
- name: print_name
run: |
echo "TOTO ${{ steps.get_name.outputs.repo_name }}"
run-build-job-back:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-back.yaml@main
needs: get-repo-name
with:
BUILD_FOLDER: ./back
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-back
PROJECT_DB: ${{ needs.get-repo-name.outputs.repo_name }}
PROJECT_BUCKET: ${{ needs.get-repo-name.outputs.repo_name }}
NAMESPACE: 'c-laplateforme-dev'
DOMAIN: 'preprod.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.BLACKSWIFT_KUBE_CONFIG }}
run-build-job-front:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-front.yaml@main
needs: [get-repo-name, run-build-job-back]
with:
BUILD_FOLDER: ./front
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-front
API_URL: https://${{ needs.run-build-job-back.outputs.output_api_url }}
NAMESPACE: 'c-laplateforme-dev'
DOMAIN: 'preprod.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.BLACKSWIFT_KUBE_CONFIG }}
run-build-job-notif:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-notification-chat.yaml@main
needs: [run-build-job-back, run-build-job-front]
with:
FRONT_URL: ${{ needs.run-build-job-front.outputs.output_front_url }}
API_URL: ${{ needs.run-build-job-back.outputs.output_api_url }}
CHAT_WEBHOOK: https://chat.googleapis.com/v1/spaces/AAAA8O2Mmwo/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=GmCyFbLHoBlwMgFynO008fEdnQclWgtE3U-cG1Qlpvg%3D
56 changes: 56 additions & 0 deletions .github/workflows/deployment-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Main Workflow
on:
push:
branches:
- production
workflow_call:
outputs:
repo_name:
description: "API URL"
value: ${{ jobs.get-repo-name.outputs.repo_name }}
jobs:
get-repo-name:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.get_name.outputs.repo_name }}
steps:
- name: get_name
id: get_name
run: |
echo "repo_name=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT
- name: print_name
run: |
echo "TOTO ${{ steps.get_name.outputs.repo_name }}"
run-build-job-back:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-back.yaml@main
needs: get-repo-name
with:
BUILD_FOLDER: ./back
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-back
PROJECT_DB: ${{ needs.get-repo-name.outputs.repo_name }}
PROJECT_BUCKET: ${{ needs.get-repo-name.outputs.repo_name }}
NAMESPACE: 'c-laplateforme-prod'
DOMAIN: 'production.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.BLACKSWIFT_KUBE_CONFIG }}
run-build-job-front:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-front.yaml@main
needs: [get-repo-name, run-build-job-back]
with:
BUILD_FOLDER: ./front
IMAGE_NAME: ${{ needs.get-repo-name.outputs.repo_name }}-front
API_URL: https://${{ needs.run-build-job-back.outputs.output_api_url }}
NAMESPACE: 'c-laplateforme-prod'
DOMAIN: 'production.atelier.ovh'
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
BLACKSWIFT_KUBE_CONFIG: ${{ secrets.BLACKSWIFT_KUBE_CONFIG }}
run-build-job-notif:
uses: laplateformeio/atelier-workflows/.github/workflows/workflow-notification-chat.yaml@main
needs: [run-build-job-back, run-build-job-front]
with:
FRONT_URL: ${{ needs.run-build-job-front.outputs.output_front_url }}
API_URL: ${{ needs.run-build-job-back.outputs.output_api_url }}
CHAT_WEBHOOK: https://chat.googleapis.com/v1/spaces/AAAA8O2Mmwo/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=GmCyFbLHoBlwMgFynO008fEdnQclWgtE3U-cG1Qlpvg%3D
71 changes: 71 additions & 0 deletions .github/workflows/uninstall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Close Pull Request

# only trigger on pull request closed events
on:
pull_request:
branches:
- 'master'
- 'main'
types: [ closed ]
workflow_call:
outputs:
repo_name:
description: "API URL"
value: ${{ jobs.get-repo-name.outputs.repo_name }}
env:
IMAGE_BACK_NAME: starter-back
IMAGE_FRONT_NAME: starter-front
jobs:
get-repo-name:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.get_name.outputs.repo_name }}
steps:
- name: get_name
id: get_name
run: |
echo "repo_name=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT
- name: print_name
run: |
echo "TOTO ${{ steps.get_name.outputs.repo_name }}"
close_job:
needs: get-repo-name
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v3

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
id: extract_branch

- name: Create kube config
run: |
mkdir -p $HOME/.kube/
echo "${{ secrets.IONOS_KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config
chmod 600 $HOME/.kube/config
- name: Install helm
run: |
curl -LO https://get.helm.sh/helm-v3.8.0-linux-amd64.tar.gz
tar -zxvf helm-v3.8.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm version
- name: Install or Update Chart
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ needs.get-repo-name.outputs.repo_name }}-back
VERSION=${{ steps.extract_branch.outputs.branch }}
VERSION=$(echo $VERSION | cut -c -20 | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
helm uninstall ${{ needs.get-repo-name.outputs.repo_name }}-back-$VERSION
- name: Install or Update Chart
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ needs.get-repo-name.outputs.repo_name }}-front
VERSION=${{ steps.extract_branch.outputs.branch }}
VERSION=$(echo $VERSION | cut -c -20 | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
helm uninstall ${{ needs.get-repo-name.outputs.repo_name }}-front-$VERSION
16 changes: 16 additions & 0 deletions back/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
26 changes: 26 additions & 0 deletions back/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HOST=0.0.0.0
PORT=1337
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified

DATABASE_HOST=
DATABASE_PORT=
DATABASE_NAME=
DATABASE_USERNAME=
DATABASE_PASSWORD=

SMTP_HOST=
SMTP_PORT=
SMTP_USERNAME=
SMTP_PASSWORD=

MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_BUCKET=
MINIO_ENDPOINT=
MINIO_PORT=
MINIO_USE_SSL=
MINIO_HOST=
MINIO_FOLDER=
3 changes: 3 additions & 0 deletions back/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
**/node_modules/**
27 changes: 27 additions & 0 deletions back/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"es6": true,
"node": true,
"browser": false
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": false
},
"sourceType": "module"
},
"globals": {
"strapi": true
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}
Loading

0 comments on commit 8875ff3

Please sign in to comment.