Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat: ci on kontinuous (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo authored Jun 19, 2023
1 parent e4f9a8c commit d05e6b1
Show file tree
Hide file tree
Showing 32 changed files with 158 additions and 233 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/deactivate.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
name: Deactivate

name: ♻️ Deactivate
on:
workflow_dispatch:
pull_request:
types: [closed]
delete:
branches:
- "**"
- "!v*"
- "!master"
- "!main"
- "!dev"
- "!develop"
- "!**/persist"
- "!persist/**"
- "!**/persist/**"
- "!persist-**"
- "!**-persist"
- "!**-persist-**"

jobs:
bury_review_env:
name: Deactivate review branch
runs-on: ubuntu-latest
steps:
- uses: SocialGouv/actions/autodevops-deactivate@v1
with:
kube-config: ${{ secrets.KUBECONFIG }}
github-token: ${{ secrets.GITHUB_TOKEN }}
socialgouv:
uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate.yaml@v1
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/preproduction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 😎 PreProd
on:
workflow_dispatch:
push:
branches:
- "master"
- "main"

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction.yaml@v1
secrets: inherit
50 changes: 0 additions & 50 deletions .github/workflows/preproduction.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 🚀 Production
on:
workflow_dispatch:
push:
tags:
- v*

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-production.yaml@v1
secrets: inherit
50 changes: 0 additions & 50 deletions .github/workflows/production.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release
on:
workflow_dispatch:
push:
branches: [master, main, alpha, beta, next]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: socialgouv/workflows/actions/semantic-release@v1
with:
github-token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
author-name: ${{ secrets.SOCIALGROOVYBOT_NAME }}
author-email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
33 changes: 0 additions & 33 deletions .github/workflows/release.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/review-auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 👓 Review Auto
on:
push:
branches:
- "feat/**"
- "fix/**"

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto.yaml@v1
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 👀 Review
on:
push:
branches:
- "**"
- "!master"
- "!main"
- "!feat/**"
- "!fix/**"

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}

jobs:
socialgouv:
name: "🇫🇷 SocialGouv"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-review.yaml@v1
secrets: inherit
46 changes: 0 additions & 46 deletions .github/workflows/review.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .kontinuous/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
dependencies:
- condition: keycloak.enabled
name: keycloak
repository: https://codecentric.github.io/helm-charts
version: 17.0.3
31 changes: 31 additions & 0 deletions .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
app:
~needs: [build-app,seed]

jobs:
runs:
db:
use: create-db
seed:
~needs: [build-app,db]
checkout: false # no need to checkout the repo as we use the docker image
shell: sh
image: "{{ .Values.global.registry }}{{ if .Values.global.imageProject }}{{ print `/` .Values.global.imageProject }}{{ end }}/{{ .Values.global.imageRepository }}/app:{{ .Values.global.imageTag }}"
run: "yarn db:init"
envFrom:
- secretRef:
name: "pg-user"

db-keycloak:
use: create-db
with:
pgSecretName: "keycloak-db"
database: "keycloak_{{ .Values.global.branchSlug32 }}"
pgUser: "keycloak_{{ .Values.global.branchSlug32 }}"

keycloak:
~needs: [db-keycloak]
extraEnvFrom: |
- secretRef:
name: "keycloak-db"
- secretRef:
name: keycloak-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ keycloak:
- hosts:
- "keycloak-{{ .Values.global.host }}"
secretName: keycloak-crt

jobs:
runs:
build-app:
with:
buildArgs:
PRODUCTION: "true"
20 changes: 13 additions & 7 deletions .kube-workflow/values.yaml → .kontinuous/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
app:
containerPort: 3000
probesPath: "/healthz"
envFrom:
- secretRef:
Expand All @@ -19,13 +20,6 @@ keycloak:
postgresql:
enabled: false

statefulsetAnnotations:
kapp.k14s.io/nonce: ''
kapp.k14s.io/update-strategy: fallback-on-replace
kapp.k14s.io/change-group: "kube-workflow/keycloak.{{ .Values.global.namespace }}"
kapp.k14s.io/disable-original: ''
kapp.k14s.io/create-strategy: fallback-on-update

extraEnvFrom: |
- secretRef:
name: keycloak-db
Expand Down Expand Up @@ -107,3 +101,15 @@ keycloak:
paths:
- path: /
pathType: Prefix

deactivate:
jobs-deactivate:
runs:
deactivate:
with:
db: true
drop-db2:
use: drop-db
with:
database: "keycloak_{{.Values.global.branchSlug32}}"
databaseUser: "keycloak_{{ .Values.global.branchSlug32 }}"
Loading

0 comments on commit d05e6b1

Please sign in to comment.