From d57901a741bda0a5823b371b3e9a4a51380c378f Mon Sep 17 00:00:00 2001 From: Jeremy Adams Date: Fri, 8 Apr 2022 15:38:17 -0700 Subject: [PATCH] docs: Add Jenkins CI doc. Fixes #2067 Signed-off-by: Jeremy Adams --- docs/getting-started/1201-ci-environment.md | 33 ++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/1201-ci-environment.md b/docs/getting-started/1201-ci-environment.md index 2313e30e..e28e2504 100644 --- a/docs/getting-started/1201-ci-environment.md +++ b/docs/getting-started/1201-ci-environment.md @@ -105,7 +105,38 @@ build: -If you would like us to document Jenkins next, vote for it here: [dagger#1677](https://github.com/dagger/dagger/discussions/1677) +With `docker` and `dagger` installed on your Jenkins agent. + +```groovy +pipeline { + agent any + environment { + //https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials + //e.g. + //DH_CREDS=credentials('jenkins-dockerhub-creds') + //AWS_ACCESS_KEY_ID = credentials('jenkins-aws-secret-key-id') + //AWS_SECRET_ACCESS_KEY = credentials('jenkins-aws-secret-access-key') + } + stages { + stage("setup") { + steps { + //only needed if you don't commit the cue.mod directory to git + //sh ''' + // dagger project init + // dagger project update + //''' + } + } + stage("do") { + steps { + //substitute your action name for 'helloworld' + //e.g. 'build' or 'push' or whatever you've created! + sh 'dagger do helloworld --log-format=plain' + } + } + } +} +```