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
void setBuildStatus(String message, String context, String state) { | |
// add a Github access token as a global 'secret text' credential on Jenkins with the id 'github-commit-status-token' | |
withCredentials([string(credentialsId: 'github-commit-status-token', variable: 'TOKEN')]) { | |
// 'set -x' for debugging. Don't worry the access token won't be actually logged | |
// Also, the sh command actually executed is not properly logged, it will be further escaped when written to the log | |
sh """ | |
set -x | |
curl \"https://api.github.com/repos/org/repo/statuses/$GIT_COMMIT?access_token=$TOKEN\" \ | |
-H \"Content-Type: application/json\" \ | |
-X POST \ |
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
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda | |
# and can be used for developing/testing Python 3.6 Lambda functions | |
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python | |
# This is required because Amazon Linux does not come with Python 3.6 pre-installed | |
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime | |
# The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm) | |
# running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3 | |
# and was developed with the help of AWS Support |