Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupupaulsv/cd9fed228d03e072898f9adfe6fd3e16 to your computer and use it in GitHub Desktop.
Save lupupaulsv/cd9fed228d03e072898f9adfe6fd3e16 to your computer and use it in GitHub Desktop.
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