-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathjenkins-parameter
56 lines (36 loc) · 1.39 KB
/
jenkins-parameter
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
# https://stackoverflow.com/questions/59611606/jenkins-pipeline-passing-parameter-as-shell-script-argument
# https://www.youtube.com/watch?v=jBAaxv49_tM&ab_channel=AutomationStepbyStep-RaghavPal
pipeline{
agent any
parameters {
string(defaultValue: '', description: '', name: 'AMI')
}
environment {
TF_VAR_rds_postgres_username = credentials('TF_VAR_rds_postgres_username')
TF_VAR_rds_postgres_password = credentials('TF_VAR_rds_postgres_password')
}
stages{
stage('SCM Checkout'){
steps{
git branch: 'staging-deployment', url: 'ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/cloudgeeksca'
}
}
stage('Deploy BackEnd With Existing AMI'){
steps{
sh '''
cd sentimeter/environment/staging/Build-Deploy/
echo 'Deploy Backend with Existing AMI'
export TF_VAR_rds_postgres_username
export TF_VAR_rds_postgres_password
bash ./DeployBackEnd.sh "$AMI"
'''
}
}
}
}
# Code Commit Configurations
cd ~/.ssh
vim config
Host git-codecommit.*.amazonaws.com
User PABCDEFGHI
IdentityFile ~/.ssh/id_rsa