|
@@ -1,6 +1,9 @@
|
|
|
package actions
|
|
package actions
|
|
|
|
|
|
|
|
-import "fmt"
|
|
|
|
|
|
|
+import (
|
|
|
|
|
+ "fmt"
|
|
|
|
|
+ "path/filepath"
|
|
|
|
|
+)
|
|
|
|
|
|
|
|
func getCheckoutCodeStep() GithubActionYAMLStep {
|
|
func getCheckoutCodeStep() GithubActionYAMLStep {
|
|
|
return GithubActionYAMLStep{
|
|
return GithubActionYAMLStep{
|
|
@@ -41,7 +44,7 @@ func getConfigurePorterStep(porterTokenSecretName string) GithubActionYAMLStep {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const dockerBuildPush string = `
|
|
const dockerBuildPush string = `
|
|
|
-docker build . --file %s -t %s:$(git rev-parse --short HEAD)
|
|
|
|
|
|
|
+docker build %s --file %s -t %s:$(git rev-parse --short HEAD)
|
|
|
docker push %s:$(git rev-parse --short HEAD)
|
|
docker push %s:$(git rev-parse --short HEAD)
|
|
|
`
|
|
`
|
|
|
|
|
|
|
@@ -49,7 +52,7 @@ func getDockerBuildPushStep(dockerFilePath, repoURL string) GithubActionYAMLStep
|
|
|
return GithubActionYAMLStep{
|
|
return GithubActionYAMLStep{
|
|
|
Name: "Docker build, push",
|
|
Name: "Docker build, push",
|
|
|
ID: "docker_build_push",
|
|
ID: "docker_build_push",
|
|
|
- Run: fmt.Sprintf(dockerBuildPush, dockerFilePath, repoURL, repoURL),
|
|
|
|
|
|
|
+ Run: fmt.Sprintf(dockerBuildPush, filepath.Dir(dockerFilePath), dockerFilePath, repoURL, repoURL),
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|