Oracle Cloud Infrastructure Compute Plugin allows users to access and manage cloud resources on the Oracle Cloud Infrastructure (OCI) from Jenkins. A Jenkins master instance with Oracle Cloud Infrastructure Compute Plugin can spin up OCI Instances (slaves or agents) on demand within OCI, and remove the Instances and free its resources automatically once the Job completes.
Oracle Cloud Infrastructure Compute Plugin provides functionality to dynamically allocate OCI resources for continuous integration tasks, and to bring up and down OCI Instances and resources as required to serve Jenkins Build Jobs.
After installing the Plugin, you can add OCI Clouds and Templates with your required OCI Instance configuration. The Template will have a Label that you can use in your Jenkins Job. Multiple Templates are supported. The Template options include Labels, Domains, Credentials, Shapes, Images, Virtual Cloud Network, Template Instance Cap, etc. After your Jenkins Job completes its work, the OCI Instance is cleanly removed and resources are released back to the OCI pool.
View Oracle Cloud Infrastructure Compute Plugin page on the plugins.jenkins.io site for more information.
Oracle Cloud Account. To sign up, visit Oracle Cloud.
Jenkins installed with JDK 8 or higher.
Required Plugins: bouncycastle API and Credentials.
Minimum Jenkins requirement: 2.138.4
There are a number of ways to install the Oracle Cloud Infrastructure Compute Plugin.
The simplest and most common way of installing plugins is through the Manage Jenkins > Manage Plugins view, available to administrators of a Jenkins environment.
To install the Plugin in Jenkins:
Administrators may also use the Jenkins CLI which provides a command to install plugins.
The Oracle Cloud Infrastructure Compute Plugin is available via Jenkins Update Center or can be installed manually.
java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin SOURCE ... [-deploy] [-name VAL] [-restart] Installs a plugin either from a file, an URL, or from update center. SOURCE : If this points to a local file, that file will be installed. If this is an URL, Jenkins downloads the URL and installs that as a plugin.Otherwise the name is assumed to be the short name of the plugin i.e. "oracle-cloud-infrastructure-compute",and the plugin will be installed from the update center. -deploy : Deploy plugins right away without postponing them until the reboot. -name VAL : If specified, the plugin will be installed as this short name (whereas normally the name is inferred from the source name automatically). -restart : Restart Jenkins upon successful installation.
Link to latest .hpi version can be found here.
Using the .hpi file that has been explicitly downloaded by a systems administrator, the administrator can manually copy the downloaded .hpi file into the JENKINS_HOME/plugins directory on the Jenkins master. Link to latest .hpi version can be found here.
The Jenkins master will need to be restarted before the plugin is loaded and made available in the Jenkins environment.
Jenkins plugins are packaged as self-contained .hpi files, which have all the necessary code, images, and other resources which the plugin needs to operate successfully.
If desired, you can build the Oracle Cloud Infrastructure Compute Plugin .hpi from the source code, and then install the .hpi file in Jenkins.
To build the .hpi file, OCI Java SDK is required and is available on Maven Central and JCenter.
Refer to OCI Java SDK licensing here.
Compile the Plugin
git clone repo
If you want to use the latest version of OCI Java SDK, update pom.xml
Compile and Install package:
$ mvn package
Install the Plugin
A logged-in Jenkins administrator may upload the file from within the web UI.
The System Administrator can copy the .hpi file into the JENKINS_HOME/plugins directory on the Jenkins master. The master will need to be restarted before the plugin is loaded and made available in the Jenkins environment.
Updates are listed in the Updates tab of the Manage Plugins page and can be installed by checking the checkbox of the Oracle Cloud Infrastructure Compute plugin updates and clicking the Download now and install after restart button.
Note: Upgrading the Plugin may require you to update your already created OCI Cloud and Templates Configuration. After upgrade please check all OCI Cloud values are OK in Manage Jenkins > Configure System. For example, a new method of adding OCI Credentials was added in v106 of the Plugin. Previously these OCI Credentials were added in the OCI Cloud Configuration. If upgrading to v106 from an earlier version, then you may have to update the values in your existing Cloud configuration.
Note: A plugin version with new functionality may only take effect on Slaves built with that new version. You may need to remove older Slaves.
Oracle Cloud Infrastructure Credentials are required to connect to your Oracle Cloud Infrastructure. For more information on OCI Credentials and other required keys, please see Security Credentials.
You can add these OCI Credentials by navigating to the Jenkins Server console, Credentials, System, and Add Credentials
by navigating to the Jenkins Server console, click Manage Jenkins, and Configure System. In Cloud section, click Add a new cloud and select Oracle Cloud Infrastructure Compute. In Credentials, click Add.
Once in the New Credentials Screen, select Oracle Cloud Infrastructure Credentials from the Kind Drop-Down.
Click Verify Credentials that you can connect successfully to your Oracle Cloud Infrastructure.
From Jenkins Server console, click Manage Jenkins, and Configure System
In Cloud section, click Add a new cloud and select Oracle Cloud Infrastructure Compute
Enter credentials to access your OCI account. You can create multiple Clouds.
Click Advanced for more options.
Click Add in Instance Templates section to add the OCI configuration. You can add multiple Templates to a Cloud configuration.
Input or select values in the Instance Template section:
Click Advanced for more options:
Click Save or Apply
Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
This Plugin is licensed under the Universal Permissive License 1.0
This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0.
See LICENSE.txt for more details.
For CHANGELOG please refer to CHANGELOG.md.
Oracle Cloud Infrastructure Compute Plugin is an open source project. See CONTRIBUTING.md for more details.
Oracle gratefully acknowledges the contributions to Oracle Cloud Infrastructure Compute Plugin that have been made by the community.