|
|
@@ -211,6 +211,7 @@ var stream bool
|
|
|
var buildFlagsEnv []string
|
|
|
var forcePush bool
|
|
|
var useCache bool
|
|
|
+var cacheImage string
|
|
|
|
|
|
func init() {
|
|
|
buildFlagsEnv = []string{}
|
|
|
@@ -233,6 +234,13 @@ func init() {
|
|
|
"Whether to use cache (currently in beta)",
|
|
|
)
|
|
|
|
|
|
+ updateCmd.PersistentFlags().StringVar(
|
|
|
+ &cacheImage,
|
|
|
+ "cache-image",
|
|
|
+ "",
|
|
|
+ "Image repo URI to use for the cache image",
|
|
|
+ )
|
|
|
+
|
|
|
updateCmd.PersistentFlags().StringVar(
|
|
|
&namespace,
|
|
|
"namespace",
|
|
|
@@ -461,6 +469,7 @@ func updateGetAgent(client *api.Client) (*deploy.DeployAgent, error) {
|
|
|
Method: buildMethod,
|
|
|
AdditionalEnv: additionalEnv,
|
|
|
UseCache: useCache,
|
|
|
+ CacheImageRepo: cacheImage,
|
|
|
},
|
|
|
Local: source != "github",
|
|
|
})
|
|
|
@@ -556,6 +565,12 @@ func updateBuildWithAgent(updateAgent *deploy.DeployAgent) error {
|
|
|
}
|
|
|
|
|
|
func updatePushWithAgent(updateAgent *deploy.DeployAgent) error {
|
|
|
+ if useCache && cacheImage != "" {
|
|
|
+ color.New(color.FgGreen).Println("Skipping image push for", app, "as use-cache is set")
|
|
|
+
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+
|
|
|
// push the deployment
|
|
|
color.New(color.FgGreen).Println("Pushing new image for", app)
|
|
|
|