forked from Intellipaat-Training/Shark-Secure-Pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStage2
39 lines (35 loc) · 1.26 KB
/
Stage2
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
pipeline {
agent any
stages {
stage('Use Local File') {
steps {
// Copy the file from the local system to the workspace
bat 'copy "C:\\Users\\Dell\\AppData\\Local\\Jenkins\\.jenkins\\workspace\\Test\\main.tf" .'
}
}
stage('Terraform Init') {
steps {
// Initialize Terraform configuration
bat '"C:\\Users\\Dell\\Downloads\\terraform_1.7.4_windows_386\\terraform.exe" init'
}
}
stage('Terraform Validate') {
steps {
// Validate Terraform configuration
bat '"C:\\Users\\Dell\\Downloads\\terraform_1.7.4_windows_386\\terraform.exe" validate'
}
}
stage('Terraform Plan') {
steps {
// Plan Terraform changes
bat '"C:\\Users\\Dell\\Downloads\\terraform_1.7.4_windows_386\\terraform.exe" plan -out=tfplan'
}
}
stage('Terraform Apply') {
steps {
// Apply Terraform changes
bat '"C:\\Users\\Dell\\Downloads\\terraform_1.7.4_windows_386\\terraform.exe" apply -auto-approve tfplan'
}
}
}
}