Skip to content

Instantly share code, notes, and snippets.

View mlocher's full-sized avatar

Marko Locher mlocher

View GitHub Profile
#!/bin/sh
L="${HOME}/bin/flynn" && curl -sL -A "`uname -sp`" https://dl.flynn.io/cli | zcat >$L && chmod +x $L
@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 / deploy_engineyard.sh
Created March 20, 2015 13:14
EngineYard deployment
#!/bin/sh
gem install engineyard --no-ri --no-rdoc
# --migrate / --no-migrate is specified as well
ey deploy -e "${environment}" -R "${COMMIT_ID" --api-token "${api_token}"
check_url "${url}"
@mlocher
mlocher / deploy_heroku.sh
Last active March 30, 2023 09:58
Heroku deployment
#!/bin/sh
# This codeship custom script depends on:
# - API_KEY env var from Heroku
# - STAGING_APP_NAME
# - STAGING_APP_URL
set -e
export HEROKU_API_KEY="${API_KEY}"
# Turn on Heroku maintenance mode
@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
#!/bin/sh
set -e
# either set them in the script or set those as environment variables
# the version must be unique for each deployment and should probably
# include at least the commit hash
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""
AWS_DEFAULT_REGION=""
AWS_S3_BUCKET=""

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
@mlocher
mlocher / github_repository_name.sh
Created June 24, 2015 10:15
Get GitHub repository name from a remote URL
#!/bin/bash
git config --get remote.origin.url | sed -re 's|^https?://github.com/(.*).git$|\1|g'
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"