Skip to content

Commit

Permalink
go: change default version and clean image
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebr committed Jul 14, 2017
1 parent 1c4a8d0 commit 596826f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 7 additions & 1 deletion go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
FROM tsuru/base-platform
ADD . /var/lib/tsuru/go
RUN cp /var/lib/tsuru/go/deploy /var/lib/tsuru
RUN /var/lib/tsuru/go/install
RUN set -ex; \
apt-get update && \
apt-get install -y bzr mercurial git && \
/var/lib/tsuru/go/install && \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean
8 changes: 5 additions & 3 deletions go/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ SOURCE_DIR=/var/lib/tsuru
source ${SOURCE_DIR}/base/deploy
source ${SOURCE_DIR}/base/rc/config

GO_VERSION=$(test -f /tmp/app_envs && source /tmp/app_envs && echo $GO_VERSION)
GO_VERSION=${GO_VERSION:-1.7.4}
go_default_version="stable"
if [ -z "${GO_VERSION}" ]; then
GO_VERSION="${go_default_version}"
fi
echo "Installing Go ${GO_VERSION}..."
eval "$(gimme ${GO_VERSION})" >/dev/null 2>&1

Expand All @@ -19,7 +21,7 @@ fi

APP_PATH=${APP_DIR}/src/current

if [ ! -z "${GO_PKG_PATH}" ]
if [ -n "${GO_PKG_PATH}" ]
then
APP_PATH=${APP_DIR}/src/${GO_PKG_PATH}
fi
Expand Down
4 changes: 2 additions & 2 deletions go/install
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source ${SOURCE_DIR}/base/rc/config

curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme -o /usr/bin/gimme
chmod +x /usr/bin/gimme
apt-get update && apt-get install bzr mercurial git -y

cp ${SOURCE_DIR}/go/Procfile ${SOURCE_DIR}/default/Procfile
echo "GOPATH=${APP_DIR}" >> ${HOME}/.profile
echo 'PATH=$GOPATH:$PATH' >> ${HOME}/.profile
Expand All @@ -19,7 +19,7 @@ echo 'export GIMME_SILENT_ENV=1' >> ${HOME}/.profile
echo '[ -f ${HOME}/.gimme/envs/latest.env ] && source ${HOME}/.gimme/envs/latest.env' >> ${HOME}/.profile

sudo -u ubuntu mkdir -p ${HOME}/.gimme/versions
GO_VERSIONS="1.7.6 1.8.3 stable"
GO_VERSIONS="stable"
for GO_VERSION in ${GO_VERSIONS}
do
echo "Installing Go ${GO_VERSION}..."
Expand Down

0 comments on commit 596826f

Please sign in to comment.