Skip to content

Instantly share code, notes, and snippets.

View mlocher's full-sized avatar

Marko Locher mlocher

View GitHub Profile
@mlocher
mlocher / install_elasticsearch.sh
Last active August 29, 2015 14:01 — forked from flomotlik/elasticinstall.sh
Install any ElasticSearch version on Codeship
#!/bin/bash
echo "Please see an updated version of this script available at "
echo "https://github.com/codeship/scripts/blob/master/packages/elasticsearch.sh"
VERSION="1.1.1"
PORT="9333"
PWD=`pwd`
mkdir -p ~/elasticsearch/
#!/bin/sh
# assumes a clean install on a fresh linux box.
# for use w/ codeship.io
set -e
set -u
# a reference to the cloned repository's path
PWD=`pwd`
METEOR_APP_PATH="$PWD/MeteorApp"
@mlocher
mlocher / deploy_meteor.sh
Last active August 29, 2015 14:06 — forked from bradvogel/deploy_production.sh
Deploy via Meteor
# This script is used to deploy a Meteor 0.9 project to Modulus.io hosting using CodeShip.
# Install Meteor.
curl https://install.meteor.com > ./install_meteor
sed -i'' -e 's/PREFIX=.*/PREFIX="$HOME"/g' ./install_meteor
chmod u+x ./install_meteor
./install_meteor
# Install Modulus.
npm install -g modulus
@mlocher
mlocher / install_gradle
Last active August 29, 2015 14:07 — forked from JMBattista/install_gradle
Install Gradle
#!/bin/bash
# Allows using Gradle 2.1 with http://codeship.io
GRADLE=gradle-2.1-bin
GRADLE_URL="https://services.gradle.org/distributions/$GRADLE.zip"
wget -N $GRADLE_URL
mkdir -p ~/gradle
unzip $GRADLE.zip -d ~
@mlocher
mlocher / post-merge
Last active August 29, 2015 14:07 — forked from hcurotta/post-merge
BitBucket post-merge hook
#!/bin/bash
branch_name=$(git symbolic-ref --short HEAD)
if [ "$branch_name" == 'dev' ] || [ "$branch_name" == 'staging' ]
then
git commit --allow-empty -m 'empty commit to trigger deployment'
fi
@mlocher
mlocher / random_tz.sh
Last active August 29, 2015 14:08 — forked from zenchild/random_tz.sh
Set a random timezone
TZ_SIGN=$( echo "+:-" | cut -d: -f $( shuf -i 1-2 -n 1 ) )
export TZ=UTC${TZ_SIGN}$( shuf -i 0-24 -n1 )
echo "Set TZ to: ${TZ}"
@mlocher
mlocher / codeship-to-shopify-theme-deploy
Last active June 21, 2018 16:25 — forked from hughker/codeship-to-shopify-theme-deploy.sh
Deploy a Shopify theme from Codeship
gem install shopify_theme
theme configure SHOPIFY_API_KEY SHOPIFY_API_PASSWORD SHOPIFY_STORE_URL SHOPIFY_THEME_ID
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $COMMIT_ID | xargs theme upload
git diff-tree -r --no-commit-id --name-only --diff-filter=D $COMMIT_ID | xargs theme remove
@mlocher
mlocher / notifier.py
Last active August 29, 2015 14:17 — forked from kfr2/notifier.py
"""
Codeship build notifications via OSX User Notifications.
Requirements:
* python-requests
* terminal-notifier
Environment settings:
* CODESHIP_API_KEY -- get it from https://codeship.com/user/edit
* CODESHIP_REPO_NAME -- the full name of the repository to watch

After migrating from heroku to dokku, we had to also chance codeship so we deploy to dokku. I followed the following steps to successfully deploy to dokku.

  1. Save the public key of the codeship project. It is found in Project Settings > General Settings.
  2. Copy the public key to a file /tmp/codeship_projectname.pub.
  3. Make sure when pasting, all the contents are in a single line and not multiple lines.
  4. Add the public key to dokku using the following command in console. Reference.
cat /tmp/codeship_projectname.pub | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]"
#!/bin/sh
# This codeship custom script depends on:
# - API_KEY env var from Heroku
# It uses the CI_COMMITTER_NAME value to determine which Heroku
# app to deploy to. Each developer has their own environment.
set -e
export HEROKU_API_KEY="${API_KEY}"
# default feature branch app