Created
June 18, 2019 16:48
-
-
Save lupupaulsv/cd9fed228d03e072898f9adfe6fd3e16 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 { | |
environment { | |
LANG = "C.UTF-8" | |
} | |
agent { | |
docker { | |
image 'centos:7' | |
args '-p 2222:22 -v --privileged ' | |
} | |
} | |
stages { | |
stage('Prepare') { | |
steps { | |
sh """ | |
#!/bin/bash -xel | |
yum install openssh-server -y | |
/usr/bin/ssh-keygen -A | |
/usr/sbin/sshd | |
echo 'root:test' | chpasswd | |
yum install -y epel-release | |
yum install -y python python-pip | |
pip install awscli | |
""" | |
} | |
} | |
stage("RunAutomation") { | |
steps { | |
sh """ | |
bash automation.sh | |
tralala | |
""" | |
} | |
} | |
} | |
post { | |
failure { | |
input 'Build failed, SSH is open at port: 2222' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment