diff --git a/docs/faq.md b/docs/faq.md index e37e715dd9..32b5ed7da5 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -237,6 +237,68 @@ oauth2-proxy: [TODO] +## Trigger specific jobs or deployments + +If you want to define some specific deployments, you can use the `--chart` option to target a specific chart. This is useful for example for manually triggering some specific jobs or deployments. + +Example : + +create a subchart of project, in `.kontinuous/charts/prod-dump/values.yaml` put: +```yaml +jobs-prod-dump: + ~chart: project.fabrique.contrib.jobs + enabled: true + runs: + anonymise: + ~needs: [pg-restore] + image: ghcr.io/socialgouv/docker/s3-client:1.2.0 + entrypoint: ["/bin/bash"] + args: + - "-c" + - "echo 42" + envFrom: + - secretRef: + name: pg-restore-superuser +``` +then, ensure it will not be triggered with the deployment: +- put in `.kontinuous/values.yaml`: +```yaml +prod-dump: + enabled: false +``` +- put in `.kontinuous/Chart.yaml`: +```yaml +dependencies: + - name: prod-dump + repository: file://./charts/prod-dump + condition: prod-dump.enabled +``` + +then build your manifest: +```sh +kontinuous build --ignore-project-templates --chart prod-dump +``` + +or call via action: +```yaml +jobs: + deploy: + name: Custom Pipeline 🛸 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: socialgouv/kontinuous/.github/actions/deploy-via-github@v1 + with: + kubeconfig: ${{ inputs.kubeconfig || secrets.KUBECONFIG }} + chart: prod-dump + ignoreProjectTemplates: true +``` + +or use re-usable workflow like this one: +- https://github.com/SocialGouv/workflows/blob/master/.github/workflows/use-ks-gh-custom.yaml + ## 🐰 Easter egg – I heard about an easter egg hidden in the kontinuous cli, can you give me a clue ?