xOpsDemo/Jenkinsfile

50 lines
1.7 KiB
Groovy

pipeline {
agent {
label 'terraform-slave'
}
parameters {
string(name: 'DEMO NAME', defaultValue: 'demo', description: 'Enter the name of the demo')
}
// environment {
// //KUBECONFIG = credentials('kubernetes-config')
// }
stages {
// stage('test') {
// steps {
// sh 'python --version'
// }
// }
stage('TF Plan') {
// agent {
// docker {
// image 'hashicorp/terraform:latest'
// // Run the container on the node specified at the
// // top-level of the Pipeline, in the same workspace,
// // rather than on a new node entirely:
// args '--entrypoint="" -u root -v /opt/jenkins/.aws:/root/.aws'
// }
// }
steps {
container('terraform') {
withCredentials([[
$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: "f89b3f7d-23ec-42b9-9687-e4acf01d7507",
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
sh 'terraform version'
sh 'terraform init'
//sh 'terraform apply -auto-approve'
}
}
}
}
// stage('Deploy Helm chart') {
// steps {
// sh "helm install ingress-nginx ./deploy/charts/ingress-nginx --namespace ingress-nginx --set controller.publishService.enabled=true --set controller.service.loadBalancerIP=${env.LB_IP}"
// }
// }
}
}