Run CLI commands in DevOps deployment pipelines with the new Shell stage

February 3, 2023 | 4 minute read
Srikrishna Padmannagari
Principal Product Manager
Jonathan Schreiber
Sr. Principal Product Manager
Text Size 100%:

We’re excited to announce the availability of the Shell stage, a new integration for Oracle Cloud Infrastructure (OCI) DevOps. This new feature of OCI DevOps service allows developers to run bash commands and scripts in a container that runs in your tenancy. The beauty of the DevOps deployment pipeline is the simplicity and integration with OCI deployment targets. We’re pleased to streamline the ability for teams to perform infrastructure changes, deploy to other targets, perform tests, and more.

With the Shell stage in a deployment pipeline, developers can now pass in a command spec with bash commands broken into steps tracked in the Oracle Cloud Console. Developers can easily consume any DevOps pipeline parameter in their command spec by referring to it, and they can also update any DevOps pipeline parameter. The command spec runs on containers invoked by the OCI Container Instances service in the selected compartment and subnet of your tenancy. You can select the container instance configuration before the deployment. When you run the deployment pipeline, you can see the process of the steps defined in the command spec in the pipeline output and logs. For syntax and examples of the command spec, see the Linux Command Specification.

Previously, running bash commands with OCI DevOps required manually setting up a dedicated virtual machine (VM) runner or configuring a complex build pipeline to run the bash commands on a build runner.

Key use cases for adding a Shell stage to your deployment pipeline

  • Run Database schema migration in a deployment pipeline: Developers can run a database schema migration as part of their deployment pipeline with software artifact deployment to compute platforms. For example, you can run an API change to OKE from a Helm chart deployment in one pipeline that includes the database schema changes to Autonomous Database service required by the API change.

  • Deploy a configuration to OCI services without a dedicated stage: Developers can deploy a change to a development or stage environment of their OCI platform, run tests, and then deploy to the production instance of their service.

  • Deploy to non-OCI platforms: Developers can deploy to non-OCI platforms from the deploy stage instructions.

  • Deploy with software-as-a-service (SaaS) dependencies: For applications with dependencies on SaaS resources and environments, you can send configuration commands to services, such as Oracle Integration Cloud ,for a release to properly interact with SaaS dependencies.

  • Run integration tests on built artifacts before deployment to production: Developers can deploy artifacts to a host to mock up dependent services and test the release artifact set before deploying to a development or staging environment.

  • Delete Kubernetes resources and run Kubernetes API beyond apply: Developers can customize their DevOps workflow to build an application pipeline that waits for some resources to be ready before the pipeline deploys more resources. This capability allows developers to specify an order of creation of resources during the application deployment. You achieve it by querying Kubernetes objects after deployment using the managed deployment stage and writing conditional commands to verify application readiness.

  • Run an infrastructure provisioning job to create infra needed in a deployment: Developers want to be able to run an infrastructure job with Terraform (though the CLI or Resource Manager service) or Ansible using the resource principal of the pipeline to create the infrastructure needed for an integration test. Create infrastructure required as part of a deployment strategy. For example, the Highlander or recreate release strategy where a new environment is created as part of the release process and the old environment is discarded, so that duplicate environments aren’t kept for all time, like in blue-green deployments.

Adding a Shell stage in the deployment pipeline

You can add a Shell stage using the Oracle Cloud Console with an API or the CLI. To get started, refer to the documentation. You can find code samples and an implementation guide for common use cases on Github.

Pricing for shell stage container instances consumption is based on the shape, OCPU, and memory configuration that you select.

Learn more

To get started with the DevOps service in your Oracle Cloud Infrastructure account, use the automated Quick Start reference architecture to deploy and run a DevOps pipeline. For documentation on the new Shell stage feature, see the Shell stage.

Srikrishna Padmannagari

Principal Product Manager

Jonathan Schreiber

Sr. Principal Product Manager

Jonathan is a product manager in the Developer Services group, working on DevOps and creating a great developer exeperience on Oracle Cloud. Previously, Jonathan worked in a variety of engineering an product roles at adtech and marketing startups. 

He studied history at the University of British Columbia where he also helped start a bike sharing co-op to improve the student experience!

Previous Post

Want to manage OKE persistent storage yourself? Longhorn is the answer

Mayank Kakani | 3 min read

Next Post

Oracle Named a Leader in Two Gartner® Magic Quadrant™ Reports: iPaaS and Data Integration

Brian Wood | 6 min read