Skip to content

Commit 91a7e65

Browse files
committed
Add command "service unapplied-changes"
1 parent 42e5b83 commit 91a7e65

File tree

6 files changed

+237
-16
lines changed

6 files changed

+237
-16
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Add the `--snapshot` flag to the volume creation command, to create a volume from a snapshot.
66
- https://github.com/koyeb/koyeb-cli/pull/254/files
77
- https://github.com/koyeb/koyeb-cli/pull/255/files
8+
* Add command `koyeb service unapplied-changes <service_id>` to view the changes that have been made with `koyeb service update --save-only`.
9+
- https://github.com/koyeb/koyeb-cli/pull/258
810

911
## v5.1.0 (2024-09-26)
1012

docs/reference.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Koyeb CLI
4444
* [koyeb regional-deployments](#koyeb-regional-deployments) - Regional deployments
4545
* [koyeb secrets](#koyeb-secrets) - Secrets
4646
* [koyeb services](#koyeb-services) - Services
47+
* [koyeb snapshots](#koyeb-snapshots) - Manage snapshots
4748
* [koyeb version](#koyeb-version) - Get version
4849
* [koyeb volumes](#koyeb-volumes) - Manage persistent volumes
4950

@@ -283,7 +284,7 @@ See examples of koyeb service create --help
283284
--checks-grace-period strings Set healthcheck grace period in seconds.
284285
Use the format <healthcheck>=<seconds>, for example --checks-grace-period 8080=10
285286
286-
--deployment-strategy string Deployment strategy, either "rolling" (default), "canary", "blue-green" or "immediate".
287+
--deployment-strategy STRATEGY Deployment strategy, either "rolling" (default), "blue-green" or "immediate".
287288
--docker string Docker image
288289
--docker-args strings Set arguments to the docker command. To provide multiple arguments, use the --docker-args flag multiple times.
289290
--docker-command string Set the docker CMD explicitly. To provide arguments to the command, use the --docker-args flag.
@@ -319,7 +320,7 @@ See examples of koyeb service create --help
319320
--privileged Whether the service container should run in privileged mode
320321
--regions strings Add a region where the service is deployed. You can specify this flag multiple times to deploy the service in multiple regions.
321322
To update a service and remove a region, prefix the region name with '!', for example --region '!par'
322-
If the region is not specified on service creation, the service is deployed in fra
323+
If the region is not specified on service creation, the service is deployed in was
323324
324325
--routes strings Update service routes (available for services of type "web" only) using the format PATH[:PORT], for example '/foo:8080'
325326
PORT defaults to 8000
@@ -575,7 +576,7 @@ koyeb deploy <path> <app>/<service> [flags]
575576
--checks-grace-period strings Set healthcheck grace period in seconds.
576577
Use the format <healthcheck>=<seconds>, for example --checks-grace-period 8080=10
577578
578-
--deployment-strategy string Deployment strategy, either "rolling" (default), "canary", "blue-green" or "immediate".
579+
--deployment-strategy STRATEGY Deployment strategy, either "rolling" (default), "blue-green" or "immediate".
579580
--env strings Update service environment variables using the format KEY=VALUE, for example --env FOO=bar
580581
To use the value of a secret as an environment variable, specify the secret name preceded by @, for example --env FOO=@bar
581582
To delete an environment variable, prefix its name with '!', for example --env '!FOO'
@@ -591,7 +592,7 @@ koyeb deploy <path> <app>/<service> [flags]
591592
--privileged Whether the service container should run in privileged mode
592593
--regions strings Add a region where the service is deployed. You can specify this flag multiple times to deploy the service in multiple regions.
593594
To update a service and remove a region, prefix the region name with '!', for example --region '!par'
594-
If the region is not specified on service creation, the service is deployed in fra
595+
If the region is not specified on service creation, the service is deployed in was
595596
596597
--routes strings Update service routes (available for services of type "web" only) using the format PATH[:PORT], for example '/foo:8080'
597598
PORT defaults to 8000
@@ -1318,6 +1319,7 @@ Services
13181319
* [koyeb services pause](#koyeb-services-pause) - Pause service
13191320
* [koyeb services redeploy](#koyeb-services-redeploy) - Redeploy service
13201321
* [koyeb services resume](#koyeb-services-resume) - Resume service
1322+
* [koyeb services unapplied-changes](#koyeb-services-unapplied-changes) - Show unapplied changes saved with the --save-only flag, which will be applied in the next deployment
13211323
* [koyeb services update](#koyeb-services-update) - Update service
13221324

13231325
## koyeb services create
@@ -1375,7 +1377,7 @@ $> koyeb service create myservice --app myapp --docker nginx --port 80:tcp
13751377
--checks-grace-period strings Set healthcheck grace period in seconds.
13761378
Use the format <healthcheck>=<seconds>, for example --checks-grace-period 8080=10
13771379
1378-
--deployment-strategy string Deployment strategy, either "rolling" (default), "canary", "blue-green" or "immediate".
1380+
--deployment-strategy STRATEGY Deployment strategy, either "rolling" (default), "blue-green" or "immediate".
13791381
--docker string Docker image
13801382
--docker-args strings Set arguments to the docker command. To provide multiple arguments, use the --docker-args flag multiple times.
13811383
--docker-command string Set the docker CMD explicitly. To provide arguments to the command, use the --docker-args flag.
@@ -1411,7 +1413,7 @@ $> koyeb service create myservice --app myapp --docker nginx --port 80:tcp
14111413
--privileged Whether the service container should run in privileged mode
14121414
--regions strings Add a region where the service is deployed. You can specify this flag multiple times to deploy the service in multiple regions.
14131415
To update a service and remove a region, prefix the region name with '!', for example --region '!par'
1414-
If the region is not specified on service creation, the service is deployed in fra
1416+
If the region is not specified on service creation, the service is deployed in was
14151417
14161418
--routes strings Update service routes (available for services of type "web" only) using the format PATH[:PORT], for example '/foo:8080'
14171419
PORT defaults to 8000
@@ -1743,6 +1745,39 @@ koyeb services resume NAME [flags]
17431745

17441746

17451747

1748+
* [koyeb services](#koyeb-services) - Services
1749+
1750+
## koyeb services unapplied-changes
1751+
1752+
Show unapplied changes saved with the --save-only flag, which will be applied in the next deployment
1753+
1754+
```
1755+
koyeb services unapplied-changes SERVICE_NAME [flags]
1756+
```
1757+
1758+
### Options
1759+
1760+
```
1761+
-a, --app string Service application
1762+
-h, --help help for unapplied-changes
1763+
```
1764+
1765+
### Options inherited from parent commands
1766+
1767+
```
1768+
-c, --config string config file (default is $HOME/.koyeb.yaml)
1769+
-d, --debug enable the debug output
1770+
--debug-full do not hide sensitive information (tokens) in the debug output
1771+
--force-ascii only output ascii characters (no unicode emojis)
1772+
--full do not truncate output
1773+
--organization string organization ID
1774+
-o, --output output output format (yaml,json,table)
1775+
--token string API token
1776+
--url string url of the api (default "https://app.koyeb.com")
1777+
```
1778+
1779+
1780+
17461781
* [koyeb services](#koyeb-services) - Services
17471782

17481783
## koyeb services update
@@ -1795,7 +1830,7 @@ $> koyeb service update myapp/myservice --port 80:tcp --route '!/'
17951830
--checks-grace-period strings Set healthcheck grace period in seconds.
17961831
Use the format <healthcheck>=<seconds>, for example --checks-grace-period 8080=10
17971832
1798-
--deployment-strategy string Deployment strategy, either "rolling" (default), "canary", "blue-green" or "immediate".
1833+
--deployment-strategy STRATEGY Deployment strategy, either "rolling" (default), "blue-green" or "immediate".
17991834
--docker string Docker image
18001835
--docker-args strings Set arguments to the docker command. To provide multiple arguments, use the --docker-args flag multiple times.
18011836
--docker-command string Set the docker CMD explicitly. To provide arguments to the command, use the --docker-args flag.
@@ -1833,7 +1868,7 @@ $> koyeb service update myapp/myservice --port 80:tcp --route '!/'
18331868
--privileged Whether the service container should run in privileged mode
18341869
--regions strings Add a region where the service is deployed. You can specify this flag multiple times to deploy the service in multiple regions.
18351870
To update a service and remove a region, prefix the region name with '!', for example --region '!par'
1836-
If the region is not specified on service creation, the service is deployed in fra
1871+
If the region is not specified on service creation, the service is deployed in was
18371872
18381873
--routes strings Update service routes (available for services of type "web" only) using the format PATH[:PORT], for example '/foo:8080'
18391874
PORT defaults to 8000

go.mod

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/koyeb/koyeb-cli
22

3-
go 1.18
3+
go 1.21
4+
5+
toolchain go1.22.3
46

57
require (
68
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
@@ -22,6 +24,7 @@ require (
2224
github.com/spf13/pflag v1.0.5
2325
github.com/spf13/viper v1.13.0
2426
github.com/stretchr/testify v1.8.0
27+
github.com/yudai/gojsondiff v1.0.0
2528
golang.org/x/term v0.8.0
2629
)
2730

@@ -38,23 +41,28 @@ require (
3841
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
3942
github.com/inconshreveable/mousetrap v1.0.1 // indirect
4043
github.com/magiconair/properties v1.8.6 // indirect
44+
github.com/mattn/go-colorable v0.1.13 // indirect
45+
github.com/mattn/go-isatty v0.0.20 // indirect
4146
github.com/mattn/go-runewidth v0.0.14 // indirect
4247
github.com/mitchellh/mapstructure v1.5.0 // indirect
4348
github.com/pelletier/go-toml v1.9.5 // indirect
4449
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
4550
github.com/pmezard/go-difflib v1.0.0 // indirect
4651
github.com/rivo/uniseg v0.4.2 // indirect
4752
github.com/russross/blackfriday/v2 v2.1.0 // indirect
53+
github.com/sergi/go-diff v1.3.1 // indirect
4854
github.com/spf13/afero v1.9.2 // indirect
4955
github.com/spf13/cast v1.5.0 // indirect
5056
github.com/spf13/jwalterweatherman v1.1.0 // indirect
5157
github.com/subosito/gotenv v1.4.1 // indirect
5258
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
5359
github.com/ulikunitz/xz v0.5.10 // indirect
60+
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
61+
github.com/yudai/pp v2.0.1+incompatible // indirect
5462
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect
5563
golang.org/x/net v0.0.0-20220927171203-f486391704dc // indirect
5664
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
57-
golang.org/x/sys v0.8.0 // indirect
65+
golang.org/x/sys v0.25.0 // indirect
5866
golang.org/x/text v0.3.7 // indirect
5967
google.golang.org/appengine v1.6.7 // indirect
6068
google.golang.org/protobuf v1.28.1 // indirect

0 commit comments

Comments
 (0)