-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
30 lines (30 loc) · 931 Bytes
/
Jenkinsfile
File metadata and controls
30 lines (30 loc) · 931 Bytes
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
pipeline {
agent none
triggers {
cron('H 1 * * *')
pollSCM('*/5 * * * *')
}
stages {
stage('Validate') {
agent { docker 'hashicorp/packer:full' }
steps {
echo 'Validating Machine Image Definition'
sh 'packer validate packer.json'
}
}
stage('Build') {
agent { docker 'hashicorp/packer:full' }
environment {
CI_AWS_KEYS = credentials('CI_AWS_KEYS')
AWS_ACCESS_KEY_ID = "${CI_AWS_KEYS_USR}"
AWS_SECRET_ACCESS_KEY = "${CI_AWS_KEYS_PSW}"
}
steps {
echo 'Build Machine Image'
sh 'packer build -color=false packer.json'
archiveArtifacts 'packer-manifest.json'
stash name: 'build-manifest', includes: 'packer-manifest.json'
}
}
}
}