Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/generated/oc_by_example_content.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,17 @@ Revert part of an application back to a previous deployment

[options="nowrap"]
----
// Perform a rollback
$ openshift cli rollback deployment-1
// Perform a rollback to the last successfully completed deployment for a deploymentconfig
$ openshift cli rollback frontend

// See what the rollback will look like, but don't perform the rollback
$ openshift cli rollback deployment-1 --dry-run
// See what a rollback to version 3 will look like, but don't perform the rollback
$ openshift cli rollback frontend --to-version=3 --dry-run

// Perform a rollback to a specific deployment
$ openshift cli rollback frontend-2

// Perform the rollback manually by piping the JSON of the new config back to openshift cli
$ openshift cli rollback deployment-1 --output=json | openshift cli update deploymentConfigs deployment -f -
$ openshift cli rollback frontend --output=json | openshift cli update deploymentConfigs deployment -f -
----
====

Expand Down
15 changes: 14 additions & 1 deletion hack/test-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,29 @@ echo "scale: ok"

oc process -f examples/sample-app/application-template-dockerbuild.json -l app=dockerbuild | oc create -f -
wait_for_command 'oc get rc/database-1' "${TIME_MIN}"

oc rollback database --to-version=1 -o=yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make a separate stanza for rollback and add the rollback: ok message in the end ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up this and some nearby tests.

oc rollback dc/database --to-version=1 -o=yaml
oc rollback dc/database --to-version=1 --dry-run
oc rollback database-1 -o=yaml
oc rollback rc/database-1 -o=yaml
# should fail because there's no previous deployment
[ ! "$(oc rollback database -o yaml)" ]
echo "rollback: ok"

oc get dc/database
oc stop dc/database
[ ! "$(oc get dc/database)" ]
[ ! "$(oc get rc/database-1)" ]
echo "stop: ok"

oc label bc ruby-sample-build acustom=label
[ "$(oc describe bc/ruby-sample-build | grep 'acustom=label')" ]
oc delete all -l app=dockerbuild
echo "label: ok"

oc delete all -l app=dockerbuild
echo "delete: ok"

oc process -f examples/sample-app/application-template-dockerbuild.json -l build=docker | oc create -f -
oc get buildConfigs
oc get bc
Expand Down
Loading