-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcasc.yaml
63 lines (57 loc) · 1.91 KB
/
casc.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
jenkins:
globalNodeProperties:
- envVars:
env:
- key: "SLACK_API_KEY"
value: "${SLACK_API_KEY}"
- key: "GITHUB_TOKEN"
value: "${GITHUB_TOKEN}"
- key: "CONTAINER_REGISTRY"
value: "${CONTAINER_REGISTRY}"
- key: "DOCKERHUB_USERNAME"
value: "${DOCKERHUB_USERNAME}"
- key: "DOCKERHUB_PASSWORD"
value: "${DOCKERHUB_PASSWORD}"
- key: "PUSHBULLET_API_KEY"
value: "${PUSHBULLET_API_KEY}"
systemMessage: "Milady can stay irrational longer than Jenkins can stay solvent\n\n"
numExecutors: 5
scmCheckoutRetryCount: 2
mode: NORMAL
securityRealm:
local:
allowsSignup: false
users:
- id: ${JENKINS_ADMIN_ID}
password: ${JENKINS_ADMIN_PASSWORD}
authorizationStrategy:
globalMatrix:
permissions:
- "Overall/Administer:admin"
- "Overall/Read:authenticated"
remotingSecurity:
enabled: true
security:
queueItemAuthenticator:
authenticators:
- global:
strategy: triggeringUsersAuthorizationStrategy
groovy:
- script: >
import hudson.model.User;
import jenkins.security.ApiTokenProperty;
import groovy.json.JsonOutput;
import java.io.OutputStreamWriter;
//String command = "/bin/sh -c 'caddy run --config /etc/caddy/Caddyfile &'"
//def proc = command.execute()
//proc.waitFor()
//println "Output: ${proc.in.text}"
//println "Error: ${proc.err.text}"
def token = System.getenv("API_TOKEN");
// Get the user and ApiTokenProperty;
def user = User.get('admin');
def apiTokenProperty = user.getProperty(ApiTokenProperty.class);
// Generate new fixed token
def result = apiTokenProperty.tokenStore.addFixedNewToken("admin-token", token);
// Log the token (this is sensitive information, be careful);
println("Token: " + result.plainValue);