forked from arunx2/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
78 lines (70 loc) · 2.37 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
pipeline {
environment {
// GIT_URL = 'https://github.com/mikaylathompson/opensearch-migrations.git'
GIT_URL = 'https://github.com/opensearch-project/opensearch-migrations.git'
GIT_BRANCH = 'main'
STAGE = 'aws-integ'
}
agent any
parameters {
booleanParam(name: 'USE_LOCAL_WORKSPACE', defaultValue: false, description: 'Use local workspace for the build')
string(name: 'BRANCH_NAME', defaultValue: 'main', description: 'Branch to build from')
}
stages {
stage('Checkout') {
agent any
steps {
script {
if (params.USE_LOCAL_WORKSPACE) {
sh "/copyGitTrackedFiles.sh /opensearch-migrations-src ."
} else {
git branch: "${params.BRANCH_NAME}", url: "${env.GIT_URL}"
}
}
}
}
stage('Test Caller Identity') {
agent any
steps {
sh 'aws sts get-caller-identity'
}
}
stage('Build') {
agent any
steps {
timeout(time: 1, unit: 'HOURS') {
dir('TrafficCapture') {
sh './gradlew build -x test'
}
}
}
}
stage('Deploy') {
steps {
dir('test') {
sh 'sudo usermod -aG docker $USER'
sh 'sudo newgrp docker'
sh "sudo ./awsE2ESolutionSetup.sh --stage ${env.STAGE} --migrations-git-url ${env.GIT_URL} --migrations-git-branch ${env.GIT_BRANCH}"
}
}
}
stage('Integ Tests') {
steps {
dir('test') {
script {
def time = new Date().getTime()
def uniqueId = "integ_min_${time}_${currentBuild.number}"
sh "sudo ./awsRunIntegTests.sh --stage ${env.STAGE} --migrations-git-url ${env.GIT_URL} --migrations-git-branch ${env.GIT_BRANCH} --unique-id ${uniqueId}"
}
}
}
}
}
// post {
// always {
// dir('test') {
// sh "sudo ./awsE2ESolutionSetup.sh --stage ${env.STAGE} --run-post-actions"
// }
// }
// }
}