-
Notifications
You must be signed in to change notification settings - Fork 2
/
03_jobs.yaml
86 lines (83 loc) · 2.83 KB
/
03_jobs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
jobs:
- script: >
pipelineJob('docker-test') {
definition {
cps {
script('''
pipeline {
agent any
stages {
stage('test docker') {
steps {
sh 'docker ps'
}
}
}
}
''')
sandbox()
}
}
}
- script: >
pipelineJob('jenkins-env-automation') {
description('This job automates Jenkins setup, testing, and environment management.')
parameters {
stringParam('SUBDOMAIN', '', 'Specify the subdomain for the Jenkins instance, e.g. "jenkinsinstance"')
stringParam('CONFIG_REPO', '', 'GitHub link to the configuration repository.')
stringParam('BRANCH', '', 'Branch of the configuration repository to use (optional).')
stringParam('SERVER_TYPE', 'cx22', 'Specify the Hetzner server type for the VMs (Jenkins controller and agents). Options are: cx22, cpx11, cpx21, cpx31, cpx41')
}
definition {
cpsScm {
scm {
git {
remote {
url('https://github.com/cqNikolaus/jenkins_automation')
}
branches('*/main')
}
}
scriptPath('Jenkinsfile')
}
}
}
- script: >
pipelineJob('jenkins-setup') {
description('This job sets up Jenkins using the Jenkinsfile_setup.')
parameters {
stringParam('SUBDOMAIN', '', 'Specify the subdomain for the Jenkins instances, e.g. jenkinsinstance')
stringParam('CONFIG_REPO', '', 'GitHub link to the configuration repository.')
stringParam('BRANCH', '', 'Branch of the configuration repository to use (optional).')
stringParam('SERVER_TYPE', 'cx22', 'Specify the Hetzner server type for the VMs (Jenkins controller and agents). Options are: cx22, cpx11, cpx21, cpx31, cpx41')
stringParam('NUM_INSTANCES', '1', 'Specify the number of Jenkins instances to set up.')
}
definition {
cpsScm {
scm {
git {
remote {
url('https://github.com/cqNikolaus/jenkins_automation.git')
}
branches('*/main')
}
}
scriptPath('Jenkinsfile_Setup')
}
}
}
- script: >
pipelineJob('BuildImage') {
definition {
cps {
script('''
node() {
git branch: 'main', url: 'https://github.com/cqNikolaus/jenkins_automation.git'
sh "ls -lart"
sh "docker build --no-cache -t python-build ."
}
''')
sandbox()
}
}
}