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 | |
docker images --no-trunc --format '{{.ID}} {{.CreatedSince}}' | grep months | awk '$2 > 3 { print $1 }' | xargs -r docker rmi |
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 | |
#/ Description: | |
#/ Creates a docker swarm ec2 cluster | |
#/ Examples: | |
#/ DEBUG=true ./create-ec2-swarm-cluster.sh (Enable debug messages) | |
#/ NO_COLORS=true ./create-ec2-swarm-cluster.sh (Disable colors) | |
#/ -------------------------------------------------------------------------------- | |
#/ Author: Rogério Castelo Branco Peixoto (rcbpeixoto@gmail.com) | |
#/ -------------------------------------------------------------------------------- | |
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; } |
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 cloudfront list-distributions --profile my-profile --output json | jq '.DistributionList.Items[] | select(.Comment | contains("my-project-key"))' |
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 | |
AWS_BUCKET_NAME="<insert_bucket>" | |
AWS_BUCKET_REGION="<insert_region>" | |
AWS_KEY="<insert_key>" | |
AWS_SECRET="<insert_secret>" | |
MAX_COUNT_TO_KEEP=30 | |
PROFILE="<insert_profile>" | |
log() { echo -e "["$(date "+%Y%m%dT%H%M%S")"] $1"; } | |
echo_blu(){ log "${BLUE}$1${NC}"; } |
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 | |
#/ Usage: ./install-ansible.sh | |
#/ Description: AWESOME INSTALL SCRIPT | |
#/ Author: Rogério Peixoto (rcbpeixoto@gmail.com) | |
#/ Options: | |
#/ --help: Display this help message | |
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; } | |
expr "$*" : ".*--help" > /dev/null && usage | |
echo "Using $TERM terminal" |
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
// ########################################################################## | |
// # REST API jenkinsfile + oracle client | |
// ########################################################################## | |
// # Mantainer rcbpeixoto@gmail.com | |
// ########################################################################## | |
env.DOCKER_TAG="${params.BRANCH}" | |
env.BRANCH="${params.BRANCH}" | |
env.DOCKER_IMAGE="${env.JOB_BASE_NAME}" | |
env.DOCKER_NAME="${env.DOCKER_IMAGE}:${env.DOCKER_TAG}" | |
env.AWS_ENV="${env.DOCKER_IMAGE}-${env.DOCKER_TAG}" |
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 | |
projType=$1 | |
projectName=$2 | |
buildNumber=$3 | |
if [[ "$projectName" == "" && "$buildNumber" == "" && "$projType" == "" ]]; then | |
echo Need to provide project type, name and build number | |
exit 1 | |
fi | |
echo $projectName | |
echo $buildNumber |
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 | |
which jq 2>/dev/null || { echo >&2 "jq json processor is required but it's not installed. Aborting."; exit 1; } | |
if [[ ($FRONTEND_PROJECTS == "") || ($BUILD_NUMBER == "") || ($PACKAGE_API == "") || ($DELIVERY_PACKAGE_ENVIRONMENT == "" ) ]]; then | |
echo "ERROR missing arguments" && exit 1; | |
fi | |
rm -f manifest.json | |
rm -f manifest.json.tmp | |
rm -f webprojects.json.tmp |
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 | |
# removes old ecr images keeping the latests given number | |
# do not removes images with tag | |
# mantainer rogerio.c.peixoto (rcbpeixoto@gmail.com) | |
##################################################### | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[1;33m' | |
CYAN='\033[0;36m' | |
MAGENTA='\033[35m' |
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("${params.BUILD_AGENT}") { | |
stage('Dangling Containers') { | |
sh 'docker ps -q -f status=exited | xargs --no-run-if-empty docker rm' | |
} | |
stage('Dangling Images') { | |
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi' | |
} | |