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 \
#!/bin/sh
# Install a Hugo on Codeship, https://gohugo.io/
#
# You can either add this here, or configure them on the environment tab of your
# project settings.
HUGO_VERSION="0.14"
HUGO_DIR=${HUGO_DIR:="$HOME/hugo"}
set -e
CACHED_DOWNLOAD="${HOME}/cache/hugo_${HUGO_VERSION}_linux_amd64.tar.gz"
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"
@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'
#!/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]"
#!/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=""
@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 / 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 / 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}"