commit
df115cacb2
6 changed files with 10 additions and 10 deletions
|
@ -40,7 +40,7 @@ func Test_Modulus(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Write(b)
|
m.Write(b)
|
||||||
g.Assert(b.String()).Equal(`export MODULUS_TOKEN=bar
|
g.Assert(b.String()).Equal(`export MODULUS_TOKEN="bar"
|
||||||
[ -f /usr/bin/npm ] || echo ERROR: npm is required for modulus.io deployments
|
[ -f /usr/bin/npm ] || echo ERROR: npm is required for modulus.io deployments
|
||||||
[ -f /usr/bin/npm ] || exit 1
|
[ -f /usr/bin/npm ] || exit 1
|
||||||
[ -f /usr/bin/sudo ] || npm install -g modulus
|
[ -f /usr/bin/sudo ] || npm install -g modulus
|
||||||
|
|
|
@ -40,8 +40,8 @@ func Test_Modulus(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
n.Write(b)
|
n.Write(b)
|
||||||
g.Assert(b.String()).Equal(`export username=foo
|
g.Assert(b.String()).Equal(`export username="foo"
|
||||||
export apiToken=bar
|
export apiToken="bar"
|
||||||
[ -f /usr/bin/sudo ] || npm install -g jitsu
|
[ -f /usr/bin/sudo ] || npm install -g jitsu
|
||||||
[ -f /usr/bin/sudo ] && sudo npm install -g jitsu
|
[ -f /usr/bin/sudo ] && sudo npm install -g jitsu
|
||||||
echo '#DRONE:6a69747375206465706c6f79'
|
echo '#DRONE:6a69747375206465706c6f79'
|
||||||
|
|
|
@ -81,7 +81,7 @@ func TestSSHOneArtifact(t *testing.T) {
|
||||||
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(bscr, "ARTIFACT=build.result") {
|
if !strings.Contains(bscr, `ARTIFACT="build.result"`) {
|
||||||
t.Error("Expect script to contains artifact")
|
t.Error("Expect script to contains artifact")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ func TestSSHMultiArtifact(t *testing.T) {
|
||||||
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(bscr, "ARTIFACT=${PWD##*/}.tar.gz") {
|
if !strings.Contains(bscr, `ARTIFACT="${PWD##*/}.tar.gz"`) {
|
||||||
t.Errorf("Expect script to contains artifact")
|
t.Errorf("Expect script to contains artifact")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,11 +111,11 @@ func TestSSHGitArchive(t *testing.T) {
|
||||||
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
t.Fatalf("Can't unmarshal deploy script: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(bscr, "COMMIT=$(git rev-parse HEAD)") {
|
if !strings.Contains(bscr, `COMMIT="$(git rev-parse HEAD)"`) {
|
||||||
t.Errorf("Expect script to contains commit ref")
|
t.Errorf("Expect script to contains commit ref")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(bscr, "ARTIFACT=${PWD##*/}-${COMMIT}.tar.gz") {
|
if !strings.Contains(bscr, `ARTIFACT="${PWD##*/}-${COMMIT}.tar.gz"`) {
|
||||||
t.Errorf("Expect script to contains artifact")
|
t.Errorf("Expect script to contains artifact")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ func (b *Buildfile) WriteComment(comment string) {
|
||||||
// are not echoed back to the console, and are
|
// are not echoed back to the console, and are
|
||||||
// kept private by default.
|
// kept private by default.
|
||||||
func (b *Buildfile) WriteEnv(key, value string) {
|
func (b *Buildfile) WriteEnv(key, value string) {
|
||||||
b.WriteString(fmt.Sprintf("export %s=%s\n", key, value))
|
b.WriteString(fmt.Sprintf("export %s=%q\n", key, value))
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteHost adds an entry to the /etc/hosts file.
|
// WriteHost adds an entry to the /etc/hosts file.
|
||||||
|
|
|
@ -35,7 +35,7 @@ func TestWrite(t *testing.T) {
|
||||||
|
|
||||||
f = &Buildfile{}
|
f = &Buildfile{}
|
||||||
f.WriteEnv("FOO", "BAR")
|
f.WriteEnv("FOO", "BAR")
|
||||||
got, want = f.String(), "export FOO=BAR\n"
|
got, want = f.String(), "export FOO=\"BAR\"\n"
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Errorf("Exepected WriteEnv returned %s, got %s", want, got)
|
t.Errorf("Exepected WriteEnv returned %s, got %s", want, got)
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ func (b *Build) Write(f *buildfile.Buildfile, r *repo.Repo) {
|
||||||
func (b *Build) WriteBuild(f *buildfile.Buildfile) {
|
func (b *Build) WriteBuild(f *buildfile.Buildfile) {
|
||||||
// append environment variables
|
// append environment variables
|
||||||
for _, env := range b.Env {
|
for _, env := range b.Env {
|
||||||
parts := strings.Split(env, "=")
|
parts := strings.SplitN(env, "=", 2)
|
||||||
if len(parts) != 2 {
|
if len(parts) != 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue