Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
Fixed bugs of declaring environment variables in startup scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkawamoto committed Jan 10, 2017
1 parent 0230f80 commit 42c6c16
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pkg
homebrew
*.bak
loci
.wercker

### https://raw.github.com/github/gitignore/9f044c43d2fa998acb2d468367a349fff609dc84/go.gitignore

Expand Down
8 changes: 4 additions & 4 deletions assets/entrypoint-go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ if [[ $# = 0 ]]; then
fi

if [[ $1 = "any" ]]; then
TRAVIS_GO_VERSION=$(go version | cut -f 3 -d " " | sed s/go//g)
readonly TRAVIS_GO_VERSION=$(go version | cut -f 3 -d " " | sed s/go//g)
else
TRAVIS_GO_VERSION=$1
readonly TRAVIS_GO_VERSION=$1
echo "Set Go version: $TRAVIS_GO_VERSION"
eval "$(GIMME_GO_VERSION=$TRAVIS_GO_VERSION gimme)"
fi

for e in ${@:2:($#-1)}; do
echo "Set environment: $e"
env $e
declare -x $e
done

echo "Install Steps:"
Expand Down Expand Up @@ -52,7 +52,7 @@ echo "{{.}}"
{{.}}
{{end}}
{{else}}
if [ -e GNUMakefile ] || [ -e Makefile ] || [ -e BSDmakefile ] || [ -e makefile ]; then
if [[ -e GNUMakefile ]] || [[ -e Makefile ]] || [[ -e BSDmakefile ]] || [[ -e makefile ]]; then
make
else
{{if .GoBuildArgs}}
Expand Down
6 changes: 3 additions & 3 deletions assets/entrypoint-python
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ if [[ $# = 0 ]]; then
exec bash
fi

PYVERSION=$(pyenv install -l | sed "s/ //g" | grep -E "^$1($|[^-])" | tail -1)
readonly PYVERSION=$(pyenv install -l | sed "s/ //g" | grep -E "^$1($|[^-])" | tail -1)
echo "Set Python version: $PYVERSION"
pyenv install $PYVERSION
pyenv local $PYVERSION

for e in ${@:2:($#-1)}; do
echo "Set environment: $e"
env $e
declare -x $e
done

echo "Install Steps:"
if [ -e requirements.txt ]; then
if [[ -e requirements.txt ]]; then
pip install -r requirements.txt
fi
{{range .Install}}
Expand Down
4 changes: 2 additions & 2 deletions command/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion command/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
client "github.com/docker/docker/client"
)

// DockerfileAsset defines a asset name for Dockerfile.
Expand Down
2 changes: 1 addition & 1 deletion command/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func run(opt *RunOpt) (err error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, os.Kill, syscall.SIGHUP, syscall.SIGQUIT)
signal.Notify(sig, os.Interrupt, os.Kill, syscall.SIGQUIT)
go func() {
<-sig
cancel()
Expand Down
3 changes: 2 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import (

// GlobalFlags defines global flags.
var GlobalFlags = []cli.Flag{
// TODO: Remote docker host.
cli.StringFlag{
Name: "name, n",
Usage: "creating a container named `NAME` to run tests. " +
"If name is given, container will not be deleted.",
},
cli.StringFlag{
Name: "tag, t",
Usage: "if given, the image hosting tests will be named `TAG`.",
Usage: "specify a `TAG` name of the docker image to be build.",
},
cli.StringFlag{
Name: "base, b",
Expand Down

0 comments on commit 42c6c16

Please sign in to comment.