-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
46 lines (37 loc) · 1.2 KB
/
Jenkinsfile
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
library(
identifier: '[email protected]',
retriever: modernSCM([$class: 'GitSCMSource',
remote: 'https://github.com/SmartColumbusOS/pipeline-lib',
credentialsId: 'jenkins-github-user'])
)
properties(
[
pipelineTriggers([scos.dailyBuildTrigger()]),
disableConcurrentBuilds(),
]
)
node('infrastructure') { ansiColor('xterm') { sshagent(["k8s-no-pass", "GitHub"]) { withCredentials([
[
$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: 'aws_jenkins_user',
variable: 'AWS_ACCESS_KEY_ID'
],
sshUserPrivateKey(
credentialsId: "k8s-no-pass",
keyFileVariable: 'keyfile'
)
]) {
String publicKey
scos.doCheckoutStage()
stage('Setup SSH keys') {
publicKey = sh(returnStdout: true, script: "ssh-keygen -y -f ${keyfile}").trim()
}
def terraform = scos.terraform('alm')
stage("Plan ALM") {
terraform.init()
def overrides = [:]
overrides << [ 'key_pair_public_key': publicKey ]
terraform.plan(terraform.defaultVarFile, overrides)
archiveArtifacts artifacts: 'plan-*.txt', allowEmptyArchive: false
}
}}}}