Skip to content

Commit

Permalink
0.1.9
Browse files Browse the repository at this point in the history
Final tests
  • Loading branch information
Sharpz7 authored Jan 25, 2021
2 parents 2002130 + bbf4d64 commit 558cea3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.1.7
VERSION=0.1.9
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation
===========
On linux, just run:
```console
adam@console~$ sudo curl -s -L https://github.com/Sharpz7/sharpcd/releases/download/0.1.7/install.sh | sudo bash
adam@console~$ sudo curl -s -L https://github.com/Sharpz7/sharpcd/releases/download/0.1.9/install.sh | sudo bash
```

Maintainers and Developers
Expand Down
23 changes: 11 additions & 12 deletions src/jobs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"io/ioutil"
"net/http"
"os"
Expand Down Expand Up @@ -137,17 +136,18 @@ func (job *taskJob) DockerCmd() *exec.Cmd {

// Make sure config is valid
err = job.buildCommand("-f", composeLoc, "up", "--no-start")
if err != nil {
return nil
}
// Remove any previous containers
job.buildCommand("-f", composeLoc, "down")
if err == nil {
// Remove any previous containers
job.buildCommand("-f", composeLoc, "down")

// Run Code
job.buildCommand("-f", composeLoc, "up", "-d")
// Run Code
job.buildCommand("-f", composeLoc, "up", "-d")

if job.Registry != "" {
job.dockerLogout()
if job.Registry != "" {
job.dockerLogout()
}
} else {
return nil
}
}

Expand Down Expand Up @@ -176,7 +176,6 @@ func (job *taskJob) dockerLogin() {
cmd := exec.Command("docker", "login", "-u", job.Enviroment["DOCKER_USER"], "-p", job.Enviroment["DOCKER_PASS"], job.Registry)
out, err := cmd.CombinedOutput()
errMsg := string(out)
fmt.Println(errMsg)
handleAPI(err, job, errMsg)
}

Expand All @@ -192,12 +191,12 @@ func (job *taskJob) buildCommand(args ...string) error {
cmd := exec.Command("docker-compose", args...)
cmd.Env = job.insertEnviroment()
out, err := cmd.CombinedOutput()
fmt.Println(string(out))

// Add conditions for volumes and networks
if strings.Contains(string(out), "404") {
errMsg = "No Compose File Found!"
handleAPI(err, job, errMsg)
return err
} else if strings.Contains(string(out), "manually using `") {

for {
Expand Down
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
case "changetoken":
changeToken()
case "version":
fmt.Println("Version: 0.1.7")
fmt.Println("Version: 0.1.9")
default:
log.Fatal("This subcommand does not exist!")
}
Expand Down

0 comments on commit 558cea3

Please sign in to comment.