Fixed an issue with app building onprem
This commit is contained in:
@@ -473,7 +473,9 @@ func buildImage(tags []string, dockerfileLocation string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client, err := client.NewEnvClient()
|
client, err := client.NewEnvClient()
|
||||||
@@ -495,7 +497,7 @@ func buildImage(tags []string, dockerfileLocation string) error {
|
|||||||
// Builds the entire folder into buf
|
// Builds the entire folder into buf
|
||||||
err = getParsedTar(tw, baseDir, "")
|
err = getParsedTar(tw, baseDir, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Tar issue: %s", err)
|
log.Printf("[ERROR] Tar issue during app build: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dockerFileTarReader := bytes.NewReader(buf.Bytes())
|
dockerFileTarReader := bytes.NewReader(buf.Bytes())
|
||||||
@@ -515,6 +517,16 @@ func buildImage(tags []string, dockerfileLocation string) error {
|
|||||||
buildOptions.BuildArgs["https_proxy"] = &httpsProxy
|
buildOptions.BuildArgs["https_proxy"] = &httpsProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print the actual file content from dockerFileTarReader
|
||||||
|
/*
|
||||||
|
data, err := ioutil.ReadAll(dockerFileTarReader)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("[ERROR] Failed reading Dockerfile TAR reader: %s", err)
|
||||||
|
} else {
|
||||||
|
log.Printf("[DEBUG] Dockerfile TAR reader content: %s", string(data))
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Build the actual image
|
// Build the actual image
|
||||||
imageBuildResponse, err := client.ImageBuild(
|
imageBuildResponse, err := client.ImageBuild(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -539,7 +551,6 @@ func buildImage(tags []string, dockerfileLocation string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require (
|
|||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/h2non/filetype v1.1.3
|
github.com/h2non/filetype v1.1.3
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shuffle/shuffle-shared v0.8.70
|
github.com/shuffle/shuffle-shared v0.8.71
|
||||||
golang.org/x/crypto v0.37.0
|
golang.org/x/crypto v0.37.0
|
||||||
google.golang.org/api v0.228.0
|
google.golang.org/api v0.228.0
|
||||||
google.golang.org/grpc v1.71.1
|
google.golang.org/grpc v1.71.1
|
||||||
|
|||||||
@@ -341,8 +341,8 @@ github.com/sendgrid/sendgrid-go v3.14.0+incompatible h1:KDSasSTktAqMJCYClHVE94Fc
|
|||||||
github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
|
github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
|
||||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||||
github.com/shuffle/shuffle-shared v0.8.70 h1:Balbk7kIVUSgM9Lc+VJ09ZpaF18MlFxMPZdkPTD/+gU=
|
github.com/shuffle/shuffle-shared v0.8.71 h1:OhiBpIEkn+1+uRs4nn9jPtjdT0dVfVl6VQKtaFzUtZY=
|
||||||
github.com/shuffle/shuffle-shared v0.8.70/go.mod h1:OLAwH/Ym4941Jn5DF1oZaq6iBpmjG2SNrTZ9Xqck5So=
|
github.com/shuffle/shuffle-shared v0.8.71/go.mod h1:OLAwH/Ym4941Jn5DF1oZaq6iBpmjG2SNrTZ9Xqck5So=
|
||||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ import (
|
|||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/go-git/go-git/v5/plumbing"
|
"github.com/go-git/go-git/v5/plumbing"
|
||||||
"github.com/go-git/go-git/v5/storage/memory"
|
|
||||||
gitProxy "github.com/go-git/go-git/v5/plumbing/transport"
|
gitProxy "github.com/go-git/go-git/v5/plumbing/transport"
|
||||||
http2 "github.com/go-git/go-git/v5/plumbing/transport/http"
|
http2 "github.com/go-git/go-git/v5/plumbing/transport/http"
|
||||||
|
"github.com/go-git/go-git/v5/storage/memory"
|
||||||
|
|
||||||
// Random
|
// Random
|
||||||
xj "github.com/basgys/goxml2json"
|
xj "github.com/basgys/goxml2json"
|
||||||
@@ -2078,7 +2078,6 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) {
|
|||||||
resp.WriteHeader(500)
|
resp.WriteHeader(500)
|
||||||
resp.Write([]byte(`{"success": false, "reason": "Failed to run workflow. Check logs."}`))
|
resp.Write([]byte(`{"success": false, "reason": "Failed to run workflow. Check logs."}`))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func handlePipelineCallback(resp http.ResponseWriter, request *http.Request) {
|
func handlePipelineCallback(resp http.ResponseWriter, request *http.Request) {
|
||||||
@@ -3383,7 +3382,6 @@ func buildSwaggerApp(resp http.ResponseWriter, body []byte, user shuffle.User, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
log.Printf("[DEBUG] Successfully built app %s (%s)", api.Name, api.ID)
|
log.Printf("[DEBUG] Successfully built app %s (%s)", api.Name, api.ID)
|
||||||
if len(user.Id) > 0 {
|
if len(user.Id) > 0 {
|
||||||
resp.WriteHeader(200)
|
resp.WriteHeader(200)
|
||||||
@@ -3826,6 +3824,8 @@ func remoteOrgJobHandler(org shuffle.Org, interval int) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send stats once every 10 times or so..?
|
||||||
|
// For now, just send every time
|
||||||
info, err := shuffle.GetOrgStatistics(ctx, org.Id)
|
info, err := shuffle.GetOrgStatistics(ctx, org.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] Failed getting org statistics backup for org %s: %s", org.Id, err)
|
log.Printf("[ERROR] Failed getting org statistics backup for org %s: %s", org.Id, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user