Skip to content

Commit

Permalink
Remove out.tar.gz (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeCooper authored and sdan committed Oct 17, 2020
1 parent 38743a6 commit 28d3472
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions controller/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"bytes"
"compress/gzip"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"

"github.com/monochromegane/go-gitignore"
"github.com/railwayapp/cli/entity"
)

func compress(src string, buf io.Writer) error {
Expand Down Expand Up @@ -69,27 +70,26 @@ func compress(src string, buf io.Writer) error {
}

func (c *Controller) Up(ctx context.Context) error {
// projectID, err := c.cfg.GetProject()
// if err != nil {
// return err
// }
// environmentID, err := c.cfg.GetEnvironment()
// if err != nil {
// return err
// }
projectID, err := c.cfg.GetProject()
if err != nil {
return err
}
environmentID, err := c.cfg.GetEnvironment()
if err != nil {
return err
}
var buf bytes.Buffer
if err := compress("./", &buf); err != nil {
return err
}
ioutil.WriteFile("./out.tar.gz", buf.Bytes(), 0777)
// res, err := c.gtwy.Up(ctx, &entity.UpRequest{
// Data: buf,
// ProjectID: projectID,
// EnvironmentID: environmentID,
// })
// if err != nil {
// return err
// }
//fmt.Printf("Deploy available at %s\n", res.URL)
res, err := c.gtwy.Up(ctx, &entity.UpRequest{
Data: buf,
ProjectID: projectID,
EnvironmentID: environmentID,
})
if err != nil {
return err
}
fmt.Printf("Deploy available at %s\n", res.URL)
return nil
}

0 comments on commit 28d3472

Please sign in to comment.