Explorar el Código

add build args to docker build step

Alexander Belanger hace 5 años
padre
commit
5d774165f6
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      internal/integrations/ci/actions/steps.go

+ 2 - 1
internal/integrations/ci/actions/steps.go

@@ -45,7 +45,8 @@ func getConfigurePorterStep(porterTokenSecretName string) GithubActionYAMLStep {
 
 
 const dockerBuildPush string = `
 const dockerBuildPush string = `
 export $(echo "${{secrets.%s}}" | xargs)
 export $(echo "${{secrets.%s}}" | xargs)
-sudo docker build %s --file %s -t %s:$(git rev-parse --short HEAD)
+echo "${{secrets.%s}}" > ./env_porter
+sudo docker build %s $(cat ./env_porter | sed 's@^@--build-arg @g' | paste -s -d " " -) --file %s -t %s:$(git rev-parse --short HEAD)
 sudo docker push %s:$(git rev-parse --short HEAD)
 sudo docker push %s:$(git rev-parse --short HEAD)
 `
 `