Skip to content

Instantly share code, notes, and snippets.

@arslan70
Created July 14, 2019 09:53
Show Gist options
  • Save arslan70/c50f12ea78b7116150b6098dd74c8d6f to your computer and use it in GitHub Desktop.
Save arslan70/c50f12ea78b7116150b6098dd74c8d6f to your computer and use it in GitHub Desktop.
pipeline {
stages {
stage ('InstallDependencies') {
steps {
script{
sh '''
sudo pip install molecule==2.20.1 --ignore-installed
sudo pip install boto3==1.9.152
sudo pip install ansible==2.7.5 --force-reinstall
'''
}
}
}
stage ('Checkout') {
steps{
checkout scm
}
}
stage (TestAllPlaybooks){
parallel {
stage (‘TestRole1’) {
steps{
dir('roles/role1'){
script {
sh '''
molecule create
molecule converge
molecule verify
'''
}
}
}
post {
always {
dir('roles/role1’){
script {
sh '''
molecule destroy
'''
}
}
}
}
}
stage ('TestRole2’) {
steps{
dir('roles/role2’){
script {
sh '''
molecule create
molecule converge
molecule verify
'''
}
}
}
post {
always {
dir('roles/role2’){
script {
sh '''
molecule destroy
'''
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment