-
Notifications
You must be signed in to change notification settings - Fork 43
/
Jenkinsfile
61 lines (60 loc) · 2.32 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@Library('aqua-pipeline-lib@master')_
pipeline {
agent { label 'azure_slaves' }
options {
ansiColor('xterm')
timestamps()
skipStagesAfterUnstable()
skipDefaultCheckout()
buildDiscarder(logRotator(daysToKeepStr: '7'))
}
environment {
AWS_ACCESS_KEY_ID = credentials('svc_team_1_aws_access_key_id')
AWS_SECRET_ACCESS_KEY = credentials('svc_team_1_aws_secret_access_key')
AWS_REGION = "us-west-2"
}
stages {
stage('Checkout') {
steps {
script {
deployment.clone branch: "master"
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions: [[$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [[path: 'cloudformation/']]],
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'cloudformation']],
userRemoteConfigs: scm.userRemoteConfigs
])
dir("cloudformation"){
sh "mv cloudformation/* . && rm -rf cloudformation"
}
}
}
}
stage("Create Runs") {
steps {
script {
def deploymentImage = docker.build("deployment-image", "-f Dockerfile-cloudformation .")
deploymentImage.inside("-u root") {
log.info "Installing aqaua-deployment python package"
sh """
aws codeartifact login --tool pip --repository deployment --domain aqua-deployment --domain-owner 172746256356
pip install aqua-deployment
"""
log.info "Finished to install aqaua-deployment python package"
cloudformation.run publish: false
}
}
}
}
}
post {
always {
script {
cleanWs()
// notifyFullJobDetailes subject: "${env.JOB_NAME} Pipeline | ${currentBuild.result}", emails: userEmail
}
}
}
}