Skip to content

Instantly share code, notes, and snippets.

View rcbop's full-sized avatar

Rogerio Peixoto rcbop

  • Spain
View GitHub Profile
Code:
* features/support/env.rb
-------------------------------------------------------------------------
>> TESTING IOS DEVICE CONNECTION
curl http://10.0.3.242:37265/version
false
>> ENVIRONMENT VARIABLES
RBENV_VERSION=2.1.1
SHELL=/bin/bash
DEVICE_ENDPOINT=http://10.0.3.242:37265
@rcbop
rcbop / 0_reuse_code.js
Created April 5, 2016 13:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rcbop
rcbop / README.md
Created May 30, 2017 20:03 — forked from escapedcat/README.md
Tutorial: Cordova iOS build with fastlane, match and Jenkins

Cordova CI with Jenkins for iOS apps

Inspired by CI server on Mac OS for iOS using GitLab and Fastlane by @v_shevchyk we decided to write down our approach. This will be extended and improved over time.

So you want to deploy your Cordova app, but you hate opening xcode manually to archive and export and sign and cry? Try this. By this we mean we try to explain how to create the following CI (Jenkins) setup:

  • Build Cordova app
  • Create & sign your ipa file
  • Upload to HockeyApp (for Enterprise distribution)
@rcbop
rcbop / delete-eb-old-versions.sh
Created June 15, 2017 21:09
Delete AWS elastic beanstalk versions older than given arbitrary number
#!/bin/bash
# mantainer rogerio.c.peixoto (rcbpeixoto@gmail.com)
# delete old application versions preserving most recent ones
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
MAGENTA='\033[35m'
NC='\033[0m'
@rcbop
rcbop / delete-obsolete-ecr-images.sh
Last active June 18, 2017 03:59
Removes old aws ecr docker images that are not tagged keeping the latests given number (default 5)
#!/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'
#!/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
#!/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
@rcbop
rcbop / install-ansible.sh
Created December 27, 2017 22:37
try to detect linux distro and install ansible, at last if does not succeed tries to install using git
#!/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"
@rcbop
rcbop / cleanup-s3-artifacts.sh
Created January 25, 2018 20:34
Cleanup s3 bucket from build packages and keep only the last 30 items of each project Raw
#!/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}"; }
@rcbop
rcbop / show-cloudfront-configuration.sh
Created February 5, 2018 23:14
Jq query to find cloudfront distribution by substring of comments sub-element
aws cloudfront list-distributions --profile my-profile --output json | jq '.DistributionList.Items[] | select(.Comment | contains("my-project-key"))'