// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/developer-cli-commands.adoc

[id="cli-build-deploy-commands_{context}"]
= Build and Deploy CLI commands

== cancel-build

Cancel a running, pending, or new build.

.Example: Cancel a build
----
$ oc cancel-build python-1
----

.Example: Cancel all pending builds from the `python` BuildConfig
----
$ oc cancel-build buildconfig/python --state=pending
----

== import-image

Import the latest tag and image information from an image repository.

.Example: Import the latest image information
----
$ oc import-image my-ruby
----

== new-build

Create a new `BuildConfig` from source code.

.Example: Create a BuildConfig from a local Git repository
----
$ oc new-build .
----

.Example: Create a BuildConfig from a remote Git repository
----
$ oc new-build https://github.com/sclorg/cakephp-ex
----

== rollback

Revert an application back to a previous Deployment.

.Example: Roll back to the last successful Deployment
----
$ oc rollback php
----

.Example: Roll back to a specific version
----
$ oc rollback php --to-version=3
----

== rollout

Start a new rollout, view its status or history, or roll back to a previous
revision of your application.

.Example: Roll back to the last successful Deployment
----
$ oc rollout undo deploymentconfig/php
----

.Example: Start a new rollout for a DeploymentConfig with its latest state
----
$ oc rollout latest deploymentconfig/php
----

== start-build

Start a build from a `BuildConfig` or copy an existing build.

.Example: Start a build from the specified BuildConfig
----
$ oc start-build python
----

.Example: Start a build from a previous build
----
$ oc start-build --from-build=python-1
----

.Example: Set an environment variable to use for the current build
----
$ oc start-build python --env=mykey=myvalue
----

== tag

Tag existing images into imagestreams.

.Example: Configure the `ruby` image's `latest` tag to refer to the image for the `2.0` tag
----
$ oc tag ruby:latest ruby:2.0
----
