Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Feb 25, 2015
1 parent 642ff9f commit 7027bb1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
50 changes: 35 additions & 15 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -1,38 +1,58 @@
#!/bin/sh

BUILD=$1
CACHE=$2
CACHE_VERSION=v1
CACHE_ROOT=$2
CACHE=$CACHE_ROOT/$CACHE_VERSION
ENV=$3

if [ ! -f $1/run ]; then
echo "Missing $1/run"
exit 1
fi

echo "Current stack: $STACK"

# echo "Create Procfile"
# echo 'web: ./run' > $BUILD/Procfile

echo "Install Go"
if [ -d $CACHE/local ]; then

echo "Build cache $CACHE_VERSION"

rm -rf $ROOT_CACHE/*
mkdir $CACHE/local

mkdir $BUILD/local
curl -s https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C $BUILD/local -xzf -
GOROOT=$BUILD/local/go export GOROOT
echo "Install Node"
curl -s http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz | tar -C $CACHE/local -xzf -
export NODE_BIN=$CACHE/local/node-v0.12.0-linux-x64/bin

GOPATH=$BUILD/go export GOPATH
echo "Install Go"
curl -s https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C $CACHE/local -xzf -
export GOROOT=$CACHE/local/go
export GOPATH=$CACHE/go

mkdir $GOPATH
PATH=$PATH:$BUILD/local/go/bin:$GOPATH/bin export PATH
echo "Set environment"

mkdir -p $BUILD/.profile.d
echo '#extra vars
export GOPATH=$HOME/go
export GOROOT=$HOME/local/go
mkdir $GOPATH
export PATH=$PATH:$CACHE/local/go/bin:$GOPATH/bin

PATH=$PATH:$HOME/local/go/bin:$GOPATH/bin
mkdir -p $CACHE/.profile.d
echo '#extra vars
export GOPATH=$HOME/go
export GOROOT=$HOME/local/go
export NODE_BIN=$HOME/local/node-v0.12.0-linux-x64/bin
PATH=$PATH:$HOME/local/go/bin:$GOPATH/bin:$NODE_BIN
' > $CACHE/.profile.d/vars.sh
fi

' > $BUILD/.profile.d/vars.sh
#setup from cache
cp -r $CACHE/.profile.d $BUILD
cp -r $CACHE/local $BUILD

#print version
#print versions
echo "node `node --version`"
go version

echo "Found run script '$BUILD/run'"
Expand Down
4 changes: 4 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# bin/release <build-dir>

echo "--- {}"

0 comments on commit 7027bb1

Please sign in to comment.