-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from rtnpro/buildconfig
Generate buildconfig for Openshift
- Loading branch information
Showing
29 changed files
with
16,330 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM busybox | ||
|
||
|
||
RUN touch /test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "2" | ||
|
||
services: | ||
foo: | ||
build: "./build" | ||
command: "sleep 3600" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package testutils | ||
|
||
import ( | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
"os/exec" | ||
"testing" | ||
) | ||
|
||
func NewCommand(cmd string) *exec.Cmd { | ||
return exec.Command("sh", "-c", cmd) | ||
} | ||
|
||
func CreateLocalDirectory(t *testing.T) string { | ||
dir, err := ioutil.TempDir(os.TempDir(), "kompose-test-") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
return dir | ||
} | ||
|
||
func CreateLocalGitDirectory(t *testing.T) string { | ||
dir := CreateLocalDirectory(t) | ||
cmd := NewCommand( | ||
`git init && touch README && | ||
git add README && | ||
git commit -m 'testcommit'`) | ||
cmd.Dir = dir | ||
_, err := cmd.Output() | ||
if err != nil { | ||
t.Logf("create local git dir: %v", err) | ||
t.Fatal(err) | ||
} | ||
return dir | ||
} | ||
|
||
func SetGitRemote(t *testing.T, dir string, remote string, remoteUrl string) { | ||
cmd := NewCommand(fmt.Sprintf("git remote add %s %s", remote, remoteUrl)) | ||
cmd.Dir = dir | ||
_, err := cmd.Output() | ||
if err != nil { | ||
t.Logf("set git remote: %v", err) | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func CreateGitRemoteBranch(t *testing.T, dir string, branch string, remote string) { | ||
cmd := NewCommand( | ||
fmt.Sprintf(`git checkout -b %s && | ||
git config branch.%s.remote %s && | ||
git config branch.%s.merge refs/heads/%s`, | ||
branch, branch, remote, branch, branch)) | ||
cmd.Dir = dir | ||
|
||
_, err := cmd.Output() | ||
if err != nil { | ||
t.Logf("create git branch: %v", err) | ||
t.Fatal(err) | ||
} | ||
} | ||
|
||
func CreateSubdir(t *testing.T, dir string, subdir string) { | ||
cmd := NewCommand(fmt.Sprintf("mkdir -p %s", subdir)) | ||
cmd.Dir = dir | ||
|
||
_, err := cmd.Output() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.