Skip to content

Instantly share code, notes, and snippets.

@ArturT
Forked from joakimk/README.md
Last active October 24, 2016 18:59
Show Gist options
  • Select an option

  • Save ArturT/8308c5ad0c72065e915b to your computer and use it in GitHub Desktop.

Select an option

Save ArturT/8308c5ad0c72065e915b to your computer and use it in GitHub Desktop.

Revisions

  1. ArturT revised this gist Feb 15, 2016. 2 changed files with 7 additions and 3 deletions.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,11 @@ It should be generic enough to work on any elixir app using mix.

    If you have a `elixir_buildpack.config`, then enable that section in the build script to keep versions in sync!

    # Extra note

    Please remember to set chmod:

    $ chmod a+x bin/ci/prepare.sh
    $ chmod a+x bin/ci/tests.sh
    $ chmod a+x bin/ci/tests.sh

    Update your version of `ERLANG_VERSION` and `ELIXIR_VERSION`.
    4 changes: 2 additions & 2 deletions bin-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    set -e

    export ERLANG_VERSION="17.5"
    export ELIXIR_VERSION="v1.0.5"
    export ERLANG_VERSION="18.2.1"
    export ELIXIR_VERSION="v1.2.1"

    # If you have a elixir_buildpack.config, do this instead:
    #export ERLANG_VERSION=$(cat elixir_buildpack.config | grep erlang_version | tr "=" " " | awk '{ print $2 }')
  2. ArturT revised this gist Feb 15, 2016. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,9 @@ We've been using this for months in multiple projects without any issues. Please

    It should be generic enough to work on any elixir app using mix.

    If you have a `elixir_buildpack.config`, then enable that section in the build script to keep versions in sync!
    If you have a `elixir_buildpack.config`, then enable that section in the build script to keep versions in sync!

    Please remember to set chmod:

    $ chmod a+x bin/ci/prepare.sh
    $ chmod a+x bin/ci/tests.sh
  3. ArturT revised this gist Feb 15, 2016. 3 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion script-ci-prepare.sh → bin-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ cd $INSTALL_PATH

    # Install erlang
    if [ ! -e $ERLANG_PATH/bin/erl ]; then
    curl -O http://www.erlang.org/download/otp_src_$ERLANG_VERSION.tar.gz
    curl -OL http://www.erlang.org/download/otp_src_$ERLANG_VERSION.tar.gz
    tar xzf otp_src_$ERLANG_VERSION.tar.gz
    cd $ERLANG_PATH
    ./configure --enable-smp-support \
    File renamed without changes.
    4 changes: 2 additions & 2 deletions circle.yml
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    dependencies:
    pre:
    - script/ci/prepare.sh
    - bin/ci/prepare.sh
    cache_directories:
    - ~/dependencies
    - ~/.mix
    @@ -9,4 +9,4 @@ dependencies:

    test:
    override:
    - script/ci/tests.sh
    - bin/ci/tests.sh
  4. @joakimk joakimk revised this gist Jul 15, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions script-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    set -e

    export ERLANG_VERSION="17.1"
    export ELIXIR_VERSION="v1.0.2"
    export ERLANG_VERSION="17.5"
    export ELIXIR_VERSION="v1.0.5"

    # If you have a elixir_buildpack.config, do this instead:
    #export ERLANG_VERSION=$(cat elixir_buildpack.config | grep erlang_version | tr "=" " " | awk '{ print $2 }')
  5. @joakimk joakimk revised this gist Jul 1, 2015. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible. It's not been run for very long so I don't know if it caches too much or of there is any other issues.
    This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

    It should be generic enough to work on any elixir app using mix.
    We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

    It should be generic enough to work on any elixir app using mix.

    If you have a `elixir_buildpack.config`, then enable that section in the build script to keep versions in sync!
  6. @joakimk joakimk revised this gist Mar 20, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion script-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,12 @@
    set -e

    export ERLANG_VERSION="17.1"
    export ELIXIR_VERSION="v1.0"
    export ELIXIR_VERSION="v1.0.2"

    # If you have a elixir_buildpack.config, do this instead:
    #export ERLANG_VERSION=$(cat elixir_buildpack.config | grep erlang_version | tr "=" " " | awk '{ print $2 }')
    #export ELIXIR_VERSION=v$(cat elixir_buildpack.config | grep elixir_version | tr "=" " " | awk '{ print $2 }')

    export INSTALL_PATH="$HOME/dependencies"

    export ERLANG_PATH="$INSTALL_PATH/otp_src_$ERLANG_VERSION"
  7. @joakimk joakimk revised this gist Sep 19, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions script-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -48,8 +48,8 @@ export PATH="$ERLANG_PATH/bin:$ELIXIR_PATH/bin:$PATH"

    # Install package tools
    if [ ! -e $HOME/.mix/rebar ]; then
    echo "Y" | LC_ALL=en_GB.UTF-8 mix local.hex
    echo "Y" | LC_ALL=en_GB.UTF-8 mix local.rebar
    yes Y | LC_ALL=en_GB.UTF-8 mix local.hex
    yes Y | LC_ALL=en_GB.UTF-8 mix local.rebar
    fi

    # Fetch and compile dependencies and application code (and include testing tools)
  8. @joakimk joakimk revised this gist Sep 19, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    This runs a build for a small elixir (phoenix) project in 45 seconds by caching as much of the compiled files as possible. It's not been run for very long so I don't know if it caches too much or of there is any other issues.
    This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible. It's not been run for very long so I don't know if it caches too much or of there is any other issues.

    It should be generic enough to work on any elixir app using mix.
  9. @joakimk joakimk revised this gist Sep 19, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion circle.yml
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@ dependencies:
    - script/ci/prepare.sh
    cache_directories:
    - ~/dependencies
    - ~/.mix
    - _build
    - deps
    - /home/ubuntu/.mix

    test:
    override:
  10. @joakimk joakimk created this gist Sep 19, 2014.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    This runs a build for a small elixir (phoenix) project in 45 seconds by caching as much of the compiled files as possible. It's not been run for very long so I don't know if it caches too much or of there is any other issues.

    It should be generic enough to work on any elixir app using mix.
    12 changes: 12 additions & 0 deletions circle.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    dependencies:
    pre:
    - script/ci/prepare.sh
    cache_directories:
    - ~/dependencies
    - _build
    - deps
    - /home/ubuntu/.mix

    test:
    override:
    - script/ci/tests.sh
    58 changes: 58 additions & 0 deletions script-ci-prepare.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    #!/bin/bash

    set -e

    export ERLANG_VERSION="17.1"
    export ELIXIR_VERSION="v1.0"
    export INSTALL_PATH="$HOME/dependencies"

    export ERLANG_PATH="$INSTALL_PATH/otp_src_$ERLANG_VERSION"
    export ELIXIR_PATH="$INSTALL_PATH/elixir_$ELIXIR_VERSION"

    mkdir -p $INSTALL_PATH
    cd $INSTALL_PATH

    # Install erlang
    if [ ! -e $ERLANG_PATH/bin/erl ]; then
    curl -O http://www.erlang.org/download/otp_src_$ERLANG_VERSION.tar.gz
    tar xzf otp_src_$ERLANG_VERSION.tar.gz
    cd $ERLANG_PATH
    ./configure --enable-smp-support \
    --enable-m64-build \
    --disable-native-libs \
    --disable-sctp \
    --enable-threads \
    --enable-kernel-poll \
    --disable-hipe \
    --without-javac
    make

    # Symlink to make it easier to setup PATH to run tests
    ln -sf $ERLANG_PATH $INSTALL_PATH/erlang
    fi

    # Install elixir
    export PATH="$ERLANG_PATH/bin:$PATH"

    if [ ! -e $ELIXIR_PATH/bin/elixir ]; then
    git clone https://github.com/elixir-lang/elixir $ELIXIR_PATH
    cd $ELIXIR_PATH
    git checkout $ELIXIR_VERSION
    make

    # Symlink to make it easier to setup PATH to run tests
    ln -sf $ELIXIR_PATH $INSTALL_PATH/elixir
    fi

    export PATH="$ERLANG_PATH/bin:$ELIXIR_PATH/bin:$PATH"

    # Install package tools
    if [ ! -e $HOME/.mix/rebar ]; then
    echo "Y" | LC_ALL=en_GB.UTF-8 mix local.hex
    echo "Y" | LC_ALL=en_GB.UTF-8 mix local.rebar
    fi

    # Fetch and compile dependencies and application code (and include testing tools)
    export MIX_ENV="test"
    cd $HOME/$CIRCLE_PROJECT_REPONAME
    mix do deps.get, deps.compile, compile
    6 changes: 6 additions & 0 deletions script-ci-test.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    export MIX_ENV="test"
    export PATH="$HOME/dependencies/erlang/bin:$HOME/dependencies/elixir/bin:$PATH"

    mix test