Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View flomotlik's full-sized avatar

Florian Motlik flomotlik

View GitHub Profile
Your privacy is critically important to us. At Codeship we have a few fundamental principles:
We don’t ask you for personal information unless we truly need it. (We can’t stand services that ask you for things like your gender or income level for no apparent reason.)
We don’t share your personal information with anyone except to comply with the law, develop our products, or protect our rights.
We don’t store personal information on our servers unless required for the on-going operation of one of our services.
In our products, we aim to make it as simple as possible for you to control what’s visible to the public, seen by search engines, kept private, and permanently deleted.
Below is our privacy policy which incorporates these goals:
@flomotlik
flomotlik / deploy_branch.rb
Created July 14, 2014 14:24
Create new Heroku App for branch
#!/usr/bin/env ruby
require "open3"
git_branch = ENV['CI_BRANCH'] || `git rev-parse --abbrev-ref HEAD`
@app_name = "csqa-#{git_branch[0..24].gsub(/\W/, '-')}"
def exec command
Open3.popen2e(command){ |stdin, stdout_err, wait_thr|
while line = stdout_err.gets
@flomotlik
flomotlik / use_mongo_2.4
Last active August 29, 2015 14:01
Run Mongo 2.4
#Change the path to the downloaded file here to update the mongo version
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.10.tgz
tar xvzf mongo*
cd mongo*
mkdir ~/mongodb
# You can change the parameters mongodb starts with here
nohup bash -c "./bin/mongod --port 27018 --dbpath ~/mongodb 2>&1 &" && sleep 6; cat nohup.out
cd ~/clone
@flomotlik
flomotlik / deploy_if.sh
Created April 26, 2014 17:15
Check for branch name with Regex
#!/bin/bash
echo $COMMIT_BRANCH | grep -E "^(\d\.?)+$" > /dev/null
match_result=$?
if [ "$match_result" -eq "0" ]
then
# Exit if any command fails only when the deployment runs
set -e
@flomotlik
flomotlik / gist:11207875
Created April 23, 2014 09:00
NGrok setup
cd ~/bin
wget https://dl.ngrok.com/linux_386/ngrok.zip
unzip ngrok*
@flomotlik
flomotlik / update_firefox
Last active January 10, 2017 17:23
Update Firefox version on Codeship
#!/bin/bash
# Add the following commands to your setup commands to update firefox
# git clone https://gist.github.com/9525133.git update_firefox
# bash ./update_firefox/update_firefox 28
# firefox --version
set -e
if [ -z "$1" ]; then
@flomotlik
flomotlik / install_go.sh
Created February 28, 2014 11:44
Install Go 1.2
cd
rm -fr go
wget http://go.googlecode.com/files/go1.2.linux-amd64.tar.gz
tar xfz go1.2.linux-amd64.tar.gz
cd clone
go get github.com/kr/godep
@flomotlik
flomotlik / elasticinstall.sh
Created February 27, 2014 11:15
ElasticSearch install
cd
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.zip
unzip elasticsearch*.zip
cd elasticsearch*
bin/plugin -install elasticsearch/elasticsearch-analysis-phonetic/2.0.0.RC1
# Make sure to use the exact parameters you want for elasticsearch and give it enough sleep time to properly start up
nohup bash -c "./bin/elasticsearch 2>&1 &" && sleep 5; cat nohup.out
cd ~/clone
*) Ask them if they ever spend time manually testing features that have been out for a while
*) Ask them if they ever shipped new features that broke old features
*) Ask them if they are happy with this?
*) Ask them if they think it makes them and their company successful or if they think they need to change
You can take a couple of points from the business case blogpost about why to do CI here:
http://blog.codeship.io/2013/04/11/a-business-case-for-continuous-integration.html
Testing is about making sure your users can walk through the most important parts of your system and use your product. When testing you should be thinking about your users first and how they interact with your system, not how you can get 100% unit test coverage (which is a nonsense metric)
@flomotlik
flomotlik / Hooks
Created October 31, 2013 19:45
Webhooks on Codeship
If you only want to send a hook for successful builds at the end of your test commands add something like:
wget YOUR_URL
and it will send the hook whenever your build passes. You can run any command there and aren't limited to wget or anything at all.
2) Send a hook for a failed command and fail the build:
SOME_COMMAND || bash -c "ANY_COMMAND_TO_SEND_HOOK; exit 1"