Skip to content

Commit

Permalink
fix: use kube-workflow (#73)
Browse files Browse the repository at this point in the history
* fix: use kube-workflow

* fix

* fix: build args

* Delete redirect.yml

* fix: use redirectFrom

* fix
  • Loading branch information
Julien Bouquillon authored Apr 12, 2022
1 parent 35f3530 commit 92b8324
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 77 deletions.
33 changes: 8 additions & 25 deletions .github/workflows/preproduction.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,46 @@
name: Preproduction

on:
workflow_dispatch:
push:
branches:
- master
- alpha
tags-ignore:
- v*

concurrency:
group: preproduction
cancel-in-progress: true
group: preproduction

jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:

- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: preprod
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
dockerbuildargs: |
NEXT_PUBLIC_MATOMO_SITE_ID=47
NEXT_PUBLIC_MATOMO_ENABLED=false
NEXT_PUBLIC_MATOMO_URL=https://matomo.fabrique.social.gouv.fr/
NEXT_PUBLIC_API_URL=https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr
##############################################################################
## DEPLOY PREPRODUCTION APPLICATION
##############################################################################
deploy:
name: Deploy preproduction
name: Deploy application
runs-on: ubuntu-latest
needs: [register]
environment:
name: preproduction
url: ${{ steps.deploy.outputs.url }}
url: https://nos1000jours-blues-epds-pro-preprod.dev.fabrique.social.gouv.fr
steps:

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
id: deploy
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: "preprod"
environment: preprod
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
28 changes: 7 additions & 21 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,35 @@ concurrency:
cancel-in-progress: true

jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:

- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: prod
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
dockerbuildargs: |
NEXT_PUBLIC_MATOMO_SITE_ID=47
NEXT_PUBLIC_MATOMO_ENABLED=true
NEXT_PUBLIC_MATOMO_URL=https://matomo.fabrique.social.gouv.fr/
NEXT_PUBLIC_API_URL=https://backoffice-les1000jours.fabrique.social.gouv.fr
##############################################################################
## DEPLOY PRODUCTION APPLICATION
##############################################################################
deploy:
name: Deploy application
runs-on: ubuntu-latest
needs: [register]
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
url: https://nos1000jours-blues-epds-pro.fabrique.social.gouv.fr
steps:

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
id: deploy
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: "prod"
environment: prod
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
30 changes: 9 additions & 21 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,36 @@ on:

concurrency:
cancel-in-progress: true
group: ${{ github.ref }}
group: review-${{ github.ref }}

jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:

- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
imagePackage: app
token: ${{ secrets.GITHUB_TOKEN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
dockerbuildargs: |
NEXT_PUBLIC_MATOMO_SITE_ID=47
NEXT_PUBLIC_MATOMO_ENABLED=false
NEXT_PUBLIC_MATOMO_URL=https://matomo.fabrique.social.gouv.fr/
NEXT_PUBLIC_API_URL=https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr
##############################################################################
## DEPLOY APPLICATION OVER KUBERNETES
##############################################################################
deploy:
name: Deploy application
name: Deploy review branch
runs-on: ubuntu-latest
needs: [register,]
needs: [register]
steps:

- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-helm-deploy@v1
- name: Use kube-workflow deployment
uses: SocialGouv/kube-workflow@v1
with:
environment: "dev"
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
imageName: nos1000jours/nos1000jours-blues-epds-pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ metadata:
labels:
component: app
name: www-redirect
namespace: incubateur
spec:
rules:
- host: nos1000jours-web-pro.fabrique.social.gouv.fr
tls:
- hosts:
- nos1000jours-web-pro.fabrique.social.gouv.fr
secretName: www-redirect
secretName: www-redirect
2 changes: 2 additions & 0 deletions .kube-workflow/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app:
certSecretName: nos1000jours-blues-epds-pro-crt
3 changes: 3 additions & 0 deletions .kube-workflow/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
app:
probesPath: /healthz
envConfigName: nos1000jours-web-pro-configmap
2 changes: 0 additions & 2 deletions .socialgouv/chart/values.project.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .socialgouv/config.json

This file was deleted.

0 comments on commit 92b8324

Please sign in to comment.