107 lines
2.9 KiB
YAML
107 lines
2.9 KiB
YAML
---
|
|
# Jenkins Configuration as Code (JCasC)
|
|
# Pre-configures Jenkins for the Fellowship DevOps Escape Room tutorial
|
|
|
|
jenkins:
|
|
systemMessage: |
|
|
🧙 Welcome to the Fellowship's Jenkins CI!
|
|
One does not simply skip the pipeline...
|
|
This Jenkins is pre-configured for the LOTR SUT tutorial.
|
|
|
|
numExecutors: 2
|
|
mode: NORMAL
|
|
labelString: ""
|
|
|
|
securityRealm:
|
|
local:
|
|
allowsSignup: false
|
|
users:
|
|
- id: "fellowship"
|
|
name: "Gandalf the Grey"
|
|
password: "${JENKINS_ADMIN_PASSWORD:-fellowship123}"
|
|
properties:
|
|
- mailer:
|
|
emailAddress: "gandalf@fellowship.local"
|
|
|
|
authorizationStrategy:
|
|
loggedInUsersCanDoAnything:
|
|
allowAnonymousRead: true
|
|
|
|
globalNodeProperties:
|
|
- envVars:
|
|
env:
|
|
- key: "GITEA_URL"
|
|
value: "http://gitea:3000"
|
|
- key: "GITEA_HTTP_URL"
|
|
value: "${GITEA_HTTP_URL:-http://gitea:3000}"
|
|
- key: "SUT_REPO"
|
|
value: "http://gitea:3000/fellowship/lotr-sut.git"
|
|
|
|
credentials:
|
|
system:
|
|
domainCredentials:
|
|
- credentials:
|
|
- usernamePassword:
|
|
description: "Gitea repository credentials"
|
|
id: "gitea-credentials"
|
|
password: "fellowship123"
|
|
scope: GLOBAL
|
|
username: "fellowship"
|
|
|
|
unclassified:
|
|
location:
|
|
# JENKINS_URL is injected by the devops-escape-room docker-compose from the
|
|
# per-instance .env file (e.g. https://jenkins-fellowship-pool-8.fellowship.testingfantasy.com/).
|
|
# Falls back to the plain HTTP address for local / offline use.
|
|
url: "${JENKINS_URL:-http://localhost:8080/}"
|
|
adminAddress: "gandalf@fellowship.local"
|
|
|
|
mailer:
|
|
smtpHost: "mailhog"
|
|
smtpPort: "1025"
|
|
useSsl: false
|
|
charset: "UTF-8"
|
|
|
|
giteaServers:
|
|
servers:
|
|
- displayName: "Fellowship Gitea"
|
|
serverUrl: "http://gitea:3000"
|
|
manageHooks: false
|
|
|
|
jobs:
|
|
- script: >
|
|
pipelineJob('fellowship-sut-pipeline') {
|
|
displayName('Fellowship SUT — Build, Deploy & Test')
|
|
description('Complete CI/CD pipeline: build the SUT, deploy to containers, run e2e tests')
|
|
|
|
definition {
|
|
cpsScm {
|
|
scm {
|
|
git {
|
|
remote {
|
|
url('http://gitea:3000/fellowship-org/lotr-sut.git')
|
|
credentialsId('gitea-credentials')
|
|
}
|
|
branch('*/main')
|
|
extensions {
|
|
wipeOutWorkspace()
|
|
}
|
|
}
|
|
}
|
|
scriptPath('Jenkinsfile')
|
|
}
|
|
}
|
|
|
|
triggers {
|
|
scm('H/5 * * * *') // Poll Gitea every 5 minutes for changes
|
|
}
|
|
|
|
properties {
|
|
logRotator {
|
|
numToKeep(10)
|
|
daysToKeepStr('30')
|
|
}
|
|
disableConcurrentBuilds()
|
|
}
|
|
}
|