Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #72 from vania-pooh/master
Browse files Browse the repository at this point in the history
Correctly working in Docker container without OVERRIDE_HOME variable …
  • Loading branch information
vania-pooh authored Aug 9, 2017
2 parents 8e3b294 + a90077e commit 4612cf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ FROM alpine:3.5
RUN apk add -U ca-certificates tzdata && rm -Rf /var/cache/apk/*
COPY cm /

WORKDIR /root
ENTRYPOINT ["/cm"]
7 changes: 1 addition & 6 deletions selenoid/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,7 @@ func getHomeDir() string {
}

func joinPaths(baseDir string, elem []string) string {
var p string
if baseDir == "" {
p = filepath.Join(elem...)
} else {
p = filepath.Join(append([]string{baseDir}, elem...)...)
}
p := filepath.Join(append([]string{baseDir}, elem...)...)
ap, _ := filepath.Abs(p)
return ap
}
Expand Down
2 changes: 2 additions & 0 deletions selenoid/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ func TestFilterOutLatest(t *testing.T) {
}

func TestChooseVolumeConfigDir(t *testing.T) {
dirWithoutVariable := chooseVolumeConfigDir("/some/dir", []string{"one", "two"})
AssertThat(t, dirWithoutVariable, EqualTo{"/some/dir"})
os.Setenv("OVERRIDE_HOME", "/test/dir")
defer os.Unsetenv("OVERRIDE_HOME")
dir := chooseVolumeConfigDir("/some/dir", []string{"one", "two"})
Expand Down

0 comments on commit 4612cf5

Please sign in to comment.