Use OCIcli to Access Oracle Cloud Infrastructure Services

You can use Oracle Cloud Infrastructure command line interface (OCIcli) commands to create and manage Oracle Cloud Infrastructure objects and services when a build runs.

For more information about OCIcli and its commands, see the Oracle Cloud Infrastructure Command Line Interface documentation.
To configure the job, you'll need this information:
  • The User OCID
  • A private key that has been set with no passphrase

    Note:

    You shouldn't use a passphrase for OCI public/private keys in an OCIcli build step. If you do, when the build job encounters the key you'll be prompted for the passphrase, but, since you can't interact with the job's shell to supply it, the build will fail and an error will be reported in the build job's log. To avoid this problem, you'll need to generate a public-private key pair without a passphrase and upload the public key to your user preferences.

    See Upload Your Public SSH Key for information about generating an SSH key and uploading the public SSH key to your VB Studio account.

  • The fingerprint of a user who can create and access the resources
  • The tenancy name
Contact the OCI administrator and get the required OCI input values. Get OCI input Values explains where these values can be found.

Set Up a VM Build Executor and a Build Executor Template with OCIcli

Before you can create a build step that uses OCIcli commands, your organization administrator must create a build executor template that includes the OCIcli software and add a VM build executor that uses that build executor template. The build executor template can be created from scratch or software can be added to an existing build executor template.

Note:

To find your organization administrator, click Contacts under your user profile. Your administrator, or a list of administrators, will display.

See Create and Manage Build Executor Templates in Administering Visual Builder Studio.

After the organization administrator adds a VM build executor to the build executor template, you can create and configure a job to use that build executor template and add OCIcli commands.

Configure a Job to Run OCIcli Commands

Here's how you create and configure a job that runs OCIcli commands:

  1. Open the job’s configuration page.
    If you're creating a job, select Template in the New Job dialog and then select the OCIcli build executor template. After creating the job, proceed to step 4.
  2. Click Settings the Gear icon.
  3. In the Software tab, select the OCIcli build executor template.
  4. Click Configure Configure.
  5. Click the Steps tab.
  6. From Add Step, select OCIcli.
  7. In User OCID, enter the OCID of the user who can access or create OCI resources.
  8. In Fingerprint, enter the public key fingerprint of the user.
  9. In Tenancy, enter the tenancy OCID.
  10. In Private Key, enter the private key of the user.

    Use a private key that was set with no passphrase. If you don't have one, generate a public-private key pair without a passphrase and upload the public key to your user preferences. See Upload Your Public SSH Key for information about generating an SSH key and uploading the public SSH key to your VB Studio account.

  11. In Region, select the Oracle Cloud Infrastructure tenancy’s region.
  12. Scroll up and from Add Step, select Unix Shell.
  13. In Script, enter the OCIcli commands on separate lines.
  14. Click Save.

Add multiple Unix Shell steps to run additional sets of commands. Don’t add another OCIcli build step.