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
jekyll-crosspost_to_medium: | |
enabled: true | |
cache: .jekyll-crosspost_to_medium | |
status: public | |
license: public-domain | |
backdate: true |
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
jekyll-crosspost_to_medium: | |
enabled: true | |
cache: .jekyll-crosspost_to_medium | |
status: public | |
license: public-domain | |
backdate: true |
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
cd $HOME | |
wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz | |
tar -zxvf go1.8.3.linux-amd64.tar.gz | |
mv go go1.8.3 | |
ln -s go1.8.3 go | |
echo "Done. You need to add $HOME/go/bin to $PATH" |
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
git clone [email protected]:hashicorp/terraform.git | |
cd terraform | |
docker run --rm -v $(pwd):/go/src/github.com/hashicorp/terraform -w /go/src/github.com/hashicorp/terraform -e XC_OS=linux -e XC_ARCH=amd64 golang:latest bash -c "apt-get update && apt-get install -y zip && make bin" | |
bin/terraform -v |
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
NAME=dockercoins | |
IMAGES=$(aws --region ${REGION} ecr list-images --repository-name ${NAME} --output json) | |
COMMIT_ID=$(git log --pretty=format:%H -1 . ) | |
IMAGES_TEST_COMMIT_ID=$(echo $IMAGES | jq '.imageIds[] | .imageTag | select (.!=null) | test("$COMMIT_ID")') | |
if [[ ! ${IMAGES_TEST_COMMIT_ID} == *true* ]]; then | |
echo "Build and Push to ECR" | |
fi |
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
curl -v -X POST "http://admin:[email protected]:8080/job/seed-job/buildWithParameters?GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" |
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
node('master'){ | |
stage('Install Bats'){ | |
sh """ | |
if [ ! -d bats ]; then | |
git clone https://github.com/sstephenson/bats.git | |
fi | |
if [ ! -f ~/.local/bin/bats ]; then | |
cd bats/ | |
./install.sh $HOME/.local |
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
// Receive a json and returns a groovy map | |
def _dict_from_json(json){ | |
json = json.replaceAll("\\{", "[") | |
json = json.replaceAll("\\}", "]") | |
def map = evaluate(json) | |
return map | |
} | |
def _aws_assume_role(arn, session_name){ | |
def _script = "aws sts assume-role --role-session-name ${session_name} --role-arn ${arn}" |
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
#!/bin/bash | |
# | |
# Ansible role test shim. | |
# | |
# Usage: [OPTIONS] ./tests/test.sh | |
# - distro: a supported Docker distro version (default = "centos7") | |
# - playbook: a playbook in the tests directory (default = "test.yml") | |
# - cleanup: whether to remove the Docker container (default = true) | |
# - container_id: the --name to set for the container (default = timestamp) |
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
$ aws --region us-west-1 ecr describe-repositories | jq -r '.repositories | .[] | .repositoryName | test("^nginx$")' | |
false | |
false | |
false | |
false | |
true |