diff --git a/bin/build b/bin/build new file mode 100644 index 000000000..35b8deab6 --- /dev/null +++ b/bin/build @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -e +echo "Starting release process..." +cd /opt/build +rm -rf /opt/build/_build/prod/rel/teiserver/releases + +echo "Creating release artifact directory..." +mkdir -p /opt/build/rel/artifacts + +echo "Installing rebar and hex..." +mix local.rebar --force +mix local.hex --if-missing --force + +echo "Fetching project deps..." +mix deps.get + +echo "Cleaning and compiling..." +# "If you are using Phoenix, here is where you would run mix phx.digest" +mix phx.digest + +echo "Generating release..." +mix release + +echo "Creating tarball..." +tar -zcf "/opt/build/rel/artifacts/teiserver.tar.gz" /opt/build/_build/prod + +echo "Release generated at rel/artifacts/teiserver.tar.gz" +exit 0 diff --git a/documents/prod_files/Dockerfile_debian b/documents/prod_files/Dockerfile_debian index 736d1e4c7..056b57b92 100644 --- a/documents/prod_files/Dockerfile_debian +++ b/documents/prod_files/Dockerfile_debian @@ -90,5 +90,5 @@ ENV LANG=en_US.UTF-8 \ MIX_ENV=$env WORKDIR /opt/build ADD ./bin/build ./bin/build -RUN chmod +wrx /bin/build +RUN chmod +wrx ./bin/build CMD ["bin/build"]