forked from bluesentry/bucket-antivirus-function
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (56 loc) · 1.56 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
pipeline {
agent {
docker {
alwaysPull true
args "--user root:root"
image "sre-tooling:1.0.0"
label "worker"
registryCredentialsId "ecr:us-east-1:Jenkins-AWS-Key"
registryUrl "https://393224622068.dkr.ecr.us-east-1.amazonaws.com"
}
}
options {
ansiColor("xterm")
buildDiscarder(logRotator(numToKeepStr: '15'))
}
parameters {
choice(
name: "ENV",
choices: [
"dev",
"staging",
"prod"
],
description: "Env to deploy the scanner function to"
)
choice(
name: "ACCOUNT",
choices: [
"direct",
"cleardata"
],
description: "AWS account to deploy the scanner function to"
)
}
stages {
stage ("build") {
steps {
sshagent(credentials : ["Jenkins-SSH"]) {
sh 'git clone "[email protected]:NavigatingCancer/bucket-antivirus-function.git" --single-branch --branch "SRE-3926-s3-clamscan-poc" "src"'
dir ("src"){
sh "make all"
sh "cp ./build/lambda.zip /tmp/lambda.zip"
}
}
}
}
stage ("deploy") {
steps {
dir("src/infrastructure/${env.ACCOUNT}/${env.ENV}/s3-clamscan"){
sh "terragrunt plan -out tg.plan"
sh "terragrunt apply tg.plan"
}
}
}
}
}