Created
July 14, 2019 09:53
-
-
Save arslan70/c50f12ea78b7116150b6098dd74c8d6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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