File tree 4 files changed +66
-1
lines changed
4 files changed +66
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ If you're planning to test changes, it would be best to fork
163
163
this repo so that you do your work there. The workflow
164
164
requires a remote repo to which to push changes.
165
165
166
- ### Creating AWS credentials configs
166
+ ### [ OPTIONAL ] Creating AWS credentials configs
167
167
168
168
If you are in production where we upload builds to S3 OR you want to
169
169
test uploading to S3 as part of your pipeline development, you need to
@@ -217,6 +217,15 @@ $ aws s3 mb my-fcos-bucket
217
217
218
218
And provide it to ` --bucket ` below.
219
219
220
+ ### [ OPTIONAL] Slack integration
221
+
222
+ If you want to be able to have build status messages appear in Slack,
223
+ create a ` slack-api-token ` secret:
224
+
225
+ ```
226
+ $ oc create secret generic slack-api-token --from-file=token=/path/to/token
227
+ ```
228
+
220
229
### Create a Jenkins instance with a persistent volume backing store
221
230
222
231
```
Original file line number Diff line number Diff line change 1
1
github-oauth:0.33
2
+ configuration-as-code:1.33
3
+ slack:2.34
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ objects:
74
74
value : " true"
75
75
- name : JNLP_SERVICE_NAME
76
76
value : ${JNLP_SERVICE_NAME}
77
+ # DELTA: point c-as-c plugin to config map files; see below
78
+ - name : CASC_JENKINS_CONFIG
79
+ value : /var/lib/jenkins/jcasc
77
80
image : ' '
78
81
imagePullPolicy : IfNotPresent
79
82
livenessProbe :
@@ -100,13 +103,30 @@ objects:
100
103
volumeMounts :
101
104
- mountPath : /var/lib/jenkins
102
105
name : ${JENKINS_SERVICE_NAME}-data
106
+ # DELTA: mount c-as-c config map
107
+ - name : ${JENKINS_SERVICE_NAME}-cfg
108
+ mountPath : /var/lib/jenkins/jcasc
109
+ readOnly : true
110
+ # DELTA: mount Slack token; see below
111
+ - name : slack-token
112
+ mountPath : /var/run/secrets/slack-api-token
113
+ readOnly : true
103
114
dnsPolicy : ClusterFirst
104
115
restartPolicy : Always
105
116
serviceAccountName : ${JENKINS_SERVICE_NAME}
106
117
volumes :
107
118
- name : ${JENKINS_SERVICE_NAME}-data
108
119
persistentVolumeClaim :
109
120
claimName : ${JENKINS_SERVICE_NAME}
121
+ # DELTA: add a configmap -- it's defined in pipeline.yaml
122
+ - name : ${JENKINS_SERVICE_NAME}-cfg
123
+ configMap :
124
+ name : jenkins-cfg
125
+ # DELTA: add the Slack token
126
+ - name : slack-token
127
+ secret :
128
+ secretName : slack-api-token
129
+ optional : true
110
130
triggers :
111
131
- imageChangeParams :
112
132
automatic : true
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ parameters:
44
44
- description : Whether to use KVM device plugin or legacy OCI KVM hook
45
45
name : KVM_SELECTOR
46
46
value : kvm-device-plugin
47
+ - description : Slack domain on which to post build status updates
48
+ name : SLACK_DOMAIN
49
+ value : coreos
50
+ - description : Slack channel on which to post build status updates
51
+ name : SLACK_CHANNEL
52
+ value : jenkins-coreos
47
53
48
54
objects :
49
55
@@ -123,6 +129,34 @@ objects:
123
129
importPolicy :
124
130
scheduled : true
125
131
132
+ # ## JENKINS CONFIGURATION ###
133
+
134
+ # this uses the configuration-as-code plugin:
135
+ # https://github.com/jenkinsci/configuration-as-code-plugin
136
+ - apiVersion : v1
137
+ kind : ConfigMap
138
+ metadata :
139
+ name : jenkins-cfg
140
+ annotations :
141
+ coreos.com/deploy-default : " true"
142
+ data :
143
+ jenkins.yaml : |
144
+ credentials:
145
+ system:
146
+ domainCredentials:
147
+ - credentials:
148
+ - string:
149
+ scope: GLOBAL
150
+ id: slack-token
151
+ secret: /var/run/secrets/slack-api-token/token
152
+ description: Slack API token
153
+ unclassified:
154
+ slackNotifier:
155
+ teamDomain: ${SLACK_DOMAIN}
156
+ tokenCredentialId: slack-token
157
+ room: "#${SLACK_CHANNEL}"
158
+
159
+
126
160
# ## COREOS-ASSEMBLER ###
127
161
128
162
# keep a local copy of coreos-assembler so we're not constantly pulling it
You can’t perform that action at this time.
0 commit comments