xOpsDemo/Jenkinsfile

51 lines
2.1 KiB
Groovy

properties([parameters([[$class: 'ChoiceParameter', choiceType: 'PT_SINGLE_SELECT', filterLength: 1, filterable: false, name: 'Demo Name', randomName: 'choice-parameter-514033088473410', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: false, script: ''], script: [classpath: [], oldScript: '', sandbox: false, script: '']]]])])
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}"
// }
// }
}
}