Skip to content

Commit

Permalink
Update all source versions when updating the app
Browse files Browse the repository at this point in the history
Currently, when an app is updated, sources that existed in the app before are **not** updated automatically. This behavior is desired to avoid an app spec change that only changes, for example the scale of a component from picking up new code.

By setting the `UpdateAllSourceVersions` flag, the action now forces updates to **all** the sources of the app (either git based or image based) on the update.
  • Loading branch information
markusthoemmes committed Aug 8, 2024
1 parent 86e721e commit 47ea0d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deploy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (d *deployer) deploy(ctx context.Context, spec *godo.AppSpec) (*godo.App, e
}
} else {
d.action.Infof("app %q already exists, updating...", spec.Name)
app, _, err = d.apps.Update(ctx, app.GetID(), &godo.AppUpdateRequest{Spec: spec})
app, _, err = d.apps.Update(ctx, app.GetID(), &godo.AppUpdateRequest{Spec: spec, UpdateAllSourceVersions: true})
if err != nil {
return nil, fmt.Errorf("failed to update app: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/digitalocean/app_action
go 1.22.5

require (
github.com/digitalocean/godo v1.119.0
github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c
github.com/sethvargo/go-githubactions v1.2.0
github.com/stretchr/testify v1.9.0
sigs.k8s.io/yaml v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/digitalocean/godo v1.119.0 h1:dmFNQwSIAcH3z+FVovHLkazKDC2uA8oOlGvg5+H4vRw=
github.com/digitalocean/godo v1.119.0/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY=
github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c h1:qt+RbiIu2nHJHDFOwkSsE3uW6il3YUiqv0nqRXqRlLI=
github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
Expand Down

0 comments on commit 47ea0d5

Please sign in to comment.