Deploy Your Application to Oracle Cloud

You can deploy your project’s build artifacts to Oracle Java Cloud Service (JCS), to Oracle Application Container Cloud Service (ACCS), and to Oracle Java Cloud Service - SaaS Extension (JCS-SX) from Oracle Developer Cloud Service (DevCS) without leaving its web interface.

Deployment Concepts and Terms

Here are some concepts and terms that this documentation uses to describe deployment functions and components in DevCS.

Term Description

Deployment configuration

Defines how to deploy a build artifact to a target Oracle Cloud service.

Deployment target

An instance of the target Oracle Cloud service.

Continuous delivery

A method to automatically deploy a build artifact to the target service.

Deploy an Application to Oracle Java Cloud Service

You can deploy your application to a publicly available JCS instance and make it publicly accessible.

You can deploy your application from DevCS to JCS using the Oracle WebLogic RESTFul Management Interface or the SSH tunnel. You can use either the RESTful interface or SHH to deploy to the Oracle WebLogic Server 12c of JCS, but you can only use SSH to deploy to Oracle WebLogic Server 11g (10.3.x) of JCS.

Before creating a deployment configuration, enable the HTTPS or the SSH access rule in the JCS console. See Enabling Console Access in an Oracle Java Cloud Service in Administering Oracle Java Cloud Service.

Use the Oracle WebLogic RESTFul Management Interface

Deploying to JCS using the Oracle WebLogic RESTFul Management Interface is easy and doesn’t require any additional configuration.

  1. In the navigation bar, click Deployments Deployments.
  2. Click + Create Configuration.
  3. In Configuration Name, enter a name to identify the deployment configuration. By default, the same name is used by Application Name, however you can modify it.
  4. From the Deployment Target drop-down list, select the JCS target that uses the Oracle WebLogic RESTFul Management Interface.
  5. To deploy the artifact manually, from the Type options, select On Demand. To deploy the artifact automatically every time the specified job’s build is successful, select Automatic.
  6. In Job, Build, and Artifact, specify the job, build, and artifact to deploy to the target service.
    Build isn’t available if you selected Automatic as Type.
  7. If you selected On Demand as Type, click Save and Deploy. If you selected Automatic as Type, click Save.

Use SSH

To deploy to a JCS instance using SSH, you must set up an authenticated connection between DevCS and JCS.

To set up the connection, get the DevCS SSH public key and append it to the authorized_keys file of the JCS instance. Then, create a deployment configuration to deploy the artifact.

For more information about accessing the services and resources of a JCS instance via SSH, see Accessing a Node with a Secure Shell (SSH) in Administering Oracle Java Cloud Service.
Upload the DevCS public key to the JCS instance

This is a one-time step. After a connection is authenticated, you don’t have to repeat the steps to upload the public key.

  1. Get the DevCS SSH public key through the REST API.

    Use this URL syntax to get the key:

    https://<host-name>/<organization-name>/api/deployment/sshkey

    If the base URL of your DevCS instance is https://developer.us2.oraclecloud.com/my-org/, then your host name is developer.us2.oraclecloud.com and the organization name is my-org.

    Don’t enter the URL in the web browser address bar. Instead, use cURL or a browser REST plugin to get the SSH key. For more information about cURL, see http://curl.haxx.se/.

    cURL example:

    curl -u alex.admin:my_password https://developer.us2.oraclecloud.com/my-org/api/deployment/sshkey

    Use the same user name and the password that you use to access DevCS. When you have the key, copy the key string value and save it in a .pub file (for example, odcskey.pub).

  2. In the JCS console, open the Overview page of the service instance.
    To know more about the Overview page, see Exploring the Oracle Java Cloud Service Instance Overview Page in Administering Oracle Java Cloud Service.
  3. In the header of the Overview page, click Manage this service next to the Oracle Java Cloud Service link and select SSH Access.
  4. In the Add New Key dialog box, with Upload a new SSH Public Key value from file selected, click Browse, and select the DevCS SSH public key file that you saved in Step 1.
    You can also copy the key value to the Key Value text box.
  5. Click Add New Key.
  6. In the Add New Key dialog box, click Submit.

The DevCS SSH public key is added to the authorized_keys file of the JCS instance. After adding the public key, the instance restarts automatically. Wait for some time. The icon in the header section also changes. You can track the restart activity in the Activity Summary section of the Overview page. When the instance has restarted and the activity is complete, you see the Add SSH Key is Completed message in Activity Summary.

Create the Deployment Configuration
  1. Open DevCS.
  2. In the navigation bar, click Deployments Deployments.
  3. Click + Create Configuration.
  4. In Configuration Name, enter a name to identify the deployment configuration. By default, the same name is used by Application Name, however you can modify it.
  5. From the Deployment Target drop-down list, select the JCS target that uses SSH.
  6. To deploy the artifact manually, from the Type options, select On Demand. To deploy the artifact automatically every time the specified job’s build is successful, select Automatic.
  7. In Job, Build, and Artifact, specify the job, build, and artifact to deploy to the target service.
    Build isn’t available if you selected Automatic as Type.
  8. If you selected On Demand as Type, click Save and Deploy. If you selected Automatic as Type, click Save.

Add an Oracle Java Cloud Service Deployment Target

To deploy to JCS, you need the credentials of a user with the JaaS_Administrator (Java Administrators) identity domain role, public IP address of the JCS instance, and the port number of the WebLogic Server.

You can find the IP address and the port number from the software development environment in the Environments page, if configured. You can also find the details from Overview page of the JCS instance. See Exploring the Oracle Java Cloud Service Instance Overview Page and Understanding the Default Access Ports in Administering Oracle Java Cloud Service.
  1. On the Deployment Configuration page, from the New drop-down list of Deployment Target, select Java Cloud Service.
  2. In the Deploy to Java Cloud Service dialog box, select the WebLogic Server version and the protocol (Oracle WebLogic RESTFul Management Interface or SSH).
    You can’t deploy to Oracle WebLogic Server 11g (10.3.x) using the Oracle WebLogic RESTFul Management Interface.
  3. In Host, enter the public IP address of the JCS instance.
  4. In HTTPS Port, enter the HTTPS port number of the WebLogic Server that runs on the JCS instance. By default, it’s 7002.
    If you’ve selected the SSH protocol, in Administration Port, enter the admin port number of the WebLogic Admin Server that runs on the JCS instance. By default, it’s 9001.
  5. In Username and Password, enter the credentials of the user with the JaaS_Administrator (Java Administrators) identity domain role.
  6. Click Find Targets.
  7. In the Available Targets dialog box, select the JCS servers or clusters you want to deploy the application to. You can select more than one option.
    To know more about servers and clusters, see the Targeting Deployments to Servers, Clusters, and Virtual Hosts topic in Fusion Middleware Deploying Applications to Oracle WebLogic Server.
  8. Click OK.
  9. Continue filling in the details in the deployment configuration page.

Deploy an Application to Oracle Application Container Cloud Service

DevCS provides tools to build and deploy your Java, Java EE, PHP, and Node.js applications to ACCS.

You can deploy the application to the ACCS instance of any identity domain and data center. To deploy your application to ACCS, configure a job to create an archive of the application that includes the application, any dependent libraries, and the manifest.json file. See Packaging Your Application in Developing for Oracle Application Container Cloud Service.

You can deploy the application, undeploy it, and start and stop the application on the target ACCS instance. Other operations, such as scaling up and down of applications, can be managed from the ACCS console. See About Your Application and Oracle Application Container Cloud Service in Developing for Oracle Application Container Cloud Service.

  1. In the navigation bar, click Deployments Deployments.
  2. Click + Create Configuration.
  3. In Configuration Name, enter a name to identify the deployment configuration. By default, the same name is used by Application Name, however, you can modify it.
  4. From the Deployment Target drop-down list, select the target deployment service.
  5. In ACCS Properties, select the application type and subscription type.
  6. To deploy the artifact manually, from the Type options, select On Demand. To deploy the artifact automatically every time the specified job’s build is successful, select Automatic.
  7. In Job, Build, and Artifact, specify the job, build, and artifact to deploy to the target service.
    Build isn’t available if you selected Automatic as Type.
  8. To override the commands of the manifest file in the artifact zip, select the Include ACCS Manifest check box. For example, you can override the deployed application's version number at the time of deployment.
    In ACCS Manifest, enter the contents of the manifest file. The field is a code editor component and you can use code editor features.
  9. To enter the contents of the deployment descriptor, select the Include ACCS Deployment check box and enter the commands in ACCS Deployment.
    You can also enter commands to override the deployed application's container's configuration (such as RAM) at the time of deployment. The field is a code editor component and you can use code editor features.

    For more information about the ACCS metadata files, see Creating Metadata Files in Developing for Oracle Application Container Cloud Service.

  10. If you selected On Demand as Type, click Save and Deploy. If you selected Automatic as Type, click Save.

Add an Oracle Application Container Cloud Service Deployment Target

To deploy to ACCS, you need credentials of a user with the APaaS_Administrator (APaaS Administrator) identity domain role and the identity domain of the target service.

If you have an IDCS account, enter the value of Identity Service Id in the identity domain field. The Identity Service Id is displayed in the ACCS service details page.

  1. On the Deployment Configuration page, from the New drop-down list of Deployment Target, select Application Container Cloud .
  2. In the Deploy to Application Container Cloud dialog box, in Data Center, select the data center of the target ACCS instance.
  3. In Identity Domain, enter the traditional or IDCS identity domain name.
  4. In Username and Password, enter the credentials of the user with the APaaS_Administrator (APaaS Administrator) identity domain role.
  5. Click Test Connection.
  6. After the connection is successful, click Use Connection.
  7. Continue filling in the details in the deployment configuration page.

Deploy an Application to Oracle Java Cloud Service - SaaS Extension

You can deploy your application artifacts to the JCS-SX instance of the current identity domain and to a service instance of another data center or identity domain,.

To prepare your application to deploy to JCS-SX, see Preparing Applications for Oracle Java Cloud Service - SaaS Extension Deployment in Using Oracle Java Cloud Service - SaaS Extension.

  1. In the navigation bar, click Deployments Deployments.
  2. Click + Create Configuration.
  3. In Configuration Name, enter a name to identify the deployment configuration. By default, the same name is used by Application Name, however you can modify it.
  4. From the Deployment Target drop-down list, select the target deployment service.
  5. To deploy the artifact manually, from the Type options, select On Demand. To deploy the artifact automatically every time the specified job’s build is successful, select Automatic.
  6. In Job, Build, and Artifact, specify the job, build, and artifact to deploy to the target service.
    Build isn’t available if you selected Automatic as Type.
  7. If you selected On Demand as Type, click Save and Deploy. If you selected Automatic as Type, click Save.
See the deployment logs for the status of the deployment.

Add an Oracle Java Cloud Service - SaaS Extension Deployment Target

To deploy to JCS-SX, you need credentials of a user with the JaaS_Administrator (Java Administrators) identity domain role and identity domain of the service.

  1. On the Deployment Configuration page, from the New drop-down list of Deployment Target, select Java Cloud Service - SaaS Extension.
  2. In the Deploy to Java Cloud Service - SaaS Extension dialog box, in Data Center, select the data center of the target JCS-SX instance.
  3. In Identity Domain, enter the traditional or the IDCS identity domain name.
  4. In Username and Password, enter the credentials of the user with the JaaS_Administrator (Java Administrators) identity domain role.
  5. Click Find Targets.
  6. In the Available Targets dialog box, click the JCS-SX instance name.
  7. Continue filling in the details in the deployment configuration page.

Automatically Deploy a Build Artifact

You can configure a deployment configuration to automatically deploy new version of a build artifact as soon as it becomes available. You can also configure a job to trigger a deployment configuration and deploy artifact as a post-build action.

Action How To

Configure a deployment configuration to auto-deploy its artifact

You can configure the deployment configuration to automatically deploy an artifact when you create the configuration, or later when you edit the configuration.

  1. Create or edit a deployment configuration.

  2. In Configuration Name, enter the configuration name.

  3. Specify the deployment target.

  4. In Type, select Automatic.

  5. To deploy an artifact of a build only if it’s stable, select Deploy stable builds only.

  6. If necessary, specify the build job and artifact in Job and Artifact.

  7. Click Save.

Whenever the job of the deployment configuration runs a build, DevCS deploys the specified artifact of the build immediately.

Configure a job to trigger a deployment action of a deployment configuration

You can configure a job of a deployment configuration to trigger its deployment actions (such as deploy, start, stop, or undeploy) when a build of the job runs. The build is marked as successful if the deployment actions are successful.

This is useful if you want to configure a job to run tests on its deployed artifacts. When you create the job and the deployment configuration, you must use the same name for both.

  1. On the Builds page, create a job and configure it to generate the artifacts that you want to deploy.

  2. On the Deployments page, click + Create Configuration.

  3. In Configuration Name, enter the configuration name. Ensure that its name is the same as the job’s name.

  4. Specify the deployment target.

  5. In Type, select On Demand.

  6. Click Save and Deploy.

  7. Open the job’s configuration page again.

  8. Click the Post Build tab.

  9. From Add Post Build Action, select Oracle Cloud Service Deployment.

  10. From Add Deploy Task, select the deployment action.

    For example, select Deploy to deploy the artifact of the deployment configuration.

  11. In Deployment Configuration, select the deployment configuration.

  12. If required, add additional deployment actions. For example, you can add an undeploy action first and then add a deploy action of the same deployment configuration. This is useful if you want to make sure that the application is undeployed before it’s redeployed.

  13. Click Save.

Now, when a build of the job runs, it automatically triggers the deployment actions specified in the deployment configuration.

Manage Deployment Configurations and Deployments

After you’ve created a deployment configuration, you can edit its properties, start and stop the deployment, redeploy an application, view deployment logs, and delete a deployment configuration.

Action How To

Edit a deployment configuration

On the Deployments page, in the deployment configuration tile, mouse over Settings Gear and select Edit Configuration.

You can’t change the application name and the deployment target of a deployment configuration.

Start or stop the application

You can start or stop the deployed application on the target service from the deployment configuration. you don’t need to open the target service’s console to do that.

In the deployment configuration tile, mouse over Settings Gear and select Start or Stop.

Redeploy the application

If you’ve made changes to the source code or the build generated a new artifact, you can manually redeploy the application to the target service. In the deployment configuration tile, mouse over Settings Gear and select Redeploy. You’ll be prompted to specify the build and the artifact to deploy.

View deployment logs

Select the deployment configuration tile and click the log’s link on the right side of the page.

Delete a deployment configuration

In the deployment configuration tile, mouse over Settings Gear and select Delete Configuration. In the Confirm Delete dialog box, select the Also undeploy check box to undeploy the application. Click Delete.

Access a Deployed Application

To access a deployed application, in the deployment configuration tile, click the Application Name link. Enter your identity domain name and your credentials, if you’re prompted to do so.

You can also access the deployed application from the console of the target service. Here are some ways to get the deployed application’s URL .
Action How To

Access an application deployed to JCS-SX

  1. From the Oracle Cloud Dashboard, open the Oracle Java Cloud Service - SaaS Extension Control.

    You can also open it from the deployment configuration tile. In the tile, click the Java Service name link.

  2. Click the application name link under Applications.

  3. Click the application URL under Application URLs to access the deployed application.

To learn more about accessing JCS-SX, see Accessing Oracle Java Cloud Service - SaaS Extension in Using Oracle Java Cloud Service - SaaS Extension.

Create the application’s URL that’s deployed to JCS

  1. Use the JCS View a Service Instance API to get the Content URL and examine the response body output to find the content_url.

    Example:

    curl -i -X GET -u jdoe@example.com:my_password -H "X-ID-TENANT-NAME:exampleidentitydomain" https://jaas.oraclecloud.com/jaas/api/v1.1/instances/exampleidentitydomain/exampleservice

    For more information about the REST API, see REST API for Oracle Java Cloud Service in Using Oracle Java Cloud Service.

    You must use basic authentication to call the REST API. You can use cURL or a browser REST add-on, such as Postman for Google Chrome to make the call.

  2. Get the context root of the application from the application.xml deployment descriptor for EAR deployments or from the web.xml deployment descriptor for WAR deployments.

    If there is no such descriptor, you’ll need to get the context root from the WebLogic Console.

    1. Open the WebLogic Console of the JCS instance. You can access the console from the Java Service link of the JCS deployment configuration.

    2. Click Deployments in the Domain Structure pane.

    3. Click the deployed application name in the Deployments table.

    4. In the Overview tab, copy the value displayed by Context Root.

    Note that the <host>:<port> referenced in the WebLogic Console is local to the JCS instance, so you’ll need the externally available IP address or the host name of the JCS instance VM to access the deployed application.

  3. Join the content URL and the context root of the application to construct the application URL.

    For example, if the content URL is http://129.130.131.132 and the context root is /deploy4214351085908057349, the application’s URL would be http://129.130.131.132/deploy4214351085908057349.

For more information, see Accessing an Application Deployed to an Oracle Java Cloud Service Instance in Using Oracle Java Cloud Service.