From 85e892688d7c847170272ca6d9935080884abe08 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 01:50:22 -0200 Subject: [PATCH 01/39] baseimage: Remove redundant packages from Dockerfile that are already installed by latest progrium/cedarish image --- CHANGELOG.md | 7 +++++++ Dockerfile | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da37f52..5afcc88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.3.0](https://github.com/fgrehm/devstep/compare/v0.2.0...master) (unreleased) + +BREAKING CHANGES: + + - Switched to the latest progrium/cedarish image which uses an unmodified Heroku + `cedar14.sh` base stack source. More info [here](https://github.com/progrium/cedarish/commit/71e2a4af8d300c94783720d13eac79d084a35a75) + ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) BREAKING CHANGES: diff --git a/Dockerfile b/Dockerfile index 4e95dd1..dc53b72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ - apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libreadline6-dev libyaml-dev libgdbm-dev libncurses5-dev libffi-dev libicu-dev --no-install-recommends && \ + apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libyaml-dev libgdbm-dev libffi-dev libicu-dev --no-install-recommends && \ apt-get install -y postgresql-client mysql-client --no-install-recommends && \ apt-get install -y software-properties-common bash-completion --no-install-recommends && \ echo "[client]\nprotocol=tcp\nuser=root" >> /.devstep/.my.cnf && \ From 18b861ede9a75714cc5dc338c6917c7dfb01dede Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 01:50:43 -0200 Subject: [PATCH 02/39] baseimage: Install libsqlite3-dev package --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dc53b72..d4d4aab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libyaml-dev libgdbm-dev libffi-dev libicu-dev --no-install-recommends && \ - apt-get install -y postgresql-client mysql-client --no-install-recommends && \ + apt-get install -y postgresql-client mysql-client libsqlite3-dev --no-install-recommends && \ apt-get install -y software-properties-common bash-completion --no-install-recommends && \ echo "[client]\nprotocol=tcp\nuser=root" >> /.devstep/.my.cnf && \ echo "export PGHOST=localhost" >> /.devstep/.profile.d/postgresql.sh && \ From c1ae2d9422aa86c7f7eebdc0671b517f1a1a04f3 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 01:51:04 -0200 Subject: [PATCH 03/39] Next version will be 0.3.0 --- mk-images | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk-images b/mk-images index 4d4c865..3f9216a 100755 --- a/mk-images +++ b/mk-images @@ -2,7 +2,7 @@ set -e -tag='v0.2.0' +tag='v0.3.0' echo "===> Building fgrehm/devstep:${tag}" docker build -t fgrehm/devstep:${tag} . From efcc75d6ede770d79c4f9fda95be803414ab2cc9 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 01:51:41 -0200 Subject: [PATCH 04/39] For whatever reason I thought USER would be set automatically by Docker but it seems that it is not --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d4d4aab..bc53edc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,6 +99,7 @@ RUN chown -R developer:developer /.devstep && \ # Setup locales and default user USER developer +ENV USER developer ENV HOME /.devstep ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 From 986365a8315629033d31ab9970067e39e890967d Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 02:30:07 -0200 Subject: [PATCH 05/39] baseimage: Begin work on improving organization within the image [GH-63] --- Dockerfile | 61 +++++++++++++++++++++++--------------------- devstep.yml | 2 +- stack/bashrc | 2 +- stack/bin/entrypoint | 6 ++--- stack/bin/init | 16 ++++++------ 5 files changed, 45 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc53edc..0be863c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,11 +13,16 @@ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get install -y sudo && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - mkdir -p /.devstep/cache && \ - mkdir -p /.devstep/.profile.d && \ - mkdir -p /.devstep/bin && \ - mkdir -p /.devstep/log && \ - echo "developer:x:1000:1000:Developer,,,:/.devstep:/bin/bash" >> /etc/passwd && \ + mkdir -p /home/devstep/cache && \ + mkdir -p /home/devstep/.profile.d && \ + mkdir -p /home/devstep/bin && \ + mkdir -p /home/devstep/log && \ + mkdir -p /opt/devstep/bin && \ + mkdir -p /opt/devstep/buildpacks && \ + mkdir -p /opt/devstep/addons && \ + mkdir -p /etc/devstep/service && \ + mkdir -p /etc/devstep/init.d && \ + echo "developer:x:1000:1000:Developer,,,:/home/devstep:/bin/bash" >> /etc/passwd && \ echo "developer:x:1000:" >> /etc/group && \ echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \ chmod 0440 /etc/sudoers.d/developer @@ -29,9 +34,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y python runit --no-install-recommends && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - mkdir -p /etc/my_init.d && \ - mkdir -p /etc/service + rm -rf /var/lib/apt/lists/* ##################################################################### # * Install dependencies for rubies, php and possibly other programming @@ -52,14 +55,14 @@ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libyaml-dev libgdbm-dev libffi-dev libicu-dev --no-install-recommends && \ apt-get install -y postgresql-client mysql-client libsqlite3-dev --no-install-recommends && \ apt-get install -y software-properties-common bash-completion --no-install-recommends && \ - echo "[client]\nprotocol=tcp\nuser=root" >> /.devstep/.my.cnf && \ - echo "export PGHOST=localhost" >> /.devstep/.profile.d/postgresql.sh && \ - echo "export PGUSER=postgres" >> /.devstep/.profile.d/postgresql.sh && \ + echo "[client]\nprotocol=tcp\nuser=root" >> /home/devstep/.my.cnf && \ + echo "export PGHOST=localhost" >> /home/devstep/.profile.d/postgresql.sh && \ + echo "export PGUSER=postgres" >> /home/devstep/.profile.d/postgresql.sh && \ apt-get install -y --force-yes vim htop tmux mercurial bzr nodejs libssl0.9.8 --no-install-recommends && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - mkdir -p /.devstep/bin && \ - curl -L -s http://stedolan.github.io/jq/download/linux64/jq > /.devstep/bin/jq + curl -L -s http://stedolan.github.io/jq/download/linux64/jq > /opt/devstep/bin/jq && \ + chmod +x /opt/devstep/bin/jq ##################################################################### # Bring back apt .deb caching as they'll be either removed on the @@ -69,30 +72,30 @@ RUN rm /etc/apt/apt.conf.d/docker-clean ##################################################################### # Devstep buildpacks -ADD buildpacks /.devstep/buildpacks -RUN for script in /.devstep/buildpacks/*/bin/install-dependencies; do \ +ADD buildpacks /opt/devstep/buildpacks +RUN for script in /opt/devstep/buildpacks/*/bin/install-dependencies; do \ $script; \ done ##################################################################### # Devstep goodies (ADDed at the end to increase image "cacheability") -ADD stack/bin /.devstep/bin -ADD stack/bashrc /.devstep/.bashrc -ADD stack/load-env.sh /.devstep/load-env.sh -ADD addons /.devstep/addons +ADD stack/bin /opt/devstep/bin +ADD stack/load-env.sh /opt/devstep/load-env.sh +ADD stack/bashrc /home/devstep/.bashrc +ADD addons /opt/devstep/addons ##################################################################### # Fix permissions, set up init and generate locales -RUN chown -R developer:developer /.devstep && \ - chown -R developer:developer /etc/my_init.d && \ - chown -R developer:developer /etc/service && \ +RUN chown -R developer:developer /home/devstep && \ + chown -R developer:developer /etc/devstep && \ + chown -R developer:developer /opt/devstep && \ chmod u+s /usr/bin/sudo && \ - ln -s /.devstep/bin/fix-permissions /etc/my_init.d/05-fix-permissions.sh && \ - ln -s /.devstep/bin/create-cache-symlinks /etc/my_init.d/10-create-cache-symlinks.sh && \ - ln -s /.devstep/bin/forward-linked-ports /etc/my_init.d/10-forward-linked-ports.sh && \ - chmod +x /.devstep/bin/* && \ - chmod +x /etc/my_init.d/* && \ + ln -s /opt/devstep/bin/fix-permissions /etc/devstep/init.d/05-fix-permissions.sh && \ + ln -s /opt/devstep/bin/create-cache-symlinks /etc/devstep/init.d/10-create-cache-symlinks.sh && \ + ln -s /opt/devstep/bin/forward-linked-ports /etc/devstep/init.d/10-forward-linked-ports.sh && \ + chmod +x /opt/devstep/bin/* && \ + chmod +x /etc/devstep/init.d/* && \ locale-gen en_US.UTF-8 ##################################################################### @@ -100,14 +103,14 @@ RUN chown -R developer:developer /.devstep && \ USER developer ENV USER developer -ENV HOME /.devstep +ENV HOME /home/devstep ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 ENV LC_CTYPE en_US.UTF-8 ##################################################################### # Use our init -ENTRYPOINT ["/.devstep/bin/entrypoint"] +ENTRYPOINT ["/opt/devstep/bin/entrypoint"] # Start a bash session by default CMD ["/bin/bash"] diff --git a/devstep.yml b/devstep.yml index b08428e..603b5c5 100644 --- a/devstep.yml +++ b/devstep.yml @@ -3,7 +3,7 @@ volumes: # FIXME: This only work on my machine - '{{env "HOME"}}/devstep/development/docker:/var/lib/docker' - '{{env "HOME"}}/projects/oss/devstep-examples:/.devstep/examples' - - '{{env "HOME"}}/projects/oss/devstep-cli/build/devstep:/.devstep/bin/devstep' + - '{{env "HOME"}}/projects/oss/devstep-cli/build/linux_amd64:/.devstep/bin/devstep' commands: make: # No custom options diff --git a/stack/bashrc b/stack/bashrc index 959094d..f5e1d74 100644 --- a/stack/bashrc +++ b/stack/bashrc @@ -1 +1 @@ -source $HOME/load-env.sh +source /opt/devstep/load-env.sh diff --git a/stack/bin/entrypoint b/stack/bin/entrypoint index ae0a208..2b912ef 100755 --- a/stack/bin/entrypoint +++ b/stack/bin/entrypoint @@ -5,7 +5,7 @@ # This is needed since some custom logic can be injected into the container's # init process by "plugins" (like the squid3-ssl contrib) -find /etc/my_init.d -size 0 -print0 | xargs -0 rm &>/dev/null +find /etc/devstep/init.d -size 0 -print0 | xargs -0 rm &>/dev/null -source /.devstep/load-env.sh -eval "/.devstep/bin/init $@" +source /opt/devstep/load-env.sh +eval "/opt/devstep/bin/init $@" diff --git a/stack/bin/init b/stack/bin/init index 77b9c35..9afe4c4 100755 --- a/stack/bin/init +++ b/stack/bin/init @@ -145,9 +145,9 @@ def kill_all_processes(time_limit): signal.alarm(0) def run_startup_files(): - # Run /etc/my_init.d/* - for name in listdir("/etc/my_init.d"): - filename = "/etc/my_init.d/" + name + # Run /etc/devstep/init.d/* + for name in listdir("/etc/devstep/init.d"): + filename = "/etc/devstep/init.d/" + name if is_exe(filename): info("Running %s..." % filename) run_command_killable_and_import_envvars(filename) @@ -155,7 +155,7 @@ def run_startup_files(): def start_runit(): info("Booting runit daemon...") pid = os.spawnl(os.P_NOWAIT, "/usr/bin/runsvdir", "/usr/bin/runsvdir", - "-P", "/etc/service", "log: %s" % ('.' * 395)) + "-P", "/etc/devstep/service", "log: %s" % ('.' * 395)) info("Runit started as PID %d" % pid) return pid @@ -166,7 +166,7 @@ def wait_for_runit_or_interrupt(pid): except KeyboardInterrupt: return (False, None) -def get_runit_services(dir = "/etc/service"): +def get_runit_services(dir = "/etc/devstep/service"): return [name for name in os.listdir(dir) if os.path.isdir(os.path.join(dir, name))] @@ -175,7 +175,7 @@ def shutdown_runit_services(): return debug("Begin shutting down runit services...") - os.system("/usr/bin/sv down /etc/service/*") + os.system("/usr/bin/sv down /etc/devstep/service/*") def wait_for_runit_services(): if not get_runit_services(): @@ -184,7 +184,7 @@ def wait_for_runit_services(): debug("Waiting for runit services to exit...") done = False while not done: - done = os.system("/usr/bin/sv status /etc/service/* | grep -q '^run:'") != 0 + done = os.system("/usr/bin/sv status /etc/devstep/service/* | grep -q '^run:'") != 0 if not done: time.sleep(0.1) @@ -240,7 +240,7 @@ parser.add_argument('main_command', metavar = 'MAIN_COMMAND', type = str, nargs help = 'The main command to run. (default: runit)') parser.add_argument('--skip-startup-files', dest = 'skip_startup_files', action = 'store_const', const = True, default = False, - help = 'Skip running /etc/my_init.d/* and /etc/rc.local') + help = 'Skip running /etc/devstep/init.d/* and /etc/rc.local') parser.add_argument('--skip-runit', dest = 'skip_runit', action = 'store_const', const = True, default = False, help = 'Do not run runit services') From 6a1ccaa1a35763067e19be4480557ce032867430 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 02:44:26 -0200 Subject: [PATCH 06/39] baseimage: Progress on improving organization within the image [GH-63] --- addons/docker/bin/configure | 6 +++--- addons/docker/bin/start-daemon | 8 ++++---- addons/memcached/bin/start-server | 4 ++-- addons/postgresql/bin/configure | 4 ++-- addons/postgresql/bin/start-server | 24 +++++++++++----------- addons/redis/bin/start-server | 4 ++-- auto-build/Dockerfile | 2 +- buildpacks/bats/bin/compile | 6 +++--- buildpacks/golang/bin/compile | 24 +++++++++++----------- buildpacks/nodejs/bin/compile | 14 ++++++------- buildpacks/phantomjs/bin/compile | 8 ++++---- buildpacks/php/bin/install-dependencies | 8 ++++---- buildpacks/python/bin/compile | 18 ++++++++-------- buildpacks/python/bin/install-dependencies | 4 ++-- buildpacks/ruby/bin/compile | 10 ++++----- stack/bin/build-project | 8 ++++---- stack/bin/configure-addons | 2 +- stack/bin/create-cache-symlinks | 2 +- stack/bin/fix-permissions | 4 ++-- stack/bin/hack | 2 +- stack/load-env.sh | 7 ++++--- 21 files changed, 85 insertions(+), 84 deletions(-) diff --git a/addons/docker/bin/configure b/addons/docker/bin/configure index 43d72db..ad5d286 100755 --- a/addons/docker/bin/configure +++ b/addons/docker/bin/configure @@ -4,8 +4,8 @@ set -e # fail fast set -o pipefail # dont ignore exit codes when piping output # set -x # enable debugging -CACHE_DIR=${2:-'/.devstep/cache'} -DOCKER_CMD=/.devstep/bin/docker +CACHE_DIR=${2:-"${HOME}/cache"} +DOCKER_CMD="${HOME}/bin/docker" URL=https://get.docker.io/builds/Linux/x86_64/docker-latest if ! [ -x "${DOCKER_CMD}" ]; then @@ -23,7 +23,7 @@ if ! [ -x /sbin/iptables ] || ! [ -x /sbin/apparmor_parser ]; then sudo apt-get update -q && sudo apt-get install iptables apparmor -y --force-yes -q fi -echo "-----> [docker] Installed $(/.devstep/bin/docker --version)" +echo "-----> [docker] Installed $(${HOME}/bin/docker --version)" addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" diff --git a/addons/docker/bin/start-daemon b/addons/docker/bin/start-daemon index 1e12aa3..54cb126 100755 --- a/addons/docker/bin/start-daemon +++ b/addons/docker/bin/start-daemon @@ -6,10 +6,10 @@ set -o pipefail # dont ignore exit codes when piping output # If a pidfile is still around (for example after a container restart), # delete it so that docker can start. -mkdir -p /.devstep/run -rm -f /.devstep/run/docker.pid +mkdir -p ${HOME}/run +rm -f ${HOME}/run/docker.pid ! [ -L /var/run/docker.sock ] && - sudo ln -s /.devstep/run/docker.sock /var/run/docker.sock + sudo ln -s ${HOME}/run/docker.sock /var/run/docker.sock -sudo /.devstep/bin/docker -d -p /.devstep/run/docker.pid -G developer -H unix:///.devstep/run/docker.sock &> /.devstep/log/docker.log & &>/dev/null +sudo ${HOME}/bin/docker -d -p ${HOME}/run/docker.pid -G developer -H unix://${HOME}/run/docker.sock &> ${HOME}/log/docker.log & &>/dev/null diff --git a/addons/memcached/bin/start-server b/addons/memcached/bin/start-server index f4bede4..e6480db 100755 --- a/addons/memcached/bin/start-server +++ b/addons/memcached/bin/start-server @@ -1,5 +1,5 @@ #!/usr/bin/env bash -mkdir -p /.devstep/log +mkdir -p ${HOME}/log -exec /usr/bin/memcached &> /.devstep/log/memcached.log +exec /usr/bin/memcached &> ${HOME}/log/memcached.log diff --git a/addons/postgresql/bin/configure b/addons/postgresql/bin/configure index 5414233..83f8fc8 100755 --- a/addons/postgresql/bin/configure +++ b/addons/postgresql/bin/configure @@ -11,8 +11,8 @@ if ! [ -f /etc/init.d/postgresql ]; then sudo apt-get install postgresql-9.3 postgresql-contrib -y --force-yes -q ) &>> /tmp/configure-pg.log - echo "export PGHOST=" >> /.devstep/.profile.d/postgresql.sh - source /.devstep/.profile.d/postgresql.sh + echo "export PGHOST=" >> ${HOME}/.profile.d/postgresql.sh + source ${HOME}/.profile.d/postgresql.sh fi addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" diff --git a/addons/postgresql/bin/start-server b/addons/postgresql/bin/start-server index 961919e..e7940e6 100755 --- a/addons/postgresql/bin/start-server +++ b/addons/postgresql/bin/start-server @@ -18,29 +18,29 @@ fi if [ ! -d $POSTGRESQL_DATA ] || [ ! -f $POSTGRESQL_DATA/PG_VERSION ]; then sudo mkdir -p $POSTGRESQL_DATA sudo chown -R developer:developer $POSTGRESQL_DATA - /usr/lib/postgresql/9.3/bin/initdb -D $POSTGRESQL_DATA &>> /.devstep/log/postgresql.log + /usr/lib/postgresql/9.3/bin/initdb -D $POSTGRESQL_DATA &>> ${HOME}/log/postgresql.log fi sudo chown -R developer:developer $POSTGRESQL_DATA sudo chown -R developer:developer /var/run/postgresql sudo chown developer:developer /etc/postgresql/9.3/main/*.conf -mkdir -p /.devstep/log +mkdir -p ${HOME}/log POSTGRESQL_SINGLE="$POSTGRESQL_BIN --single --config-file=$POSTGRESQL_CONFIG_FILE postgres" -$POSTGRESQL_SINGLE <<< "CREATE USER $POSTGRESQL_USER WITH SUPERUSER;" &> /.devstep/log/postgresql.log || true -$POSTGRESQL_SINGLE <<< "CREATE DATABASE $POSTGRESQL_DB OWNER $POSTGRESQL_USER TEMPLATE $POSTGRESQL_TEMPLATE;" &>> /.devstep/log/postgresql.log || true -$POSTGRESQL_SINGLE <<< "ALTER USER $POSTGRESQL_USER WITH PASSWORD '$POSTGRESQL_PASS';" &>> /.devstep/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "CREATE USER $POSTGRESQL_USER WITH SUPERUSER;" &> ${HOME}/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "CREATE DATABASE $POSTGRESQL_DB OWNER $POSTGRESQL_USER TEMPLATE $POSTGRESQL_TEMPLATE;" &>> ${HOME}/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "ALTER USER $POSTGRESQL_USER WITH PASSWORD '$POSTGRESQL_PASS';" &>> ${HOME}/log/postgresql.log || true # Based on https://gist.github.com/ffmike/877447 POSTGRESQL_SINGLE="$POSTGRESQL_BIN --single --config-file=$POSTGRESQL_CONFIG_FILE postgres" -$POSTGRESQL_SINGLE <<< "update pg_database set datallowconn = TRUE where datname = 'template0';" &>> /.devstep/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "update pg_database set datallowconn = TRUE where datname = 'template0';" &>> ${HOME}/log/postgresql.log || true POSTGRESQL_SINGLE="$POSTGRESQL_BIN --single --config-file=$POSTGRESQL_CONFIG_FILE template0" -$POSTGRESQL_SINGLE <<< "update pg_database set datistemplate = FALSE where datname = 'template1';" &>> /.devstep/log/postgresql.log || true -$POSTGRESQL_SINGLE <<< "drop database template1;" &> /.devstep/log/postgresql.log || true -$POSTGRESQL_SINGLE <<< "create database template1 with template = template0 encoding = 'UTF8';" &>> /.devstep/log/postgresql.log || true -$POSTGRESQL_SINGLE <<< "update pg_database set datistemplate = TRUE where datname = 'template1';" &>> /.devstep/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "update pg_database set datistemplate = FALSE where datname = 'template1';" &>> ${HOME}/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "drop database template1;" &> ${HOME}/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "create database template1 with template = template0 encoding = 'UTF8';" &>> ${HOME}/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "update pg_database set datistemplate = TRUE where datname = 'template1';" &>> ${HOME}/log/postgresql.log || true POSTGRESQL_SINGLE="$POSTGRESQL_BIN --single --config-file=$POSTGRESQL_CONFIG_FILE template1" -$POSTGRESQL_SINGLE <<< "update pg_database set datallowconn = FALSE where datname = 'template0';" &>> /.devstep/log/postgresql.log || true +$POSTGRESQL_SINGLE <<< "update pg_database set datallowconn = FALSE where datname = 'template0';" &>> ${HOME}/log/postgresql.log || true -exec $POSTGRESQL_BIN --config-file=$POSTGRESQL_CONFIG_FILE &>> /.devstep/log/postgresql.log +exec $POSTGRESQL_BIN --config-file=$POSTGRESQL_CONFIG_FILE &>> ${HOME}/log/postgresql.log diff --git a/addons/redis/bin/start-server b/addons/redis/bin/start-server index 9ff41e8..3bb809d 100755 --- a/addons/redis/bin/start-server +++ b/addons/redis/bin/start-server @@ -1,5 +1,5 @@ #!/usr/bin/env bash -mkdir -p /.devstep/log +mkdir -p ${HOME}/log -exec /usr/bin/redis-server &> /.devstep/log/redis.log +exec /usr/bin/redis-server &> ${HOME}/log/redis.log diff --git a/auto-build/Dockerfile b/auto-build/Dockerfile index 39d1848..2b3845b 100644 --- a/auto-build/Dockerfile +++ b/auto-build/Dockerfile @@ -4,4 +4,4 @@ FROM fgrehm/devstep:v0.2.0 # Add project to the image and build it ONBUILD ADD . /workspace ONBUILD WORKDIR /workspace -ONBUILD RUN CLEANUP=1 /.devstep/bin/build-project /workspace +ONBUILD RUN CLEANUP=1 ${HOME}/bin/build-project /workspace diff --git a/buildpacks/bats/bin/compile b/buildpacks/bats/bin/compile index f773ebc..51342e6 100755 --- a/buildpacks/bats/bin/compile +++ b/buildpacks/bats/bin/compile @@ -13,7 +13,7 @@ else if ! [ -f $cache/bats.tar.gz ]; then curl -sL --insecure http://github.com/sstephenson/bats/tarball/master > $cache/bats.tar.gz fi - mkdir -p /.devstep/bats - tar xfz $cache/bats.tar.gz -C /.devstep/bats --strip-components=1 - (cd /.devstep/bats && sudo ./install.sh /.devstep) + mkdir -p ${HOME}/bats + tar xfz $cache/bats.tar.gz -C ${HOME}/bats --strip-components=1 + (cd ${HOME}/bats && sudo ./install.sh ${HOME}) fi diff --git a/buildpacks/golang/bin/compile b/buildpacks/golang/bin/compile index e63e6c7..5da7525 100755 --- a/buildpacks/golang/bin/compile +++ b/buildpacks/golang/bin/compile @@ -33,7 +33,7 @@ fi plat=$(uname|tr A-Z a-z)-$arch heroku_buildpack_bin='https://github.com/kr/heroku-buildpack-go/raw/master/linux-amd64/bin' -target='/.devstep/bin' +target="${HOME}/bin" if [ -f $build/Godeps ] || [ -d $build/Godeps ]; then if ! [ -f ${target}/godep ]; then echo "-----> Installing godep to ${target}..." @@ -68,8 +68,8 @@ ver=${ver:-go${GOVERSION:-1.3.1}} file=${GOFILE:-$ver.$(uname|tr A-Z a-z)-amd64.tar.gz} url=${GOURL:-$(urlfor $ver $file)} -if [ -d /.devstep/go ]; then - echo "-----> Using $(/.devstep/go/bin/go version)" +if [ -d ${HOME}/go ]; then + echo "-----> Using $(${HOME}/go/bin/go version)" else mkdir -p $cache/$ver cd $cache/$ver @@ -80,13 +80,13 @@ else curl -sLO $url echo "done" fi - tar zxf $file -C /.devstep + tar zxf $file -C ${HOME} fi -GOROOT=/.devstep/go export GOROOT +GOROOT=${HOME}/go export GOROOT PATH=$GOROOT/bin:$PATH export PATH -GOPATH=/.devstep/gocode export GOPATH +GOPATH=${HOME}/gocode export GOPATH GOBIN=$GOPATH/bin export GOBIN PATH=$GOBIN:$PATH export PATH @@ -106,13 +106,13 @@ else mkdir -p $GOPATH fi -if ! [ -f /.devstep/.profile.d/go.sh ]; then +if ! [ -f ${HOME}/.profile.d/go.sh ]; then echo "-----> Configuring ${ver}..." - echo "export GOPATH=$GOPATH" > /.devstep/.profile.d/go.sh - echo "export GOROOT=$GOROOT" >> /.devstep/.profile.d/go.sh - echo "export GOBIN=$GOBIN" >> /.devstep/.profile.d/go.sh - echo 'export PATH=$PATH:$GOROOT/bin' >> /.devstep/.profile.d/go.sh - echo 'export PATH=$PATH:$GOBIN' >> /.devstep/.profile.d/go.sh + echo "export GOPATH=$GOPATH" > ${HOME}/.profile.d/go.sh + echo "export GOROOT=$GOROOT" >> ${HOME}/.profile.d/go.sh + echo "export GOBIN=$GOBIN" >> ${HOME}/.profile.d/go.sh + echo 'export PATH=$PATH:$GOROOT/bin' >> ${HOME}/.profile.d/go.sh + echo 'export PATH=$PATH:$GOBIN' >> ${HOME}/.profile.d/go.sh echo 'done' fi diff --git a/buildpacks/nodejs/bin/compile b/buildpacks/nodejs/bin/compile index 791c1df..2c63967 100755 --- a/buildpacks/nodejs/bin/compile +++ b/buildpacks/nodejs/bin/compile @@ -21,7 +21,7 @@ trap cat_npm_debug_log ERR # Look in package.json's engines.node field for a semver range if [ -f $build_dir/package.json ]; then - semver_range=$(cat $build_dir/package.json | /.devstep/bin/jq -r .engines.node) + semver_range=$(cat $build_dir/package.json | ${DEVSTEP_BIN}/jq -r .engines.node) else semver_range= fi @@ -63,15 +63,15 @@ else node_url="http://s3pository.heroku.com/node/v$node_version/node-v$node_version-linux-x64.tar.gz" curl $node_url > $tarball_path fi -mkdir -p /.devstep/nodejs -tar xzf $tarball_path -C /.devstep/nodejs --strip-components=1 -export PATH="/.devstep/nodejs/bin:$build_dir/node_modules/.bin:$PATH" -export NODE_PATH="/.devstep/nodejs/lib/node_modules:" +mkdir -p ${HOME}/nodejs +tar xzf $tarball_path -C ${HOME}/nodejs --strip-components=1 +export PATH="${HOME}/nodejs/bin:$build_dir/node_modules/.bin:$PATH" +export NODE_PATH="${HOME}/nodejs/lib/node_modules:" # Update the PATH status "Building runtime environment" -echo "export PATH=\"/.devstep/nodejs/bin:$build_dir/node_modules/.bin:\$PATH\";" > /.devstep/.profile.d/nodejs.sh -echo "export NODE_PATH=\"/.devstep/nodejs/lib/node_modules:\";" >> /.devstep/.profile.d/nodejs.sh +echo "export PATH=\"${HOME}/nodejs/bin:$build_dir/node_modules/.bin:\$PATH\";" > ${HOME}/.profile.d/nodejs.sh +echo "export NODE_PATH=\"${HOME}/nodejs/lib/node_modules:\";" >> ${HOME}/.profile.d/nodejs.sh # Cache npm packages on host machine npm config set cache $cache_dir/npm diff --git a/buildpacks/phantomjs/bin/compile b/buildpacks/phantomjs/bin/compile index 4e79234..a411969 100755 --- a/buildpacks/phantomjs/bin/compile +++ b/buildpacks/phantomjs/bin/compile @@ -13,7 +13,7 @@ ARCHIVE_NAME=phantomjs-${PHANTOMJS_VERSION}-linux-x86_64 FILE_NAME=${ARCHIVE_NAME}.tar.bz2 BUILDPACK_PHANTOMJS_PACKAGE=https://bitbucket.org/ariya/phantomjs/downloads/${FILE_NAME} -if [ -x /.devstep/bin/phantomjs ]; then +if [ -x ${HOME}/bin/phantomjs ]; then echo "-----> PhantomJS already installed" exit 0 fi @@ -24,8 +24,8 @@ if ! [ -e $CACHE_DIR/$FILE_NAME ]; then curl $BUILDPACK_PHANTOMJS_PACKAGE -L -s > $CACHE_DIR/$FILE_NAME fi -echo "-----> Extracting PhantomJS ${PHANTOMJS_VERSION} binaries to /.devstep/phantomjs" +echo "-----> Extracting PhantomJS ${PHANTOMJS_VERSION} binaries to ${HOME}/phantomjs" mkdir -p $CACHE_DIR/$ARCHIVE_NAME tar jxf $CACHE_DIR/$FILE_NAME -C $CACHE_DIR -mv $CACHE_DIR/$ARCHIVE_NAME /.devstep/phantomjs -ln -s /.devstep/phantomjs/bin/phantomjs /.devstep/bin/phantomjs +mv $CACHE_DIR/$ARCHIVE_NAME ${HOME}/phantomjs +ln -s ${HOME}/phantomjs/bin/phantomjs ${HOME}/bin/phantomjs diff --git a/buildpacks/php/bin/install-dependencies b/buildpacks/php/bin/install-dependencies index e710988..544dac8 100755 --- a/buildpacks/php/bin/install-dependencies +++ b/buildpacks/php/bin/install-dependencies @@ -5,13 +5,13 @@ set -e echo -n ' Installing dependencies for PHP buildpack... ' url='https://github.com/heroku/heroku-buildpack-php/archive/v33.tar.gz' -mkdir -p /.devstep/buildpacks/php/heroku-buildpack-php -curl -sL $url | tar xz --strip-components=1 -C /.devstep/buildpacks/php/heroku-buildpack-php +mkdir -p /opt/devstep/buildpacks/php/heroku-buildpack-php +curl -sL $url | tar xz --strip-components=1 -C /opt/devstep/buildpacks/php/heroku-buildpack-php # Replace heroku buildpack configs with our stuff -for conf in /.devstep/buildpacks/php/heroku-buildpack-php/conf/**/*; do +for conf in /opt/devstep/buildpacks/php/heroku-buildpack-php/conf/**/*; do if [ -f $conf ] && $(grep -q "/app/.heroku" $conf); then - sed -i 's|/app/.heroku|/.devstep|' $conf + sed -i 's|/app/.heroku|/home/devstep|' $conf fi done diff --git a/buildpacks/python/bin/compile b/buildpacks/python/bin/compile index fc718da..7fc2899 100755 --- a/buildpacks/python/bin/compile +++ b/buildpacks/python/bin/compile @@ -33,11 +33,11 @@ ROOT_DIR=$basedir # Static configurations for virtualenv caches. # VIRTUALENV_LOC=".heroku/venv" # LEGACY_TRIGGER="lib/python2.7" -PROFILE_PATH="/.devstep/.profile.d/python.sh" +PROFILE_PATH="${HOME}/.profile.d/python.sh" DEFAULT_PYTHON_VERSION="python-2.7.8" DEFAULT_PYTHON_STACK="cedar-14" -PYTHON_EXE="/.devstep/python/bin/python" +PYTHON_EXE="${HOME}/python/bin/python" PIP_VERSION="1.5.6" SETUPTOOLS_VERSION="5.4.1" @@ -48,7 +48,7 @@ SETUPTOOLS_VERSION="5.4.1" BUILDPACK_VERSION=v28 # Setup pip-pop (pip-diff) -export PATH=$PATH:$ROOT_DIR/vendor/pip-pop +export PATH="$PATH:$ROOT_DIR/vendor/pip-pop" # Support Anvil Build_IDs # [ ! "$SLUG_ID" ] && SLUG_ID="defaultslug" @@ -95,14 +95,14 @@ source $BIN_DIR/utils # BUILD_DIR=$APP_DIR # Prepend proper path buildpack use. -export PATH=/.devstep/python/bin:$PATH +export PATH="${HOME}/python/bin:$PATH" export PYTHONUNBUFFERED=1 export LANG=en_US.UTF-8 -export C_INCLUDE_PATH=/.devstep/python/include -export CPLUS_INCLUDE_PATH=/.devstep/python/include -export LIBRARY_PATH=/.devstep/python/lib -export LD_LIBRARY_PATH=/.devstep/python/lib -export PKG_CONFIG_PATH=/.devstep/python/lib/pkg-config +export C_INCLUDE_PATH="${HOME}/python/include" +export CPLUS_INCLUDE_PATH="${HOME}/python/include" +export LIBRARY_PATH="${HOME}/python/lib" +export LD_LIBRARY_PATH="${HOME}/python/lib" +export PKG_CONFIG_PATH="${HOME}/python/lib/pkg-config" export PIP_DOWNLOAD_CACHE="$CACHE_DIR/pip" # Switch to the repo's context. diff --git a/buildpacks/python/bin/install-dependencies b/buildpacks/python/bin/install-dependencies index 9848137..4deae78 100755 --- a/buildpacks/python/bin/install-dependencies +++ b/buildpacks/python/bin/install-dependencies @@ -6,7 +6,7 @@ echo -n ' Installing dependencies for Python buildpack... ' # TODO: Change to a tagged release after a new release is out with this commit url='https://github.com/heroku/heroku-buildpack-python/archive/16a07abd516446c09127c352c560eb9cc086f9fb.tar.gz' -mkdir -p /.devstep/buildpacks/python/heroku-buildpack-python -curl -sL $url | tar xz --strip-components=1 -C /.devstep/buildpacks/python/heroku-buildpack-python +mkdir -p /opt/devstep/buildpacks/python/heroku-buildpack-python +curl -sL $url | tar xz --strip-components=1 -C /opt/devstep/buildpacks/python/heroku-buildpack-python echo 'DONE' diff --git a/buildpacks/ruby/bin/compile b/buildpacks/ruby/bin/compile index ac8405f..8ba3906 100755 --- a/buildpacks/ruby/bin/compile +++ b/buildpacks/ruby/bin/compile @@ -66,7 +66,7 @@ install_ruby() { } } - mkdir -p /.devstep/.profile.d + mkdir -p ${HOME}/.profile.d echo 'export PATH="$HOME/ruby/bin:$PATH"' > $HOME/.profile.d/ruby.sh return 0 @@ -77,7 +77,7 @@ requires_phantomjs() { } install_phantomjs() { - /.devstep/buildpacks/phantomjs/bin/compile $1 $2 + /opt/devstep/buildpacks/phantomjs/bin/compile $1 $2 } # TODO: Look into travis.yml as well @@ -88,7 +88,7 @@ if [ -z "$DEVSTEP_RUBY_VERSION" ]; then echo "Unable to identify the project ruby version, setting to ${DEVSTEP_RUBY_VERSION}" fi -if [ -d /.devstep/ruby ]; then +if [ -d ${HOME}/ruby ]; then echo 'Ruby already installed, skipping' else # Step away from project sources to avoid loading .ruby-version and .ruby-gemset files @@ -116,7 +116,7 @@ BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries" STR fi -source /.devstep/.profile.d/ruby.sh +source ${HOME}/.profile.d/ruby.sh DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.3'} @@ -148,7 +148,7 @@ echo "Installing gems using bundler '$(bundle -v | cut -d' ' -f 3)'..." (cd $1 && bundle install --jobs=4) if requires_phantomjs $1; then - if [ -d /.devstep/phantomjs ]; then + if [ -d ${HOME}/phantomjs ]; then echo '-----> PhantomJS already installed, skipping' else install_phantomjs $1 $2 diff --git a/stack/bin/build-project b/stack/bin/build-project index 215d6de..295097b 100755 --- a/stack/bin/build-project +++ b/stack/bin/build-project @@ -33,8 +33,8 @@ done export FORCED_BUILDPACKS project_root=${1:-`pwd`} -cache_root=${2:-/.devstep/cache} -buildpack_root=/.devstep/buildpacks +cache_root=${2:-"${HOME}/cache"} +buildpack_root=/opt/devstep/buildpacks if [ "${project_root}" = '/' ]; then echo "Can't build root dir!" @@ -44,7 +44,7 @@ fi mkdir -p $project_root mkdir -p $cache_root mkdir -p $buildpack_root -mkdir -p /.devstep/.profile.d +mkdir -p ${HOME}/.profile.d function output_redirect() { if [[ "$slug_file" == "-" ]]; then @@ -85,7 +85,7 @@ export APP_DIR="$project_root" ## Fix directory permissions -(cd $project_root && /.devstep/bin/fix-permissions) +(cd $project_root && /opt/devstep/bin/fix-permissions) ## Buildpack detection diff --git a/stack/bin/configure-addons b/stack/bin/configure-addons index 19ce6d5..70b4b6c 100755 --- a/stack/bin/configure-addons +++ b/stack/bin/configure-addons @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail -addons_root="/.devstep/addons" +addons_root="/opt/devstep/addons" available_addons() { for addon in "${addons_root}"/*; do diff --git a/stack/bin/create-cache-symlinks b/stack/bin/create-cache-symlinks index 56b89d7..727f76c 100755 --- a/stack/bin/create-cache-symlinks +++ b/stack/bin/create-cache-symlinks @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail -cache_root="/.devstep/cache" +cache_root="${HOME}/cache" empty_directory() { if [ $(ls -A "${1}" 2>/dev/null | wc -l) = '0' ]; then diff --git a/stack/bin/fix-permissions b/stack/bin/fix-permissions index 9d20267..5781306 100755 --- a/stack/bin/fix-permissions +++ b/stack/bin/fix-permissions @@ -23,12 +23,12 @@ else fi -info=( $(stat -Lc"%U %g %u" /.devstep/cache) ) +info=( $(stat -Lc"%U %g %u" ${HOME}/cache) ) user=${info[0]} gid=${info[1]} uid=${info[2]} if [ $user != 'developer' ]; then echo "-----> Changing cache dir owner to 'developer'" - sudo chown developer: /.devstep/cache + sudo chown developer: ${HOME}/cache fi diff --git a/stack/bin/hack b/stack/bin/hack index a6da40f..c8e7bb0 100755 --- a/stack/bin/hack +++ b/stack/bin/hack @@ -1,6 +1,6 @@ #!/bin/bash set -eo pipefail -/.devstep/bin/build-project $PWD "${1}" +/opt/devstep/bin/build-project $PWD "${1}" exec /bin/bash diff --git a/stack/load-env.sh b/stack/load-env.sh index 2f20c1e..ce660db 100644 --- a/stack/load-env.sh +++ b/stack/load-env.sh @@ -7,15 +7,16 @@ alias la='ls -A' alias l='ls -CF' # shortcut for reloading envs after a build -alias reload-env="source ${HOME}/load-env.sh" +alias reload-env="source /opt/devstep/load-env.sh" # shorten PS1 (useful for golang projects) export PROMPT_DIRTRIM="2" -export PATH="/.devstep/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export DEVSTEP_BIN="/opt/devstep/bin" +export PATH="${HOME}/bin:${DEVSTEP_BIN}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # TODO: Review these paths -profile_dirs="/etc /.devstep ${PWD}/.devstep" +profile_dirs="/etc ${HOME}" for dir in $profile_dirs; do if [ -d "${dir}/.profile.d" ]; then for i in "${dir}/.profile.d/"*.sh; do From 96feee14a32e97794ea0eb4bdd493af8c73a75b0 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 21:03:59 -0200 Subject: [PATCH 07/39] Update docs to reflect new base image stack organization --- auto-build/Dockerfile | 4 ++-- devstep.yml | 4 ++-- docs/buildpacks/custom.md | 2 +- docs/cli/configuration.md | 8 ++++---- docs/cli/tips.md | 8 ++++---- docs/getting-started.md | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/auto-build/Dockerfile b/auto-build/Dockerfile index 2b3845b..90bd036 100644 --- a/auto-build/Dockerfile +++ b/auto-build/Dockerfile @@ -1,7 +1,7 @@ -FROM fgrehm/devstep:v0.2.0 +FROM fgrehm/devstep:v0.3.0 ##################################################################### # Add project to the image and build it ONBUILD ADD . /workspace ONBUILD WORKDIR /workspace -ONBUILD RUN CLEANUP=1 ${HOME}/bin/build-project /workspace +ONBUILD RUN CLEANUP=1 /opt/devstep/bin/build-project /workspace diff --git a/devstep.yml b/devstep.yml index 603b5c5..a939d9b 100644 --- a/devstep.yml +++ b/devstep.yml @@ -2,8 +2,8 @@ privileged: true volumes: # FIXME: This only work on my machine - '{{env "HOME"}}/devstep/development/docker:/var/lib/docker' - - '{{env "HOME"}}/projects/oss/devstep-examples:/.devstep/examples' - - '{{env "HOME"}}/projects/oss/devstep-cli/build/linux_amd64:/.devstep/bin/devstep' + - '{{env "HOME"}}/projects/oss/devstep-examples:/devstep-examples' + - '{{env "HOME"}}/projects/oss/devstep-cli/build/linux_amd64:/home/devstep/bin/devstep' commands: make: # No custom options diff --git a/docs/buildpacks/custom.md b/docs/buildpacks/custom.md index 18cb69c..1555016 100644 --- a/docs/buildpacks/custom.md +++ b/docs/buildpacks/custom.md @@ -10,7 +10,7 @@ all Devstep environments: ```yaml volumes: - - '{{env "HOME"}}/projects/my-buildpack:/.devstep/buildpacks/my-buildpack' + - '{{env "HOME"}}/projects/my-buildpack:/opt/devstep/buildpacks/my-buildpack' ``` If you want to use a custom base image, you can add the following line to your diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index bd6ba2c..603b181 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -15,14 +15,14 @@ repository: 'repo/name' # DEFAULT: 'fgrehm/devstep:v0.2.0' source_image: 'source/image:tag' -# The host cache dir that gets mounted inside the container at `/.devstep/cache` +# The host cache dir that gets mounted inside the container at `/home/devstep/cache` # for speeding up the dependencies installation process. # DEFAULT: '/tmp/devstep/cache' cache_dir: '{{env "HOME"}}/devstep/cache' # The directory where project sources should be mounted inside the container. # DEFAULT: '/workspace' -working_dir: '/.devstep/gocode/src/github.com/fgrehm/devstep-cli' +working_dir: '/home/devstep/gocode/src/github.com/fgrehm/devstep-cli' # Link to other existing containers (like a database for example). # Please note that devstep won't start the associated containers automatically @@ -53,8 +53,8 @@ commands: # Here you can use some of the configs described above publish: ["3000:3000"] volumes: - - '{{env "HOME"}}/certs/some-certificate.crt:/.devstep/some-certificate.crt' - - '{{env "HOME"}}/projects/some-gem-sources:/.devstep/some-gem-sources' + - '{{env "HOME"}}/certs/some-certificate.crt:/home/devstep/some-certificate.crt' + - '{{env "HOME"}}/projects/some-gem-sources:/home/devstep/some-gem-sources' links: - 'redis:redis' environment: diff --git a/docs/cli/tips.md b/docs/cli/tips.md index 301e0f6..94eb2f1 100644 --- a/docs/cli/tips.md +++ b/docs/cli/tips.md @@ -19,7 +19,7 @@ Or you can just share your SSH keys with the container using: ```yaml volumes: - - '{{env "HOME"}}/.ssh:/.devstep/.ssh' + - '{{env "HOME"}}/.ssh:/home/devstep/.ssh' ``` ## Making project's dependencies cache persist between host restarts @@ -40,7 +40,7 @@ cache_dir: '{{env "HOME"}}/devstep/cache' ```yaml volumes: - - '{{env "HOME"}}/.gitconfig:/.devstep/.gitconfig' + - '{{env "HOME"}}/.gitconfig:/home/devstep/.gitconfig' ``` ## Sharing RubyGems credentials with containers @@ -51,7 +51,7 @@ share an existing credentials file with the containers using: ```yaml volumes: - - '{{env "HOME"}}/.gem/credentials:/.devstep/.gem/credentials' + - '{{env "HOME"}}/.gem/credentials:/home/devstep/.gem/credentials' ``` ## Sharing Heroku credentials with containers @@ -62,5 +62,5 @@ just share the credentials file with the containers using: ```yaml volumes: - - '{{env "HOME"}}/.netrc:/.devstep/.netrc' + - '{{env "HOME"}}/.netrc:/home/devstep/.netrc' ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index 69febe6..84e9802 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -167,7 +167,7 @@ host using a strategy similar to [vagrant-cachier's cache buckets](http://fgrehm This behavior is enabled by default and will be further documented on the future. For now you need to know that the `/tmp/devstep/cache` dir on the host will be bind -mounted to containers created by the CLI under `/.devstep/cache` and most of your +mounted to containers created by the CLI under `/home/devstep/cache` and most of your project's dependencies packages will be downloaded there. Note that the dependencies themselves are extracted and kept inside the images built by the CLI and you can safely clean things up or disable the caching behavior at will. @@ -187,7 +187,7 @@ FROM fgrehm/devstep:v0.2.0 # Add project to the image and build it ADD . /workspace WORKDIR /workspace -RUN CLEANUP=1 /.devstep/bin/build-project /workspace +RUN CLEANUP=1 /opt/devstep/bin/build-project /workspace ``` To make things easier, there's also a `fgrehm/devstep-ab:v0.2.0` image that From 8b3e1565898de73648aae1dea3a32ec504ac74ad Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 21:25:29 -0200 Subject: [PATCH 08/39] baseimage: Remove locale-gen and reduce 293MB from image size --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0be863c..fd34056 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,7 +86,7 @@ ADD stack/bashrc /home/devstep/.bashrc ADD addons /opt/devstep/addons ##################################################################### -# Fix permissions, set up init and generate locales +# Fix permissions, set up init RUN chown -R developer:developer /home/devstep && \ chown -R developer:developer /etc/devstep && \ chown -R developer:developer /opt/devstep && \ @@ -95,8 +95,7 @@ RUN chown -R developer:developer /home/devstep && \ ln -s /opt/devstep/bin/create-cache-symlinks /etc/devstep/init.d/10-create-cache-symlinks.sh && \ ln -s /opt/devstep/bin/forward-linked-ports /etc/devstep/init.d/10-forward-linked-ports.sh && \ chmod +x /opt/devstep/bin/* && \ - chmod +x /etc/devstep/init.d/* && \ - locale-gen en_US.UTF-8 + chmod +x /etc/devstep/init.d/* ##################################################################### # Setup locales and default user From c35893e497513669dc358dd3b2753a930f27cf52 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 21:35:24 -0200 Subject: [PATCH 09/39] buildpacks/nodejs: Bump latest to 0.10.32 --- CHANGELOG.md | 4 ++++ buildpacks/nodejs/bin/compile | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5afcc88..d036e50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ BREAKING CHANGES: - Switched to the latest progrium/cedarish image which uses an unmodified Heroku `cedar14.sh` base stack source. More info [here](https://github.com/progrium/cedarish/commit/71e2a4af8d300c94783720d13eac79d084a35a75) +IMPROVEMENTS: + + - buildpacks/nodejs: Bump default Node to 0.10.32 + ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) BREAKING CHANGES: diff --git a/buildpacks/nodejs/bin/compile b/buildpacks/nodejs/bin/compile index 2c63967..187585c 100755 --- a/buildpacks/nodejs/bin/compile +++ b/buildpacks/nodejs/bin/compile @@ -29,8 +29,8 @@ fi # Resolve node version using semver.io _node_version() { curl --connect-timeout 30 --silent --get --data-urlencode "range=${semver_range}" https://semver.io/node/resolve || { - echo ' Unable to fetch node version from semver.io, using latest known (0.10.26)' >&2 - echo '0.10.26' + echo ' Unable to fetch node version from semver.io, using latest known (0.10.32)' >&2 + echo '0.10.32' } } node_version=$(_node_version) From 2a90834b41f83ebf1f741157cea6a562ed812834 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 22 Oct 2014 21:38:51 -0200 Subject: [PATCH 10/39] buildpacks/ruby: Bump latest Bundler to 1.7.4 --- CHANGELOG.md | 1 + buildpacks/ruby/bin/compile | 2 +- docs/buildpacks/ruby.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d036e50..f190d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ BREAKING CHANGES: IMPROVEMENTS: - buildpacks/nodejs: Bump default Node to 0.10.32 + - buildpacks/ruby: Bump default Bundler to 1.7.4 ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) diff --git a/buildpacks/ruby/bin/compile b/buildpacks/ruby/bin/compile index 8ba3906..0c9270a 100755 --- a/buildpacks/ruby/bin/compile +++ b/buildpacks/ruby/bin/compile @@ -118,7 +118,7 @@ fi source ${HOME}/.profile.d/ruby.sh -DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.3'} +DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.4'} if ! $(which bundle &> /dev/null); then tarball_path=$2/rubies/bundler-${DEVSTEP_BUNDLER_VERSION}.gem diff --git a/docs/buildpacks/ruby.md b/docs/buildpacks/ruby.md index fa4e435..c1ffb6b 100644 --- a/docs/buildpacks/ruby.md +++ b/docs/buildpacks/ruby.md @@ -7,7 +7,7 @@ a `Gemfile` is found. The installed Ruby will be the same one that gets installed on Heroku's Cedar 14 stack with a fallback to a Ruby from the Cedar stack. By default Ruby 2.1.3 and -Bundler 1.7.3 will be installed. +Bundler 1.7.4 will be installed. To specify a Ruby version, use the [`ruby` directive](http://bundler.io/v1.6/gemfile_ruby.html) of your project's `Gemfile`, the `DEVSTEP_RUBY_VERSION` environmental variable or From 00567a2c5ad529ff4714410dbb735f8139f90117 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 23 Oct 2014 11:19:01 -0200 Subject: [PATCH 11/39] Move buildpacks and addons code into /stack and simplify Dockerfile by using ENV vars substitution --- Dockerfile | 65 +++++++++---------- {addons => stack/addons}/docker/bin/configure | 0 .../addons}/docker/bin/start-daemon | 0 .../addons}/docker/bin/wrapdocker | 0 .../addons}/memcached/bin/configure | 0 .../addons}/memcached/bin/start-server | 0 .../addons}/postgresql/bin/configure | 0 .../addons}/postgresql/bin/detect | 0 .../addons}/postgresql/bin/start-server | 0 .../addons}/postgresql/conf/pg_hba.conf | 0 .../addons}/postgresql/conf/postgresql.conf | 0 {addons => stack/addons}/redis/bin/configure | 0 {addons => stack/addons}/redis/bin/detect | 0 .../addons}/redis/bin/start-server | 0 .../buildpacks}/bats/bin/compile | 0 .../buildpacks}/bats/bin/detect | 0 .../buildpacks}/golang/bin/compile | 0 .../buildpacks}/golang/bin/detect | 0 .../buildpacks}/inline/bin/compile | 0 .../buildpacks}/inline/bin/detect | 0 .../buildpacks}/nodejs/bin/common.sh | 0 .../buildpacks}/nodejs/bin/compile | 0 .../buildpacks}/nodejs/bin/detect | 0 .../buildpacks}/phantomjs/bin/compile | 0 .../buildpacks}/phantomjs/bin/detect | 0 .../buildpacks}/php/bin/compile | 0 .../buildpacks}/php/bin/detect | 0 .../buildpacks}/php/bin/install-dependencies | 0 .../buildpacks}/python/bin/compile | 0 .../buildpacks}/python/bin/detect | 0 .../python/bin/install-dependencies | 0 .../buildpacks}/python/bin/steps/cryptography | 0 .../buildpacks}/python/bin/steps/pip-install | 0 .../python/bin/steps/pip-uninstall | 0 .../buildpacks}/python/bin/steps/pylibmc | 0 .../buildpacks}/python/bin/steps/python | 0 .../buildpacks}/ruby/bin/compile | 0 .../buildpacks}/ruby/bin/detect | 0 38 files changed, 32 insertions(+), 33 deletions(-) rename {addons => stack/addons}/docker/bin/configure (100%) rename {addons => stack/addons}/docker/bin/start-daemon (100%) rename {addons => stack/addons}/docker/bin/wrapdocker (100%) rename {addons => stack/addons}/memcached/bin/configure (100%) rename {addons => stack/addons}/memcached/bin/start-server (100%) rename {addons => stack/addons}/postgresql/bin/configure (100%) rename {addons => stack/addons}/postgresql/bin/detect (100%) rename {addons => stack/addons}/postgresql/bin/start-server (100%) rename {addons => stack/addons}/postgresql/conf/pg_hba.conf (100%) rename {addons => stack/addons}/postgresql/conf/postgresql.conf (100%) rename {addons => stack/addons}/redis/bin/configure (100%) rename {addons => stack/addons}/redis/bin/detect (100%) rename {addons => stack/addons}/redis/bin/start-server (100%) rename {buildpacks => stack/buildpacks}/bats/bin/compile (100%) rename {buildpacks => stack/buildpacks}/bats/bin/detect (100%) rename {buildpacks => stack/buildpacks}/golang/bin/compile (100%) rename {buildpacks => stack/buildpacks}/golang/bin/detect (100%) rename {buildpacks => stack/buildpacks}/inline/bin/compile (100%) rename {buildpacks => stack/buildpacks}/inline/bin/detect (100%) rename {buildpacks => stack/buildpacks}/nodejs/bin/common.sh (100%) rename {buildpacks => stack/buildpacks}/nodejs/bin/compile (100%) rename {buildpacks => stack/buildpacks}/nodejs/bin/detect (100%) rename {buildpacks => stack/buildpacks}/phantomjs/bin/compile (100%) rename {buildpacks => stack/buildpacks}/phantomjs/bin/detect (100%) rename {buildpacks => stack/buildpacks}/php/bin/compile (100%) rename {buildpacks => stack/buildpacks}/php/bin/detect (100%) rename {buildpacks => stack/buildpacks}/php/bin/install-dependencies (100%) rename {buildpacks => stack/buildpacks}/python/bin/compile (100%) rename {buildpacks => stack/buildpacks}/python/bin/detect (100%) rename {buildpacks => stack/buildpacks}/python/bin/install-dependencies (100%) rename {buildpacks => stack/buildpacks}/python/bin/steps/cryptography (100%) rename {buildpacks => stack/buildpacks}/python/bin/steps/pip-install (100%) rename {buildpacks => stack/buildpacks}/python/bin/steps/pip-uninstall (100%) rename {buildpacks => stack/buildpacks}/python/bin/steps/pylibmc (100%) rename {buildpacks => stack/buildpacks}/python/bin/steps/python (100%) rename {buildpacks => stack/buildpacks}/ruby/bin/compile (100%) rename {buildpacks => stack/buildpacks}/ruby/bin/detect (100%) diff --git a/Dockerfile b/Dockerfile index fd34056..97dd032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ FROM progrium/cedarish:cedar14 MAINTAINER Fabio Rehm "fgrehm@gmail.com" +ENV HOME /home/devstep +ENV DEVSTEP_PATH /opt/devstep +ENV DEVSTEP_CONF /etc/devstep +ENV LANG en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 +ENV LC_CTYPE en_US.UTF-8 + ##################################################################### # Create a default user to avoid using the container as root, we set # the user and group ids to 1000 as it is the most common ids for @@ -13,15 +20,13 @@ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get install -y sudo && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - mkdir -p /home/devstep/cache && \ - mkdir -p /home/devstep/.profile.d && \ - mkdir -p /home/devstep/bin && \ - mkdir -p /home/devstep/log && \ - mkdir -p /opt/devstep/bin && \ - mkdir -p /opt/devstep/buildpacks && \ - mkdir -p /opt/devstep/addons && \ - mkdir -p /etc/devstep/service && \ - mkdir -p /etc/devstep/init.d && \ + mkdir -p $HOME/cache && \ + mkdir -p $HOME/.profile.d && \ + mkdir -p $HOME/bin && \ + mkdir -p $HOME/log && \ + mkdir -p $DEVSTEP_PATH/bin && \ + mkdir -p $DEVSTEP_CONF/service && \ + mkdir -p $DEVSTEP_CONF/init.d && \ echo "developer:x:1000:1000:Developer,,,:/home/devstep:/bin/bash" >> /etc/passwd && \ echo "developer:x:1000:" >> /etc/group && \ echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \ @@ -54,15 +59,15 @@ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libyaml-dev libgdbm-dev libffi-dev libicu-dev --no-install-recommends && \ apt-get install -y postgresql-client mysql-client libsqlite3-dev --no-install-recommends && \ - apt-get install -y software-properties-common bash-completion --no-install-recommends && \ - echo "[client]\nprotocol=tcp\nuser=root" >> /home/devstep/.my.cnf && \ - echo "export PGHOST=localhost" >> /home/devstep/.profile.d/postgresql.sh && \ - echo "export PGUSER=postgres" >> /home/devstep/.profile.d/postgresql.sh && \ apt-get install -y --force-yes vim htop tmux mercurial bzr nodejs libssl0.9.8 --no-install-recommends && \ + apt-get install -y software-properties-common bash-completion --no-install-recommends && \ + echo "[client]\nprotocol=tcp\nuser=root" >> $HOME/.my.cnf && \ + echo "export PGHOST=localhost" >> $HOME/.profile.d/postgresql.sh && \ + echo "export PGUSER=postgres" >> $HOME/.profile.d/postgresql.sh && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - curl -L -s http://stedolan.github.io/jq/download/linux64/jq > /opt/devstep/bin/jq && \ - chmod +x /opt/devstep/bin/jq + curl -L -s http://stedolan.github.io/jq/download/linux64/jq > $DEVSTEP_PATH/bin/jq && \ + chmod +x $DEVSTEP_PATH/bin/jq ##################################################################### # Bring back apt .deb caching as they'll be either removed on the @@ -72,40 +77,34 @@ RUN rm /etc/apt/apt.conf.d/docker-clean ##################################################################### # Devstep buildpacks -ADD buildpacks /opt/devstep/buildpacks -RUN for script in /opt/devstep/buildpacks/*/bin/install-dependencies; do \ +ADD stack/buildpacks $DEVSTEP_PATH/buildpacks +RUN for script in $DEVSTEP_PATH/buildpacks/*/bin/install-dependencies; do \ $script; \ done ##################################################################### # Devstep goodies (ADDed at the end to increase image "cacheability") -ADD stack/bin /opt/devstep/bin -ADD stack/load-env.sh /opt/devstep/load-env.sh -ADD stack/bashrc /home/devstep/.bashrc -ADD addons /opt/devstep/addons +ADD stack /opt/devstep ##################################################################### # Fix permissions, set up init -RUN chown -R developer:developer /home/devstep && \ - chown -R developer:developer /etc/devstep && \ - chown -R developer:developer /opt/devstep && \ +RUN cp $DEVSTEP_PATH/bashrc $HOME/.bashrc && \ + chown -R developer:developer $HOME && \ + chown -R developer:developer $DEVSTEP_PATH && \ + chown -R developer:developer $DEVSTEP_CONF && \ chmod u+s /usr/bin/sudo && \ - ln -s /opt/devstep/bin/fix-permissions /etc/devstep/init.d/05-fix-permissions.sh && \ - ln -s /opt/devstep/bin/create-cache-symlinks /etc/devstep/init.d/10-create-cache-symlinks.sh && \ - ln -s /opt/devstep/bin/forward-linked-ports /etc/devstep/init.d/10-forward-linked-ports.sh && \ - chmod +x /opt/devstep/bin/* && \ - chmod +x /etc/devstep/init.d/* + ln -s $DEVSTEP_PATH/bin/fix-permissions $DEVSTEP_CONF/init.d/05-fix-permissions.sh && \ + ln -s $DEVSTEP_PATH/bin/create-cache-symlinks $DEVSTEP_CONF/init.d/10-create-cache-symlinks.sh && \ + ln -s $DEVSTEP_PATH/bin/forward-linked-ports $DEVSTEP_CONF/init.d/10-forward-linked-ports.sh && \ + chmod +x $DEVSTEP_PATH/bin/* && \ + chmod +x $DEVSTEP_CONF/init.d/* ##################################################################### # Setup locales and default user USER developer ENV USER developer -ENV HOME /home/devstep -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE en_US.UTF-8 ##################################################################### # Use our init diff --git a/addons/docker/bin/configure b/stack/addons/docker/bin/configure similarity index 100% rename from addons/docker/bin/configure rename to stack/addons/docker/bin/configure diff --git a/addons/docker/bin/start-daemon b/stack/addons/docker/bin/start-daemon similarity index 100% rename from addons/docker/bin/start-daemon rename to stack/addons/docker/bin/start-daemon diff --git a/addons/docker/bin/wrapdocker b/stack/addons/docker/bin/wrapdocker similarity index 100% rename from addons/docker/bin/wrapdocker rename to stack/addons/docker/bin/wrapdocker diff --git a/addons/memcached/bin/configure b/stack/addons/memcached/bin/configure similarity index 100% rename from addons/memcached/bin/configure rename to stack/addons/memcached/bin/configure diff --git a/addons/memcached/bin/start-server b/stack/addons/memcached/bin/start-server similarity index 100% rename from addons/memcached/bin/start-server rename to stack/addons/memcached/bin/start-server diff --git a/addons/postgresql/bin/configure b/stack/addons/postgresql/bin/configure similarity index 100% rename from addons/postgresql/bin/configure rename to stack/addons/postgresql/bin/configure diff --git a/addons/postgresql/bin/detect b/stack/addons/postgresql/bin/detect similarity index 100% rename from addons/postgresql/bin/detect rename to stack/addons/postgresql/bin/detect diff --git a/addons/postgresql/bin/start-server b/stack/addons/postgresql/bin/start-server similarity index 100% rename from addons/postgresql/bin/start-server rename to stack/addons/postgresql/bin/start-server diff --git a/addons/postgresql/conf/pg_hba.conf b/stack/addons/postgresql/conf/pg_hba.conf similarity index 100% rename from addons/postgresql/conf/pg_hba.conf rename to stack/addons/postgresql/conf/pg_hba.conf diff --git a/addons/postgresql/conf/postgresql.conf b/stack/addons/postgresql/conf/postgresql.conf similarity index 100% rename from addons/postgresql/conf/postgresql.conf rename to stack/addons/postgresql/conf/postgresql.conf diff --git a/addons/redis/bin/configure b/stack/addons/redis/bin/configure similarity index 100% rename from addons/redis/bin/configure rename to stack/addons/redis/bin/configure diff --git a/addons/redis/bin/detect b/stack/addons/redis/bin/detect similarity index 100% rename from addons/redis/bin/detect rename to stack/addons/redis/bin/detect diff --git a/addons/redis/bin/start-server b/stack/addons/redis/bin/start-server similarity index 100% rename from addons/redis/bin/start-server rename to stack/addons/redis/bin/start-server diff --git a/buildpacks/bats/bin/compile b/stack/buildpacks/bats/bin/compile similarity index 100% rename from buildpacks/bats/bin/compile rename to stack/buildpacks/bats/bin/compile diff --git a/buildpacks/bats/bin/detect b/stack/buildpacks/bats/bin/detect similarity index 100% rename from buildpacks/bats/bin/detect rename to stack/buildpacks/bats/bin/detect diff --git a/buildpacks/golang/bin/compile b/stack/buildpacks/golang/bin/compile similarity index 100% rename from buildpacks/golang/bin/compile rename to stack/buildpacks/golang/bin/compile diff --git a/buildpacks/golang/bin/detect b/stack/buildpacks/golang/bin/detect similarity index 100% rename from buildpacks/golang/bin/detect rename to stack/buildpacks/golang/bin/detect diff --git a/buildpacks/inline/bin/compile b/stack/buildpacks/inline/bin/compile similarity index 100% rename from buildpacks/inline/bin/compile rename to stack/buildpacks/inline/bin/compile diff --git a/buildpacks/inline/bin/detect b/stack/buildpacks/inline/bin/detect similarity index 100% rename from buildpacks/inline/bin/detect rename to stack/buildpacks/inline/bin/detect diff --git a/buildpacks/nodejs/bin/common.sh b/stack/buildpacks/nodejs/bin/common.sh similarity index 100% rename from buildpacks/nodejs/bin/common.sh rename to stack/buildpacks/nodejs/bin/common.sh diff --git a/buildpacks/nodejs/bin/compile b/stack/buildpacks/nodejs/bin/compile similarity index 100% rename from buildpacks/nodejs/bin/compile rename to stack/buildpacks/nodejs/bin/compile diff --git a/buildpacks/nodejs/bin/detect b/stack/buildpacks/nodejs/bin/detect similarity index 100% rename from buildpacks/nodejs/bin/detect rename to stack/buildpacks/nodejs/bin/detect diff --git a/buildpacks/phantomjs/bin/compile b/stack/buildpacks/phantomjs/bin/compile similarity index 100% rename from buildpacks/phantomjs/bin/compile rename to stack/buildpacks/phantomjs/bin/compile diff --git a/buildpacks/phantomjs/bin/detect b/stack/buildpacks/phantomjs/bin/detect similarity index 100% rename from buildpacks/phantomjs/bin/detect rename to stack/buildpacks/phantomjs/bin/detect diff --git a/buildpacks/php/bin/compile b/stack/buildpacks/php/bin/compile similarity index 100% rename from buildpacks/php/bin/compile rename to stack/buildpacks/php/bin/compile diff --git a/buildpacks/php/bin/detect b/stack/buildpacks/php/bin/detect similarity index 100% rename from buildpacks/php/bin/detect rename to stack/buildpacks/php/bin/detect diff --git a/buildpacks/php/bin/install-dependencies b/stack/buildpacks/php/bin/install-dependencies similarity index 100% rename from buildpacks/php/bin/install-dependencies rename to stack/buildpacks/php/bin/install-dependencies diff --git a/buildpacks/python/bin/compile b/stack/buildpacks/python/bin/compile similarity index 100% rename from buildpacks/python/bin/compile rename to stack/buildpacks/python/bin/compile diff --git a/buildpacks/python/bin/detect b/stack/buildpacks/python/bin/detect similarity index 100% rename from buildpacks/python/bin/detect rename to stack/buildpacks/python/bin/detect diff --git a/buildpacks/python/bin/install-dependencies b/stack/buildpacks/python/bin/install-dependencies similarity index 100% rename from buildpacks/python/bin/install-dependencies rename to stack/buildpacks/python/bin/install-dependencies diff --git a/buildpacks/python/bin/steps/cryptography b/stack/buildpacks/python/bin/steps/cryptography similarity index 100% rename from buildpacks/python/bin/steps/cryptography rename to stack/buildpacks/python/bin/steps/cryptography diff --git a/buildpacks/python/bin/steps/pip-install b/stack/buildpacks/python/bin/steps/pip-install similarity index 100% rename from buildpacks/python/bin/steps/pip-install rename to stack/buildpacks/python/bin/steps/pip-install diff --git a/buildpacks/python/bin/steps/pip-uninstall b/stack/buildpacks/python/bin/steps/pip-uninstall similarity index 100% rename from buildpacks/python/bin/steps/pip-uninstall rename to stack/buildpacks/python/bin/steps/pip-uninstall diff --git a/buildpacks/python/bin/steps/pylibmc b/stack/buildpacks/python/bin/steps/pylibmc similarity index 100% rename from buildpacks/python/bin/steps/pylibmc rename to stack/buildpacks/python/bin/steps/pylibmc diff --git a/buildpacks/python/bin/steps/python b/stack/buildpacks/python/bin/steps/python similarity index 100% rename from buildpacks/python/bin/steps/python rename to stack/buildpacks/python/bin/steps/python diff --git a/buildpacks/ruby/bin/compile b/stack/buildpacks/ruby/bin/compile similarity index 100% rename from buildpacks/ruby/bin/compile rename to stack/buildpacks/ruby/bin/compile diff --git a/buildpacks/ruby/bin/detect b/stack/buildpacks/ruby/bin/detect similarity index 100% rename from buildpacks/ruby/bin/detect rename to stack/buildpacks/ruby/bin/detect From 0d1e6a42909301bb5faf5623f83dcb7a4891535e Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 24 Oct 2014 10:35:39 -0200 Subject: [PATCH 12/39] buildpacks/golang: Bump default to 1.3.3 --- CHANGELOG.md | 1 + stack/buildpacks/golang/bin/compile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f190d03..4d7c486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ BREAKING CHANGES: IMPROVEMENTS: + - buildpacks/golang: Bump default version to 1.3.3 - buildpacks/nodejs: Bump default Node to 0.10.32 - buildpacks/ruby: Bump default Bundler to 1.7.4 diff --git a/stack/buildpacks/golang/bin/compile b/stack/buildpacks/golang/bin/compile index 5da7525..2b74ae4 100755 --- a/stack/buildpacks/golang/bin/compile +++ b/stack/buildpacks/golang/bin/compile @@ -63,7 +63,7 @@ elif test -d $build/.git ; then name=$(git config --get-regexp '^remote.+\.url' | grep github | head -n1 | cut -f2 -d' ' | sed 's/^\(git\|https\):\/\///' | sed 's/^\w\+@//' | sed 's/:/\//' | sed 's/\.git$//') popd &> /dev/null fi -ver=${ver:-go${GOVERSION:-1.3.1}} +ver=${ver:-go${GOVERSION:-1.3.3}} file=${GOFILE:-$ver.$(uname|tr A-Z a-z)-amd64.tar.gz} url=${GOURL:-$(urlfor $ver $file)} From 84ed271f2ce55c6997507f47ca0ee840647a50e3 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Tue, 28 Oct 2014 10:15:56 -0200 Subject: [PATCH 13/39] buildpacks/ruby: Install 2.1.4 by default --- CHANGELOG.md | 1 + docs/buildpacks/ruby.md | 2 +- stack/buildpacks/ruby/bin/compile | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7c486..ba76e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ IMPROVEMENTS: - buildpacks/golang: Bump default version to 1.3.3 - buildpacks/nodejs: Bump default Node to 0.10.32 - buildpacks/ruby: Bump default Bundler to 1.7.4 + - buildpacks/ruby: Bump default Ruby to 2.1.4 ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) diff --git a/docs/buildpacks/ruby.md b/docs/buildpacks/ruby.md index c1ffb6b..e2801fc 100644 --- a/docs/buildpacks/ruby.md +++ b/docs/buildpacks/ruby.md @@ -6,7 +6,7 @@ use [Bundler](http://bundler.io/) for dependency management. It will be used if a `Gemfile` is found. The installed Ruby will be the same one that gets installed on Heroku's Cedar 14 -stack with a fallback to a Ruby from the Cedar stack. By default Ruby 2.1.3 and +stack with a fallback to a Ruby from the Cedar stack. By default Ruby 2.1.4 and Bundler 1.7.4 will be installed. To specify a Ruby version, use the [`ruby` directive](http://bundler.io/v1.6/gemfile_ruby.html) diff --git a/stack/buildpacks/ruby/bin/compile b/stack/buildpacks/ruby/bin/compile index 0c9270a..d695a90 100755 --- a/stack/buildpacks/ruby/bin/compile +++ b/stack/buildpacks/ruby/bin/compile @@ -84,7 +84,7 @@ install_phantomjs() { DEVSTEP_RUBY_VERSION=${DEVSTEP_RUBY_VERSION:-$(version_from_ruby_version)} DEVSTEP_RUBY_VERSION=${DEVSTEP_RUBY_VERSION:-$(version_from_gemfile)} if [ -z "$DEVSTEP_RUBY_VERSION" ]; then - DEVSTEP_RUBY_VERSION='2.1.3' + DEVSTEP_RUBY_VERSION='2.1.4' echo "Unable to identify the project ruby version, setting to ${DEVSTEP_RUBY_VERSION}" fi From d76d9c7c08a142f3bbeccc42d301c7d47bbcef3d Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 29 Oct 2014 21:44:45 -0200 Subject: [PATCH 14/39] addons/docker: Updates to accomodate recent changes on folders organization [GH-63] --- stack/addons/docker/bin/configure | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/stack/addons/docker/bin/configure b/stack/addons/docker/bin/configure index ad5d286..2e121a4 100755 --- a/stack/addons/docker/bin/configure +++ b/stack/addons/docker/bin/configure @@ -4,10 +4,12 @@ set -e # fail fast set -o pipefail # dont ignore exit codes when piping output # set -x # enable debugging -CACHE_DIR=${2:-"${HOME}/cache"} +CACHE_DIR=${2:-"${HOME}/cache/docker"} DOCKER_CMD="${HOME}/bin/docker" URL=https://get.docker.io/builds/Linux/x86_64/docker-latest +mkdir -p $CACHE_DIR + if ! [ -x "${DOCKER_CMD}" ]; then if ! [ -f "${CACHE_DIR}/docker" ]; then echo "-----> [docker] Downloading latest version from ${URL}" @@ -27,14 +29,14 @@ echo "-----> [docker] Installed $(${HOME}/bin/docker --version)" addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" -cp ${addon_basedir}/wrapdocker "/etc/my_init.d/00-wrapdocker.sh" -chmod +x "/etc/my_init.d/00-wrapdocker.sh" +cp ${addon_basedir}/wrapdocker "$DEVSTEP_CONF/init.d/00-wrapdocker.sh" +chmod +x "$DEVSTEP_CONF/init.d/00-wrapdocker.sh" ${addon_basedir}/wrapdocker -cp $addon_basedir/start-daemon /etc/my_init.d/01-start-docker.sh -chmod +x /etc/my_init.d/01-start-docker.sh +cp $addon_basedir/start-daemon $DEVSTEP_CONF/init.d/01-start-docker.sh +chmod +x $DEVSTEP_CONF/init.d/01-start-docker.sh echo "-----> [docker] Starting daemon" -/etc/my_init.d/01-start-docker.sh &>/dev/null || true +$DEVSTEP_CONF/init.d/01-start-docker.sh &>/dev/null || true echo "-----> [docker] Finished configuration!" From 88484eab7607f25de420ea078be40412d543cc1c Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 29 Oct 2014 21:48:13 -0200 Subject: [PATCH 15/39] addons/docker: Install 1.3.0 by default and add support for specifying a Docker version using the `DEVSTEP_DOCKER_VERSION` env var --- CHANGELOG.md | 2 ++ docs/addons/docker.md | 5 ++++- stack/addons/docker/bin/configure | 11 ++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba76e65..a372c1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ BREAKING CHANGES: IMPROVEMENTS: + - addons/docker: Lock installation to 1.3.0 instead of latest + - addons/docker: Support specifying a Docker version to be installed with `DEVSTEP_DOCKER_VERSION` env var - buildpacks/golang: Bump default version to 1.3.3 - buildpacks/nodejs: Bump default Node to 0.10.32 - buildpacks/ruby: Bump default Bundler to 1.7.4 diff --git a/docs/addons/docker.md b/docs/addons/docker.md index 0ec74b6..af31e66 100644 --- a/docs/addons/docker.md +++ b/docs/addons/docker.md @@ -1,10 +1,13 @@ # Docker Addon -------------- -This addon will install the latest Docker version from https://get.docker.io/builds/Linux/x86_64/docker-latest +This addon will install Docker 1.3.0 from https://get.docker.io/builds/Linux/x86_64 and will set things up for running nested Docker containers based on https://github.com/jpetazzo/dind. In order to use it, you need to provide both the `--privileged` flag and because `/var/lib/docker` cannot be on AUFS, so we need to make it a volume with `-v /var/lib/docker`. To install it you can run `configure-addons docker` from within the container. + +To specify a Docker version, use the the `DEVSTEP_DOCKER_VERSION` environmental +variable. diff --git a/stack/addons/docker/bin/configure b/stack/addons/docker/bin/configure index 2e121a4..c20e254 100755 --- a/stack/addons/docker/bin/configure +++ b/stack/addons/docker/bin/configure @@ -6,17 +6,18 @@ set -o pipefail # dont ignore exit codes when piping output CACHE_DIR=${2:-"${HOME}/cache/docker"} DOCKER_CMD="${HOME}/bin/docker" -URL=https://get.docker.io/builds/Linux/x86_64/docker-latest +DEVSTEP_DOCKER_VERSION=${DEVSTEP_DOCKER_VERSION:-"1.3.0"} +URL=https://get.docker.com/builds/Linux/x86_64/docker-1.3.0 mkdir -p $CACHE_DIR if ! [ -x "${DOCKER_CMD}" ]; then - if ! [ -f "${CACHE_DIR}/docker" ]; then - echo "-----> [docker] Downloading latest version from ${URL}" - curl -l -s $URL > ${CACHE_DIR}/docker + if ! [ -f "${CACHE_DIR}/docker-${DEVSTEP_DOCKER_VERSION}" ]; then + echo "-----> [docker] Downloading ${DEVSTEP_DOCKER_VERSION} version from ${URL}" + curl -l -s $URL > ${CACHE_DIR}/docker-${DEVSTEP_DOCKER_VERSION} fi - cp ${CACHE_DIR}/docker ${DOCKER_CMD} + cp ${CACHE_DIR}/docker-${DEVSTEP_DOCKER_VERSION} ${DOCKER_CMD} chmod +x "${DOCKER_CMD}" fi From 4e7239327009d2fa711a0a11c674197d769dd76a Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 29 Oct 2014 22:02:04 -0200 Subject: [PATCH 16/39] addons: Updates to accomodate recent changes on folders organization [GH-63] --- stack/addons/memcached/bin/configure | 8 ++++---- stack/addons/postgresql/bin/configure | 8 ++++---- stack/addons/redis/bin/configure | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/stack/addons/memcached/bin/configure b/stack/addons/memcached/bin/configure index 23fe427..5b1f1a8 100755 --- a/stack/addons/memcached/bin/configure +++ b/stack/addons/memcached/bin/configure @@ -12,11 +12,11 @@ fi addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" echo "-----> [memcached] Enabling autostart" -mkdir -p /etc/service/memcached -cp $addon_basedir/start-server /etc/service/memcached/run -chmod +x /etc/service/memcached/run +mkdir -p ${DEVSTEP_CONF}/service/memcached +cp $addon_basedir/start-server ${DEVSTEP_CONF}/service/memcached/run +chmod +x ${DEVSTEP_CONF}/service/memcached/run echo "-----> [memcached] Starting server" -sv start /etc/service/memcached &>/dev/null || true +sv start ${DEVSTEP_CONF}/service/memcached &>/dev/null || true echo "-----> [memcached] Finished configuration!" diff --git a/stack/addons/postgresql/bin/configure b/stack/addons/postgresql/bin/configure index 83f8fc8..5b145b2 100755 --- a/stack/addons/postgresql/bin/configure +++ b/stack/addons/postgresql/bin/configure @@ -18,15 +18,15 @@ fi addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" echo "-----> [postgres] Enabling autostart" -mkdir -p /etc/service/postgresql +mkdir -p ${DEVSTEP_CONF}/service/postgresql sudo cp $(readlink -f $addon_basedir/../conf/postgresql.conf) /etc/postgresql/9.3/main/postgresql.conf sudo cp $(readlink -f $addon_basedir/../conf/pg_hba.conf) /etc/postgresql/9.3/main/pg_hba.conf -cp $addon_basedir/start-server /etc/service/postgresql/run -chmod +x /etc/service/postgresql/run +cp $addon_basedir/start-server ${DEVSTEP_CONF}/service/postgresql/run +chmod +x ${DEVSTEP_CONF}/service/postgresql/run echo "-----> [postgres] Starting server" -sv start /etc/service/postgresql &>/dev/null || true +sv start ${DEVSTEP_CONF}/service/postgresql &>/dev/null || true echo "-----> [postgres] Finished configuration!" diff --git a/stack/addons/redis/bin/configure b/stack/addons/redis/bin/configure index bfe2cc7..ea22db9 100755 --- a/stack/addons/redis/bin/configure +++ b/stack/addons/redis/bin/configure @@ -16,11 +16,11 @@ fi addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" echo "-----> [redis] Enabling autostart" -mkdir -p /etc/service/redis -cp $addon_basedir/start-server /etc/service/redis/run -chmod +x /etc/service/redis/run +mkdir -p ${DEVSTEP_CONF}/service/redis +cp $addon_basedir/start-server ${DEVSTEP_CONF}/service/redis/run +chmod +x ${DEVSTEP_CONF}/service/redis/run echo "-----> [redis] Starting server" -sv start /etc/service/redis &>/dev/null || true +sv start ${DEVSTEP_CONF}/service/redis &>/dev/null || true echo "-----> [redis] Finished configuration!" From f546923212bf349fec050f7136c93ba3c08f08bb Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:13:37 -0200 Subject: [PATCH 17/39] stack: New Oracle Java 8 addon --- docs/addons/oracle-java.md | 8 ++++++++ stack/addons/oracle-java-8/bin/configure | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 docs/addons/oracle-java.md create mode 100755 stack/addons/oracle-java-8/bin/configure diff --git a/docs/addons/oracle-java.md b/docs/addons/oracle-java.md new file mode 100644 index 0000000..4acddac --- /dev/null +++ b/docs/addons/oracle-java.md @@ -0,0 +1,8 @@ +# Oracle Java Addon +------------------- + +This addon will install the latest version available for the Ubuntu 14.04 release +and will leverage Devstep's caching mechanism so that the downloaded files are +reused between environments. + +To install it you can run `configure-addons oracle-java-8` from within the container. diff --git a/stack/addons/oracle-java-8/bin/configure b/stack/addons/oracle-java-8/bin/configure new file mode 100755 index 0000000..a9a1672 --- /dev/null +++ b/stack/addons/oracle-java-8/bin/configure @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +CACHE_DIR=${2:-"${HOME}/cache/oracle-java-8"} + +if $(which java &>/dev/null); then + echo 'Java already installed, skipping' + exit 0 +fi + +echo '-----> Installing Java 8...' + +mkdir -p $CACHE_DIR +sudo ln -s $CACHE_DIR /var/cache/oracle-jdk8-installer + +( + sudo add-apt-repository -y ppa:webupd8team/java + sudo apt-get update + echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections + sudo apt-get install -y oracle-java8-installer +) &>> /tmp/configure-oracle-java-8.log && \ +rm /tmp/configure-oracle-java-8.log + +echo "-----> Installed $(java -version 2>&1 | head -n 1)" From 3a0ec35a9814451b90e1c2db730bcfcfa9477a34 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:19:14 -0200 Subject: [PATCH 18/39] addons/redis: Remove installation log in case of success --- stack/addons/redis/bin/configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack/addons/redis/bin/configure b/stack/addons/redis/bin/configure index ea22db9..f1db041 100755 --- a/stack/addons/redis/bin/configure +++ b/stack/addons/redis/bin/configure @@ -10,7 +10,8 @@ if ! $(which redis-server &> /dev/null); then sudo add-apt-repository -y ppa:rwky/redis && sudo apt-get update -q && sudo apt-get install redis-server -y --force-yes -q - ) &>> /tmp/configure-redis.log + ) &>> /tmp/configure-redis.log && \ + rm /tmp-configure-redis.log fi addon_basedir="$( cd -P "$( dirname "$0" )" && pwd )" From 02db386d331bf69f998199ff4589e37518a06983 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:23:04 -0200 Subject: [PATCH 19/39] buildpacks/ruby: Update default ruby to 2.2.0 and bundler to 1.7.12 --- stack/buildpacks/ruby/bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack/buildpacks/ruby/bin/compile b/stack/buildpacks/ruby/bin/compile index d695a90..f5ba1a5 100755 --- a/stack/buildpacks/ruby/bin/compile +++ b/stack/buildpacks/ruby/bin/compile @@ -84,7 +84,7 @@ install_phantomjs() { DEVSTEP_RUBY_VERSION=${DEVSTEP_RUBY_VERSION:-$(version_from_ruby_version)} DEVSTEP_RUBY_VERSION=${DEVSTEP_RUBY_VERSION:-$(version_from_gemfile)} if [ -z "$DEVSTEP_RUBY_VERSION" ]; then - DEVSTEP_RUBY_VERSION='2.1.4' + DEVSTEP_RUBY_VERSION='2.2.0' echo "Unable to identify the project ruby version, setting to ${DEVSTEP_RUBY_VERSION}" fi @@ -118,7 +118,7 @@ fi source ${HOME}/.profile.d/ruby.sh -DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.4'} +DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.12'} if ! $(which bundle &> /dev/null); then tarball_path=$2/rubies/bundler-${DEVSTEP_BUNDLER_VERSION}.gem From 4c4ee1e7d2fea8061711d7cb3d3a641d80f1df9c Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:25:24 -0200 Subject: [PATCH 20/39] buildpacks/nodejs: Update default version to 0.10.35 --- stack/buildpacks/nodejs/bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack/buildpacks/nodejs/bin/compile b/stack/buildpacks/nodejs/bin/compile index 187585c..ff31343 100755 --- a/stack/buildpacks/nodejs/bin/compile +++ b/stack/buildpacks/nodejs/bin/compile @@ -29,8 +29,8 @@ fi # Resolve node version using semver.io _node_version() { curl --connect-timeout 30 --silent --get --data-urlencode "range=${semver_range}" https://semver.io/node/resolve || { - echo ' Unable to fetch node version from semver.io, using latest known (0.10.32)' >&2 - echo '0.10.32' + echo ' Unable to fetch node version from semver.io, using latest known (0.10.35)' >&2 + echo '0.10.35' } } node_version=$(_node_version) From 1373fc033cc3a3e20500b6667731d3bff0f22feb Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:31:22 -0200 Subject: [PATCH 21/39] buildpacks/golang: Update default version to 1.4.1 --- stack/buildpacks/golang/bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack/buildpacks/golang/bin/compile b/stack/buildpacks/golang/bin/compile index 2b74ae4..1f65671 100755 --- a/stack/buildpacks/golang/bin/compile +++ b/stack/buildpacks/golang/bin/compile @@ -63,7 +63,7 @@ elif test -d $build/.git ; then name=$(git config --get-regexp '^remote.+\.url' | grep github | head -n1 | cut -f2 -d' ' | sed 's/^\(git\|https\):\/\///' | sed 's/^\w\+@//' | sed 's/:/\//' | sed 's/\.git$//') popd &> /dev/null fi -ver=${ver:-go${GOVERSION:-1.3.3}} +ver=${ver:-go${GOVERSION:-1.4.1}} file=${GOFILE:-$ver.$(uname|tr A-Z a-z)-amd64.tar.gz} url=${GOURL:-$(urlfor $ver $file)} From b2025824ac527619795f50b09457f1ca908f33c3 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:33:22 -0200 Subject: [PATCH 22/39] Update CHANGELOG --- CHANGELOG.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a372c1d..2cf3f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,27 @@ BREAKING CHANGES: - Switched to the latest progrium/cedarish image which uses an unmodified Heroku `cedar14.sh` base stack source. More info [here](https://github.com/progrium/cedarish/commit/71e2a4af8d300c94783720d13eac79d084a35a75) + - Organization of Devstep's "stack" within the Docker image got changed, please see + [GH-63] for more information + +[GH-63]: https://github.com/fgrehm/devstep/issues/63 + +FEATURES: + + - [New Oracle Java 8 addon](http://fgrehm.viewdocs.io/devstep/addons/oracle-java) IMPROVEMENTS: - addons/docker: Lock installation to 1.3.0 instead of latest - addons/docker: Support specifying a Docker version to be installed with `DEVSTEP_DOCKER_VERSION` env var - - buildpacks/golang: Bump default version to 1.3.3 - - buildpacks/nodejs: Bump default Node to 0.10.32 - - buildpacks/ruby: Bump default Bundler to 1.7.4 - - buildpacks/ruby: Bump default Ruby to 2.1.4 + - buildpacks/golang: Bump default version to 1.4.1 + - buildpacks/nodejs: Bump default Node to 0.10.35 + - buildpacks/php: Backport recent oficial Heroku buildpack updates + - buildpacks/php: Download buildpack dependencies on demand + - buildpacks/python: Backport recent oficial Heroku buildpack updates + - buildpacks/python: Download buildpack dependencies on demand + - buildpacks/ruby: Bump default Bundler to 1.7.12 + - buildpacks/ruby: Bump default Ruby to 2.2.0 ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) From ac066f18ef11e0b359cc9ac7086cc14e78881fb4 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:54:22 -0200 Subject: [PATCH 23/39] baseimage: Multiline ENV on Dockerfile Closes GH-88 --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97dd032..8966484 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM progrium/cedarish:cedar14 MAINTAINER Fabio Rehm "fgrehm@gmail.com" -ENV HOME /home/devstep -ENV DEVSTEP_PATH /opt/devstep -ENV DEVSTEP_CONF /etc/devstep -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LC_CTYPE en_US.UTF-8 +ENV HOME=/home/devstep \ + DEVSTEP_PATH=/opt/devstep \ + DEVSTEP_CONF=/etc/devstep \ + LANG=en_US.UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LC_CTYPE=en_US.UTF-8 ##################################################################### # Create a default user to avoid using the container as root, we set @@ -42,8 +42,6 @@ RUN DEBIAN_FRONTEND=noninteractive && \ rm -rf /var/lib/apt/lists/* ##################################################################### -# * Install dependencies for rubies, php and possibly other programming -# language envs as well # * Install and configure PostgreSQL and MySQL clients # * Install bash-completion to save us a few keystrokes # * Install vim because editing files with plain old vi sucks @@ -57,7 +55,7 @@ RUN DEBIAN_FRONTEND=noninteractive && \ RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ - apt-get install -y gawk libreadline5 libmcrypt4 libaprutil1 libyaml-dev libgdbm-dev libffi-dev libicu-dev --no-install-recommends && \ + apt-get install -y libreadline5 libmcrypt4 libffi-dev --no-install-recommends && \ apt-get install -y postgresql-client mysql-client libsqlite3-dev --no-install-recommends && \ apt-get install -y --force-yes vim htop tmux mercurial bzr nodejs libssl0.9.8 --no-install-recommends && \ apt-get install -y software-properties-common bash-completion --no-install-recommends && \ From 1f9656f06dcc97c2534a14849679a16ec7798307 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 19:55:40 -0200 Subject: [PATCH 24/39] buildpacks/nodejs: Do not install node if already installed --- CHANGELOG.md | 4 ++++ stack/buildpacks/nodejs/bin/compile | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cf3f3d..e95bb82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ IMPROVEMENTS: - buildpacks/ruby: Bump default Bundler to 1.7.12 - buildpacks/ruby: Bump default Ruby to 2.2.0 +BUG FIXES: + + - buildpacks/nodejs: Skip Node.js installation if already installed + ## [0.2.0](https://github.com/fgrehm/devstep/compare/v0.1.0...v0.2.0) (2014-09-24) BREAKING CHANGES: diff --git a/stack/buildpacks/nodejs/bin/compile b/stack/buildpacks/nodejs/bin/compile index ff31343..3674378 100755 --- a/stack/buildpacks/nodejs/bin/compile +++ b/stack/buildpacks/nodejs/bin/compile @@ -19,6 +19,13 @@ source $bp_dir/bin/common.sh # Output npm debug info on error trap cat_npm_debug_log ERR +if [ -d ${HOME}/nodejs ]; then + echo 'Node.js already installed, skipping' +else + +# Indentation is intentionally weird here in order to make our lives easier when +# bringing in updates from the official heroku buildpack + # Look in package.json's engines.node field for a semver range if [ -f $build_dir/package.json ]; then semver_range=$(cat $build_dir/package.json | ${DEVSTEP_BIN}/jq -r .engines.node) @@ -65,6 +72,7 @@ else fi mkdir -p ${HOME}/nodejs tar xzf $tarball_path -C ${HOME}/nodejs --strip-components=1 + export PATH="${HOME}/nodejs/bin:$build_dir/node_modules/.bin:$PATH" export NODE_PATH="${HOME}/nodejs/lib/node_modules:" @@ -73,6 +81,8 @@ status "Building runtime environment" echo "export PATH=\"${HOME}/nodejs/bin:$build_dir/node_modules/.bin:\$PATH\";" > ${HOME}/.profile.d/nodejs.sh echo "export NODE_PATH=\"${HOME}/nodejs/lib/node_modules:\";" >> ${HOME}/.profile.d/nodejs.sh +fi + # Cache npm packages on host machine npm config set cache $cache_dir/npm From ebff6d1a87dd43de1f6e0e3d67736b76163949ad Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 16 Jan 2015 22:55:02 -0200 Subject: [PATCH 25/39] stack/init: Read DEVSTEP_LOG [GH-77] [GH-75] --- stack/bin/entrypoint | 2 +- stack/bin/init | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/stack/bin/entrypoint b/stack/bin/entrypoint index 2b912ef..72a483d 100755 --- a/stack/bin/entrypoint +++ b/stack/bin/entrypoint @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # This is the entrypoint for Devstep images that loads the environment # before running the commands and does some small cleanup on the container diff --git a/stack/bin/init b/stack/bin/init index 9afe4c4..2e358d4 100755 --- a/stack/bin/init +++ b/stack/bin/init @@ -253,6 +253,17 @@ parser.add_argument('--quiet', dest = 'log_level', args = parser.parse_args() log_level = args.log_level +if os.getenv('DEVSTEP_LOG', None) != None: + level = os.environ['DEVSTEP_LOG'].lower() + if level == 'debug': + log_level = LOG_LEVEL_DEBUG + elif level == 'info': + log_level = LOG_LEVEL_INFO + elif level == 'error': + log_level = LOG_LEVEL_ERROR + elif level == 'warn': + log_level = LOG_LEVEL_WARN + if args.skip_runit and len(args.main_command) == 0: error("When --skip-runit is given, you must also pass a main command.") sys.exit(1) From 7af710a0d6ad6bbe4a593cfac98ab915330ad98b Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 17 Jan 2015 12:14:06 -0200 Subject: [PATCH 26/39] stack: Final tweaks for basic log level support [GH-77] [GH-75] --- CHANGELOG.md | 1 + stack/bin/build-project | 4 ++++ stack/bin/init | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e95bb82..9efd216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ FEATURES: IMPROVEMENTS: + - Reduced output by default and added support for `DEVSTEP_LOG` for setting the log level - addons/docker: Lock installation to 1.3.0 instead of latest - addons/docker: Support specifying a Docker version to be installed with `DEVSTEP_DOCKER_VERSION` env var - buildpacks/golang: Bump default version to 1.4.1 diff --git a/stack/bin/build-project b/stack/bin/build-project index 295097b..dc2fa9f 100755 --- a/stack/bin/build-project +++ b/stack/bin/build-project @@ -2,6 +2,10 @@ # usage: build-project -b -b set -eo pipefail +if [ "${DEVSTEP_LOG}" = 'debug' ]; then + set -x +fi + usage() { cat < Date: Tue, 20 Jan 2015 23:08:33 -0200 Subject: [PATCH 27/39] stack: Introduce script to wrap `docker exec` Closes GH-84 --- stack/bin/exec-entrypoint | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 stack/bin/exec-entrypoint diff --git a/stack/bin/exec-entrypoint b/stack/bin/exec-entrypoint new file mode 100755 index 0000000..52083dc --- /dev/null +++ b/stack/bin/exec-entrypoint @@ -0,0 +1,7 @@ +#!/bin/bash -l + +# This is the entrypoint for Devstep exec commands that loads the environment +# before running the commands + +source /opt/devstep/load-env.sh +eval "$@" From 40317e67a4d82c11964696b5ccac693bd43d3674 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 21 Jan 2015 01:13:34 -0200 Subject: [PATCH 28/39] addons/docker: Lock to 1.4.1 --- CHANGELOG.md | 2 +- stack/addons/docker/bin/configure | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9efd216..118c3af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ FEATURES: IMPROVEMENTS: - Reduced output by default and added support for `DEVSTEP_LOG` for setting the log level - - addons/docker: Lock installation to 1.3.0 instead of latest + - addons/docker: Lock installation to 1.4.1 instead of latest - addons/docker: Support specifying a Docker version to be installed with `DEVSTEP_DOCKER_VERSION` env var - buildpacks/golang: Bump default version to 1.4.1 - buildpacks/nodejs: Bump default Node to 0.10.35 diff --git a/stack/addons/docker/bin/configure b/stack/addons/docker/bin/configure index c20e254..934de60 100755 --- a/stack/addons/docker/bin/configure +++ b/stack/addons/docker/bin/configure @@ -6,8 +6,8 @@ set -o pipefail # dont ignore exit codes when piping output CACHE_DIR=${2:-"${HOME}/cache/docker"} DOCKER_CMD="${HOME}/bin/docker" -DEVSTEP_DOCKER_VERSION=${DEVSTEP_DOCKER_VERSION:-"1.3.0"} -URL=https://get.docker.com/builds/Linux/x86_64/docker-1.3.0 +DEVSTEP_DOCKER_VERSION=${DEVSTEP_DOCKER_VERSION:-"1.4.1"} +URL=https://get.docker.com/builds/Linux/x86_64/docker-${DEVSTEP_DOCKER_VERSION} mkdir -p $CACHE_DIR From f25b434f25928e29c3b46cc8cf34fb59831d3a67 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 21 Jan 2015 01:14:06 -0200 Subject: [PATCH 29/39] Marker to easily spot the block that comes from heroku buildpack --- stack/buildpacks/nodejs/bin/compile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack/buildpacks/nodejs/bin/compile b/stack/buildpacks/nodejs/bin/compile index 3674378..d93887f 100755 --- a/stack/buildpacks/nodejs/bin/compile +++ b/stack/buildpacks/nodejs/bin/compile @@ -23,6 +23,7 @@ if [ -d ${HOME}/nodejs ]; then echo 'Node.js already installed, skipping' else +############################################################################### # Indentation is intentionally weird here in order to make our lives easier when # bringing in updates from the official heroku buildpack @@ -80,7 +81,7 @@ export NODE_PATH="${HOME}/nodejs/lib/node_modules:" status "Building runtime environment" echo "export PATH=\"${HOME}/nodejs/bin:$build_dir/node_modules/.bin:\$PATH\";" > ${HOME}/.profile.d/nodejs.sh echo "export NODE_PATH=\"${HOME}/nodejs/lib/node_modules:\";" >> ${HOME}/.profile.d/nodejs.sh - +############################################################################### fi # Cache npm packages on host machine From 5764cc1d29dd27c461ea861ad5eeb23bd781d06b Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 21 Jan 2015 01:25:51 -0200 Subject: [PATCH 30/39] addons: New Heroku Toolbelt addon --- CHANGELOG.md | 1 + docs/addons/heroku-toolbelt.md | 7 +++++++ stack/addons/heroku-toolbelt/bin/configure | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 docs/addons/heroku-toolbelt.md create mode 100755 stack/addons/heroku-toolbelt/bin/configure diff --git a/CHANGELOG.md b/CHANGELOG.md index 118c3af..7a070a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BREAKING CHANGES: FEATURES: - [New Oracle Java 8 addon](http://fgrehm.viewdocs.io/devstep/addons/oracle-java) + - [New Heroku toolbelt addon](http://fgrehm.viewdocs.io/devstep/addons/heroku-toolbelt) IMPROVEMENTS: diff --git a/docs/addons/heroku-toolbelt.md b/docs/addons/heroku-toolbelt.md new file mode 100644 index 0000000..da024ea --- /dev/null +++ b/docs/addons/heroku-toolbelt.md @@ -0,0 +1,7 @@ +# Heroku Toolbelt Addon +----------------------- + +This addon will install the latest [Heroku Toolbelt](https://toolbelt.heroku.com/) +version available for the Ubuntu 14.04 release. + +To install it you can run `configure-addons oracle-java-8` from within the container. diff --git a/stack/addons/heroku-toolbelt/bin/configure b/stack/addons/heroku-toolbelt/bin/configure new file mode 100755 index 0000000..d525af7 --- /dev/null +++ b/stack/addons/heroku-toolbelt/bin/configure @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e # fail fast +set -o pipefail # dont ignore exit codes when piping output +# set -x # enable debugging + +if ! $(which heroku &> /dev/null); then + echo "-----> [heroku-toolbelt] Installing Heroku toolbelt..." + wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh &>/dev/null + echo "-----> [heroku-toolbelt] Finished configuration!" +fi From 1d19ab86284263d01475375f01aff6b058251356 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 21 Jan 2015 01:40:04 -0200 Subject: [PATCH 31/39] buildpacks/inline: Support for specifying provisioning commands from devstep.yml Closes GH-81 --- CHANGELOG.md | 1 + bin/compile | 11 ----------- devstep.yml | 2 ++ stack/buildpacks/inline/bin/compile | 15 +++++++++++++-- stack/buildpacks/inline/bin/detect | 14 +++++++++++--- stack/buildpacks/inline/bin/provision | 11 +++++++++++ 6 files changed, 38 insertions(+), 16 deletions(-) delete mode 100755 bin/compile create mode 100755 stack/buildpacks/inline/bin/provision diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a070a5..a230640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BREAKING CHANGES: FEATURES: + - [Inline buildpack now supports reading commands from `devstep.yml`](http://fgrehm.viewdocs.io/devstep/buildpacks/inline) - [New Oracle Java 8 addon](http://fgrehm.viewdocs.io/devstep/addons/oracle-java) - [New Heroku toolbelt addon](http://fgrehm.viewdocs.io/devstep/addons/heroku-toolbelt) diff --git a/bin/compile b/bin/compile deleted file mode 100755 index a6f778b..0000000 --- a/bin/compile +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -if ! [ -f $HOME/bin/docker ]; then - configure-addons docker - sleep 5 - docker pull progrium/cedarish:cedar14 -else - echo 'Docker has already been installed, skipping' -fi diff --git a/devstep.yml b/devstep.yml index a939d9b..42eea87 100644 --- a/devstep.yml +++ b/devstep.yml @@ -7,3 +7,5 @@ volumes: commands: make: # No custom options +provision: + - ['configure-addons', 'docker'] diff --git a/stack/buildpacks/inline/bin/compile b/stack/buildpacks/inline/bin/compile index ec8e4d5..e1a0537 100755 --- a/stack/buildpacks/inline/bin/compile +++ b/stack/buildpacks/inline/bin/compile @@ -1,3 +1,14 @@ -#!/bin/sh +#!/bin/bash # Usage: bin/compile -exec "$1"/bin/compile "$@" + +set -e + +if [ -f $1/devstep.yml ]; then + provision_steps=$(ruby -ryaml -e "puts (YAML.load(File.read('$1/devstep.yml'))['provision'] || []).size") + if [[ $provision_steps -gt 0 ]]; then + bp_bin="$( cd -P "$( dirname "$0" )" && pwd )" + ${bp_bin}/provision "${1}/devstep.yml" + fi +elif [ -x $1/bin/compile ]; then + exec "$1"/bin/compile "$@" +fi diff --git a/stack/buildpacks/inline/bin/detect b/stack/buildpacks/inline/bin/detect index e64c5dc..729c517 100755 --- a/stack/buildpacks/inline/bin/detect +++ b/stack/buildpacks/inline/bin/detect @@ -1,8 +1,16 @@ -#!/bin/sh +#!/bin/bash # Usage: bin/detect +if [ -f $1/devstep.yml ]; then + provision_steps=$(ruby -ryaml -e "puts (YAML.load(File.read('$1/devstep.yml'))['provision'] || []).size") + echo $provision_steps + if [[ $provision_steps -gt 0 ]]; then + echo 'devstep' && exit 0 + fi +fi + if [ -x $1/bin/compile ]; then echo 'inline' && exit 0 -else - echo 'no' && exit 1 fi + +exit 1 diff --git a/stack/buildpacks/inline/bin/provision b/stack/buildpacks/inline/bin/provision new file mode 100755 index 0000000..e32d661 --- /dev/null +++ b/stack/buildpacks/inline/bin/provision @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +require 'yaml' + +commands = YAML.load(File.read(ARGV[0]))['provision'] + +commands.each do |cmd| + if !(system *cmd) + exit $?.to_i + end +end From 9a5b4b624daadbafb4ea152feb5a0d7ea851f35d Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 28 Jan 2015 21:38:09 -0700 Subject: [PATCH 32/39] buildpacks/inline: Fallback to `bin/compile` in case no provision scripts are set from `devstep.yml` --- stack/buildpacks/inline/bin/compile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stack/buildpacks/inline/bin/compile b/stack/buildpacks/inline/bin/compile index e1a0537..5b16f58 100755 --- a/stack/buildpacks/inline/bin/compile +++ b/stack/buildpacks/inline/bin/compile @@ -8,6 +8,8 @@ if [ -f $1/devstep.yml ]; then if [[ $provision_steps -gt 0 ]]; then bp_bin="$( cd -P "$( dirname "$0" )" && pwd )" ${bp_bin}/provision "${1}/devstep.yml" + elif [ -x $1/bin/compile ]; then + exec "$1"/bin/compile "$@" fi elif [ -x $1/bin/compile ]; then exec "$1"/bin/compile "$@" From 17a673ae74889d354d2b366b6396edbc45d06e75 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 28 Jan 2015 21:49:37 -0700 Subject: [PATCH 33/39] Split multiline ENVs into separate ENV instructions Docker Hub is having trouble to build the image, lets see if this fixes the problem. --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8966484..76bc0db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ FROM progrium/cedarish:cedar14 MAINTAINER Fabio Rehm "fgrehm@gmail.com" -ENV HOME=/home/devstep \ - DEVSTEP_PATH=/opt/devstep \ - DEVSTEP_CONF=/etc/devstep \ - LANG=en_US.UTF-8 \ - LC_ALL=en_US.UTF-8 \ - LC_CTYPE=en_US.UTF-8 +# TODO: Move this to a single ENV line to reduce layers once Docker Hub supports it +ENV HOME /home/devstep +ENV DEVSTEP_PATH /opt/devstep +ENV DEVSTEP_CONF /etc/devstep +ENV LANG en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 +ENV LC_CTYPE en_US.UTF-8 ##################################################################### # Create a default user to avoid using the container as root, we set @@ -99,7 +100,7 @@ RUN cp $DEVSTEP_PATH/bashrc $HOME/.bashrc && \ chmod +x $DEVSTEP_CONF/init.d/* ##################################################################### -# Setup locales and default user +# Setup default user USER developer ENV USER developer From 12d7cc14559b6d199bf7b62dad2b52c6e2b77c7f Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 21:42:25 -0700 Subject: [PATCH 34/39] docs: Add information about the `provision` config for the inline buildpack --- docs/buildpacks/inline.md | 24 +++++++++++++++++++----- docs/cli/configuration.md | 6 ++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/buildpacks/inline.md b/docs/buildpacks/inline.md index 77f4403..3f3a646 100644 --- a/docs/buildpacks/inline.md +++ b/docs/buildpacks/inline.md @@ -1,9 +1,23 @@ # Inline buildpack ------------------ -This is a buildpack for projects that wish to build themselves and is based on -https://github.com/kr/heroku-buildpack-inline and it expects the project to -provide the usual buildpack executables in its source tree. +This is a buildpack for projects that wish to build themselves and is partially +based on https://github.com/kr/heroku-buildpack-inline -If an executable file is found under `bin/compile` of the project root, this -buildpack will simply call it. +First, it checks if there is a `provision` directive on `devstep.yml` under +the project's root and it uses the instructions provided during container +provisioning. + +For example: + +```yaml +provision: + - ['configure-addons', 'oracle-java-8'] + - ['configure-addons', 'heroku-toolbelt'] +``` + +Will configure the Java 8 and Heroku toolbelt addons. + +If no `provision` instructions are found, the buildpack will look for an +executable file under `bin/compile` of the project root and will run the script +if found. diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index 603b181..97aec88 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -61,6 +61,12 @@ commands: RAILS_ENV: "hacking" ruby: # No custom options, used only for generating binstubs + +# Custom provisioning steps that can be used when the available buildpacks are not +# enough. Use it to configure addons or run additional commands during the build. +# DEFAULT: +provision: + - ['configure-addons', 'oracle-java-8'] ``` During a `devstep` command run, the CLI will start by loading global config From 90ec085542aaf437ba8d4af3612b8e4a48f79cb1 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 22:01:10 -0700 Subject: [PATCH 35/39] addons/docker: Bumpt default version to 1.5.0 --- stack/addons/docker/bin/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack/addons/docker/bin/configure b/stack/addons/docker/bin/configure index 934de60..b13a4e6 100755 --- a/stack/addons/docker/bin/configure +++ b/stack/addons/docker/bin/configure @@ -6,7 +6,7 @@ set -o pipefail # dont ignore exit codes when piping output CACHE_DIR=${2:-"${HOME}/cache/docker"} DOCKER_CMD="${HOME}/bin/docker" -DEVSTEP_DOCKER_VERSION=${DEVSTEP_DOCKER_VERSION:-"1.4.1"} +DEVSTEP_DOCKER_VERSION=${DEVSTEP_DOCKER_VERSION:-"1.5.0"} URL=https://get.docker.com/builds/Linux/x86_64/docker-${DEVSTEP_DOCKER_VERSION} mkdir -p $CACHE_DIR From 7adc1f73157e72625053f5b8db03d771b9d007fe Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 22:01:28 -0700 Subject: [PATCH 36/39] buildpacks/ruby: Bump default bundler to 1.8.0 --- stack/buildpacks/ruby/bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack/buildpacks/ruby/bin/compile b/stack/buildpacks/ruby/bin/compile index f5ba1a5..f718919 100755 --- a/stack/buildpacks/ruby/bin/compile +++ b/stack/buildpacks/ruby/bin/compile @@ -118,7 +118,7 @@ fi source ${HOME}/.profile.d/ruby.sh -DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.7.12'} +DEVSTEP_BUNDLER_VERSION=${DEVSTEP_BUNDLER_VERSION:-'1.8.0'} if ! $(which bundle &> /dev/null); then tarball_path=$2/rubies/bundler-${DEVSTEP_BUNDLER_VERSION}.gem From 0f796a41694666fea6dc8b8836b04cb12df6e4d4 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 22:06:39 -0700 Subject: [PATCH 37/39] v0.3.0 --- CHANGELOG.md | 12 ++++++------ docs/cli/commands.md | 6 +++--- docs/cli/configuration.md | 2 +- docs/cli/plugins.md | 2 +- docs/getting-started.md | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a230640..bde831b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ -## [0.3.0](https://github.com/fgrehm/devstep/compare/v0.2.0...master) (unreleased) +## [0.3.0](https://github.com/fgrehm/devstep/compare/v0.2.0...v0.3.0) (unreleased) BREAKING CHANGES: - - Switched to the latest progrium/cedarish image which uses an unmodified Heroku - `cedar14.sh` base stack source. More info [here](https://github.com/progrium/cedarish/commit/71e2a4af8d300c94783720d13eac79d084a35a75) + - Switched to the latest `progrium/cedarish:cedar14` image which uses an unmodified + Heroku `cedar14.sh` base stack source. More info [here](https://github.com/progrium/cedarish/tree/master/cedar14) - Organization of Devstep's "stack" within the Docker image got changed, please see - [GH-63] for more information + commits associated with [GH-63] for more information [GH-63]: https://github.com/fgrehm/devstep/issues/63 @@ -18,7 +18,7 @@ FEATURES: IMPROVEMENTS: - Reduced output by default and added support for `DEVSTEP_LOG` for setting the log level - - addons/docker: Lock installation to 1.4.1 instead of latest + - addons/docker: Lock installation to 1.5.0 instead of latest - addons/docker: Support specifying a Docker version to be installed with `DEVSTEP_DOCKER_VERSION` env var - buildpacks/golang: Bump default version to 1.4.1 - buildpacks/nodejs: Bump default Node to 0.10.35 @@ -26,7 +26,7 @@ IMPROVEMENTS: - buildpacks/php: Download buildpack dependencies on demand - buildpacks/python: Backport recent oficial Heroku buildpack updates - buildpacks/python: Download buildpack dependencies on demand - - buildpacks/ruby: Bump default Bundler to 1.7.12 + - buildpacks/ruby: Bump default Bundler to 1.8.0 - buildpacks/ruby: Bump default Ruby to 2.2.0 BUG FIXES: diff --git a/docs/cli/commands.md b/docs/cli/commands.md index 88f2c97..30115eb 100644 --- a/docs/cli/commands.md +++ b/docs/cli/commands.md @@ -15,7 +15,7 @@ This is the easiest way to get started with Devstep. By running the command from your project's root, Devstep will: -1. Create a Docker container based on `fgrehm/devstep:v0.2.0` with project +1. Create a Docker container based on `fgrehm/devstep:v0.3.0` with project sources bind mounted at `/workspace`. 2. Detect and install project's dependencies on the new container using the available buildpacks. @@ -44,7 +44,7 @@ devstep hack -p 80:8080 --link postgres:db --link memcached:mc -e DEVSTEP_BUNDLE By running the command from your project's root, Devstep will: -1. Create a Docker container based on `fgrehm/devstep:v0.2.0` with project +1. Create a Docker container based on `fgrehm/devstep:v0.3.0` with project sources bind mounted at `/workspace`. 2. Detect and install project's dependencies on the new container using the available buildpacks. @@ -53,7 +53,7 @@ By running the command from your project's root, Devstep will: The `devstep/` images act like snapshots of your project dependencies and will be used as the source image for subsequent `devstep` commands instead -of the `fgrehm/devstep:v0.2.0` image. +of the `fgrehm/devstep:v0.3.0` image. For example, running a `devstep hack` after building the image will use `devstep/:latest` as the base container for new "hacking sessions" so that you don't have to build diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index 97aec88..11c4004 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -12,7 +12,7 @@ The available options are described below: repository: 'repo/name' # The image used by devstep when building environments from scratch -# DEFAULT: 'fgrehm/devstep:v0.2.0' +# DEFAULT: 'fgrehm/devstep:v0.3.0' source_image: 'source/image:tag' # The host cache dir that gets mounted inside the container at `/home/devstep/cache` diff --git a/docs/cli/plugins.md b/docs/cli/plugins.md index b302b62..a9972db 100644 --- a/docs/cli/plugins.md +++ b/docs/cli/plugins.md @@ -37,7 +37,7 @@ devstep.on('configLoaded', function(config) { .addVolume(squidShared + '/certs/squid3.dev.crt:/usr/share/ca-certificates/squid3.dev.crt') .setEnv('HTTPS_PROXY_CERT', 'squid3.dev.crt'); // Inject the script that will trust the squid container certificate - .addVolume(squidRoot + '/proxy.sh:/etc/my_init.d/proxy.sh') + .addVolume(squidRoot + '/proxy.sh:/etc/devstep/init.d/proxy.sh') // Sets environmental variables so that programs make use of the cache .setEnv('http_proxy', 'http://squid3.dev:3128') diff --git a/docs/getting-started.md b/docs/getting-started.md index 84e9802..f9a9851 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -4,7 +4,7 @@ Devstep comes in two flavors, you can either use the provided CLI or you can build on top of the provided images from `Dockerfile`s. -Regardless of the flavor you choose, it is a good idea to `docker pull fgrehm/devstep:v0.2.0` +Regardless of the flavor you choose, it is a good idea to `docker pull fgrehm/devstep:v0.3.0` before creating your first container / image for a better user experience. Docker will download that image as needed when using `Dockerfile`s but the Devstep CLI won't. @@ -12,7 +12,7 @@ will download that image as needed when using `Dockerfile`s but the Devstep CLI --------------- This project is being developed and tested on an Ubuntu 14.04 host with Docker -1.0.0+, while it is likely to work on other distros / Docker versions / +1.4.0+, while it is likely to work on other distros / Docker versions / [boot2docker](http://boot2docker.io/), I'm not sure how it will behave on the wild. Please note that the CLI is currently limited to connecting to a local `/var/run/docker.sock` @@ -182,7 +182,7 @@ The `fgrehm/devstep` image is the base image used for Devstep environments and requires you to manually trigger the build: ```Dockerfile -FROM fgrehm/devstep:v0.2.0 +FROM fgrehm/devstep:v0.3.0 # Add project to the image and build it ADD . /workspace @@ -190,12 +190,12 @@ WORKDIR /workspace RUN CLEANUP=1 /opt/devstep/bin/build-project /workspace ``` -To make things easier, there's also a `fgrehm/devstep-ab:v0.2.0` image that +To make things easier, there's also a `fgrehm/devstep-ab:v0.3.0` image that does the same steps as outlined above automatically for you by leveraging `ONBUILD` instructions, trimming down your `Dockerfile` to a single line: ```Dockerfile -FROM fgrehm/devstep-ab:v0.2.0 +FROM fgrehm/devstep-ab:v0.3.0 ``` By using a `Dockerfile` to build your images (instead of using `devstep build`) From 693ac4b4777ba1effbba24b91ee8f814acc5ec61 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 22:47:30 -0700 Subject: [PATCH 38/39] Add 0.3.0 release date to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bde831b..b5e9203 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [0.3.0](https://github.com/fgrehm/devstep/compare/v0.2.0...v0.3.0) (unreleased) +## [0.3.0](https://github.com/fgrehm/devstep/compare/v0.2.0...v0.3.0) (2015-02-12) BREAKING CHANGES: From 0db4593aaa9f056ca2f8336ab70a1c625f78a4f4 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 12 Feb 2015 22:47:55 -0700 Subject: [PATCH 39/39] Minor docs tweaks --- docs/buildpacks/inline.md | 4 ++-- docs/cli/configuration.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/buildpacks/inline.md b/docs/buildpacks/inline.md index 3f3a646..1e9cfc9 100644 --- a/docs/buildpacks/inline.md +++ b/docs/buildpacks/inline.md @@ -12,11 +12,11 @@ For example: ```yaml provision: - - ['configure-addons', 'oracle-java-8'] + - ['configure-addons', 'redis'] - ['configure-addons', 'heroku-toolbelt'] ``` -Will configure the Java 8 and Heroku toolbelt addons. +Will configure the Redis and Heroku toolbelt addons. If no `provision` instructions are found, the buildpack will look for an executable file under `bin/compile` of the project root and will run the script diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index 11c4004..51365ab 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -66,7 +66,7 @@ commands: # enough. Use it to configure addons or run additional commands during the build. # DEFAULT: provision: - - ['configure-addons', 'oracle-java-8'] + - ['configure-addons', 'redis'] ``` During a `devstep` command run, the CLI will start by loading global config