-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy paths3_Jenkinsfile
More file actions
35 lines (31 loc) · 1002 Bytes
/
s3_Jenkinsfile
File metadata and controls
35 lines (31 loc) · 1002 Bytes
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
pipeline {
agent any
parameters {
string(name: 'BUCKET_NAME', defaultValue: 'my-custom-bucket-name-0718', description: 'Name of the S3 bucket')
}
environment {
AWS_DEFAULT_REGION = 'us-east-1'
STACK_NAME = 'example-s3-stack'
TEMPLATE_FILE = '01_s3cft.yml'
}
stages {
stage('Checkout Repository') {
steps {
git branch: 'main', url: 'https://github.com/riteshbehal/devopscourse.git'
}
}
stage('Deploy CloudFormation Stack') {
steps {
script {
sh """
aws cloudformation deploy \
--stack-name ${STACK_NAME} \
--template-file ${TEMPLATE_FILE} \
--region ${AWS_DEFAULT_REGION} \
--parameter-overrides BucketName=${params.BUCKET_NAME}
"""
}
}
}
}
}