forked from bazelbuild/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
56 lines (50 loc) · 2.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
47
48
49
50
51
52
53
54
55
56
#!groovy
@Library('shared-lib')_
import org.lab.*
//properties([
// parameters([
// stringParam(name: 'folderName', defaultValue: '', description: 'environment folder name')
// ])
//])
def containers = [
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave', ttyEnabled: true)
]
def label = "jen-agent-${UUID.randomUUID().toString()}"
def config = "staging.properties"
String folderName = params.folderName
podTemplate(label: label, containers: containers) {
node(label) {
stage('🔦 code checkout') {
checkout scm
}
stage('setting env') {
def arn = "arn:aws:iam::123456789012:role/application_abc/component_xyz/RDSAccess"
//loadEnv(config, folderName)
//whitelist = ["folders"]
//blacklist = ["tutorial"]
//foldersChanged = []
//def changeLogSets = currentBuild.changeSets
//for (changeLogSet in changeLogSets) {
// for (entry in changeLogSet.items) {
// //println "${entry.commitId} by ${entry.author} on ${new Date(entry.timestamp)}: ${entry.msg}"
// for (file in entry.affectedFiles) {
// if ((file.editType.name == 'add' || file.editType.name == 'edit' || file.editType.name == 'delete') && whitelist.contains(file.path.tokenize('/')[0]) && !blacklist.contains(file.path.tokenize('/')[0])) {
// foldersChanged += "${file.path}".tokenize('/')[0] + "/" + "${file.path}".tokenize('/')[1]
// foldersChanged += "${file.path}".substring(0, "${file.path}".lastIndexOf("/"))
// println "${foldersChanged}"
//echo " ${file.editType.name} ${file.path}".tokenize('/')[0]
// }
// }
// }
sh """
mkdir ~/.aws
printf "%s\n%s\n[profile sandbox]\nsource_profile = default\nrole_arn = ${arn}" >> ~/.aws/credentials
"""
sh "cat ~/.aws/credentials"
}
}
//stage('Install') {
// sh "echo ${BAZEL_TOOLS}"
// sh "echo ${ANDROID_HOME}"
//}
}