-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
35 lines (30 loc) · 1.22 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
library(
identifier: '[email protected]',
retriever: modernSCM([$class: 'GitSCMSource',
remote: 'https://github.com/SmartColumbusOS/pipeline-lib',
credentialsId: 'jenkins-github-user'])
)
schedule = scos.changeset.isMaster ? 'H * * * *' : ''
properties([pipelineTriggers([cron(schedule)])])
def image
node('infrastructure') {
ansiColor('xterm') {
scos.doCheckoutStage()
stage('Build') {
withCredentials([string(credentialsId: 'hex-read', variable: 'HEX_TOKEN')]) {
image = docker.build("scos_system_test:${env.GIT_COMMIT_HASH}", '--build-arg HEX_TOKEN=$HEX_TOKEN .')
}
}
stage('Test') {
withCredentials([string(credentialsId: 'hex-read', variable: 'HEX_TOKEN'), [$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'aws_jenkins_user', variable: 'AWS_ACCESS_KEY_ID']]) {
sh('''
export HOST_IP=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)
mix local.hex --force
mix local.rebar --force
mix deps.get
MIX_ENV=system mix test
''')
}
}
}
}