Skip to content

Instantly share code, notes, and snippets.

View mlocher's full-sized avatar

Marko Locher mlocher

View GitHub Profile
@mlocher
mlocher / Dockerfile
Last active September 21, 2017 12:39 — forked from krtierney/Dockerfile
Dockerfile best practices
FROM ruby:2.3.0
LABEL maintainer="Kaitlyn Tierney, kaitlyn@happybearsoftware.com"
ENV RAILS_ENV=test
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
nodejs \
cd /tmp
pwd
#Download Android SDK from Google and unzip it
wget http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz
tar zxvf android-sdk_r24.1.2-linux.tgz
rm android-sdk_r24.1.2-linux.tgz
#Set extracted SDK location to $PATH so we can use commands
export ANDROID_HOME="/tmp/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
#!/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

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]"
@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
@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 / 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 / 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 / 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 / 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