[fix] git proxy
This commit is contained in:
@@ -34,6 +34,7 @@ import (
|
||||
"github.com/go-git/go-billy/v5/memfs"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
gitProxy "github.com/go-git/go-git/v5/plumbing/transport"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
http2 "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
|
||||
|
||||
@@ -107,7 +108,6 @@ func createSchedule(ctx context.Context, scheduleId, workflowId, name, startNode
|
||||
|
||||
log.Printf("[INFO] Starting frequency for execution: %d", newfrequency)
|
||||
|
||||
|
||||
//jobret, err := newscheduler.Every(newfrequency).Seconds().NotImmediately().Run(job)
|
||||
jobret, err := newscheduler.Every(newfrequency).Seconds().Run(job)
|
||||
if err != nil {
|
||||
@@ -741,7 +741,6 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) {
|
||||
func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workflowExecutionId string, actionResult shuffle.ActionResult, resp http.ResponseWriter) {
|
||||
log.Printf("[DEBUG][%s] Running workflow execution update", workflowExecutionId)
|
||||
|
||||
|
||||
// Should start a tx for the execution here
|
||||
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, workflowExecutionId)
|
||||
if err != nil {
|
||||
@@ -984,8 +983,6 @@ func deleteWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
resp.Write([]byte(`{"success": true}`))
|
||||
}
|
||||
|
||||
|
||||
|
||||
func handleExecution(id string, workflow shuffle.Workflow, request *http.Request, orgId string) (shuffle.WorkflowExecution, string, error) {
|
||||
//go func() {
|
||||
// log.Printf("\n\nPRE TIME: %s\n\n", time.Now().Format("2006-01-02 15:04:05"))
|
||||
@@ -1080,7 +1077,6 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
err := imageCheckBuilder(execInfo.ImageNames)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Failed building the required images from %#v: %s", execInfo.ImageNames, err)
|
||||
@@ -1354,7 +1350,7 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request
|
||||
}
|
||||
}
|
||||
|
||||
childNodes := shuffle.FindChildNodes(workflowExecution, workflowExecution.Start, []string{}, []string{})
|
||||
childNodes := shuffle.FindChildNodes(workflowExecution.Workflow, workflowExecution.Start, []string{}, []string{})
|
||||
|
||||
startFound := false
|
||||
newActions := []shuffle.Action{}
|
||||
@@ -2651,6 +2647,18 @@ func loadGithubWorkflows(url, username, password, userId, branch, orgId string)
|
||||
URL: url,
|
||||
}
|
||||
|
||||
if os.Getenv("HTTP_PROXY") != "" {
|
||||
cloneOptions.ProxyOptions = gitProxy.ProxyOptions{
|
||||
URL: os.Getenv("HTTP_PROXY"),
|
||||
}
|
||||
}
|
||||
|
||||
if os.Getenv("HTTPS_PROXY") != "" {
|
||||
cloneOptions.ProxyOptions = gitProxy.ProxyOptions{
|
||||
URL: os.Getenv("HTTPS_PROXY"),
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Better auth.
|
||||
if len(username) > 0 && len(password) > 0 {
|
||||
cloneOptions.Auth = &http2.BasicAuth{
|
||||
@@ -4193,7 +4201,6 @@ func checkUnfinishedExecution(resp http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("[ERROR] Failed adding execution to db: %s", err)
|
||||
}
|
||||
|
||||
|
||||
resp.WriteHeader(200)
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "Reran workflow in %s"}`, parsedEnv)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user