-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathJenkinsfile
More file actions
66 lines (59 loc) · 1.95 KB
/
Jenkinsfile
File metadata and controls
66 lines (59 loc) · 1.95 KB
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
def secrets = [
[path: 'insights-cicd/ephemeral-bot-svc-account', secretValues: [
[envVar: 'OC_LOGIN_TOKEN_DEV', vaultKey: 'oc-login-token-dev'],
[envVar: 'OC_LOGIN_SERVER_DEV', vaultKey: 'oc-login-server-dev'],
[envVar: 'OC_LOGIN_TOKEN', vaultKey: 'oc-login-token'],
[envVar: 'OC_LOGIN_SERVER', vaultKey: 'oc-login-server']]],
[path: 'app-sre/quay/cloudservices-push', secretValues: [
[envVar: 'QUAY_USER', vaultKey: 'user'],
[envVar: 'QUAY_TOKEN', vaultKey: 'token']]],
[path: 'insights-cicd/insightsdroid-github', secretValues: [
[envVar: 'GITHUB_TOKEN', vaultKey: 'token'],
[envVar: 'GITHUB_API_URL', vaultKey: 'mirror_url']]],
[path: 'insights-cicd/rh-registry-pull', secretValues: [
[envVar: 'RH_REGISTRY_USER', vaultKey: 'user'],
[envVar: 'RH_REGISTRY_TOKEN', vaultKey: 'token']]]
]
def configuration = [vaultUrl: params.VAULT_ADDRESS, vaultCredentialId: params.VAULT_CREDS_ID]
pipeline {
agent {
node {
label 'rhel8-spot'
}
}
options {
timestamps()
timeout(time: 150, unit: 'MINUTES')
}
environment {
APP_NAME = "ros"
}
stages {
stage('PR Check') {
when {
changeRequest()
}
steps {
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh 'bash pr_check.sh'
}
}
}
stage('Build and Deploy') {
when {
not { changeRequest() }
}
steps {
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh 'bash build_deploy.sh'
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'artifacts/**/*', fingerprint: true, allowEmptyArchive: true
cleanWs()
}
}
}