diff options
-rw-r--r--[-rwxr-xr-x] | extras/jenkins/setup-periodic-trigger-for-all-jobs.sh (renamed from manual/jenkins/setup-periodic-trigger-for-all-jobs.sh) | 0 | ||||
-rw-r--r-- | manual/jenkins/readme.md | 16 | ||||
-rw-r--r-- | manual/jobs.json (renamed from manual/jenkins/jobs.json) | 0 | ||||
-rwxr-xr-x | manual/seed-jobs.sh (renamed from manual/jenkins/seed-jobs.sh) | 2 | ||||
-rw-r--r-- | readme.md | 15 |
5 files changed, 12 insertions, 21 deletions
diff --git a/manual/jenkins/setup-periodic-trigger-for-all-jobs.sh b/extras/jenkins/setup-periodic-trigger-for-all-jobs.sh index 2265a1a..2265a1a 100755..100644 --- a/manual/jenkins/setup-periodic-trigger-for-all-jobs.sh +++ b/extras/jenkins/setup-periodic-trigger-for-all-jobs.sh diff --git a/manual/jenkins/readme.md b/manual/jenkins/readme.md deleted file mode 100644 index 37a0131..0000000 --- a/manual/jenkins/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -Example scripts how to manage Jenkins automatically. - -In order to make scripts work you need to create API token update script to use your credentials. - -Jenkins setup --- - -**User account (click on your username - top-right corner) -> Configure** - -**API Token -> Current token(s) -> Add new Token** - -``` -Name: CLI -``` - --> Generate -> [copy generated key and save it for later use] diff --git a/manual/jenkins/jobs.json b/manual/jobs.json index 2605b96..2605b96 100644 --- a/manual/jenkins/jobs.json +++ b/manual/jobs.json diff --git a/manual/jenkins/seed-jobs.sh b/manual/seed-jobs.sh index a879e83..0d20ccc 100755 --- a/manual/jenkins/seed-jobs.sh +++ b/manual/seed-jobs.sh @@ -34,7 +34,7 @@ workDir="/tmp/seed-jobs" mkdir -p "$workDir" -templatePath="jobTemplate.xml" +templatePath="../jobs/jobTemplate.xml" jenkinsUser=${jenkinsUser:-$JENKINS_USER} jenkinsToken=${jenkinsToken:-$JENKINS_TOKEN} jenkinsUrl="http://${jenkinsUser}:${jenkinsToken}@$jenkinsHost" @@ -569,9 +569,15 @@ chmod +x /usr/local/bin/uncron-add Multibranch Pipelines (by script) -- -Experimental script exists to automate pipeline/job creation. +Script exists to automate pipeline/job creation. -Check the `manual/jenkins/seed-jobs.sh` for details. +**Generate Jenkins API token:** + +**User account (click on your username - top-right corner) -> Configure**\ +**API Token -> Current token(s) -> Add new Token** + +> **Name:** CLI\ +> -> [Generate] -> [copy generated key and save it for later use] **Get the script seed-jobs.sh** @@ -579,7 +585,7 @@ And its assets (jobs.json, jobTemplate.xml). ```bash git clone https://github.com/dd010101/vyos-jenkins.git -cd vyos-jenkins/manual/jenkins +cd vyos-jenkins/manual ``` **Install dependencies** @@ -591,7 +597,8 @@ apt install -y xmlstarlet jq **Adjust settings to suit your Jenkins** ```bash -cat seed-jobs.sh +export JENKINS_USER=<your-username> +export JENKINS_TOKEN=<your-token> ``` **Create jobs** |