Deploy an Application to JCS

You can create a job that copies build artifacts generated by another job and deploys those artifacts to a JCS target instance:

  1. In the left navigator, click Builds Builds.
  2. In the Jobs tab, click + Create Job.
  3. In the New Job dialog box, in Name, enter a unique name.
  4. In Description, enter the job's description.
  5. In Template, select the build executor template.
  6. Click Create.
  7. In the Job Configuration page, in the Before Build tab, select Copy Artifacts from the Add Before Build Action dropdown.
  8. Select the job that produces the artifact from the From job dropdown and the last successful build from the Which build dropdown, then click Save.
  9. In the Steps tab, click the Add Step dropdown and select Oracle Deployment.
    The Deploy to Java dialog box is displayed.
  10. In the Target Instance dropdown, select the JCS instance where you want to deploy the application.
    If you don't see the instance that you want to deploy to, you'll need to go to the Environments page and define a new instance. After you do that, it will show up as a target in the dropdown.
  11. Enter the HTTPS port number, username, and password in their respective fields.
  12. Click Find Targets and select the server you want to deploy to from the list of available servers or clusters.
  13. Click OK.
  14. In the Build Artifact field, enter the path to the artifact that you want to deploy.
  15. In the Application Name field, enter the name that will be used by the target JCS service to identify your application.
  16. Select the Deploy as shared library checkbox to deploy the artifact directly to the JCS server as a shared library or leave it unchecked (default).
    When the artifact is deployed directly to a JCS server, any application can reference the resources in that deployed shared library.
  17. Click Save.
  18. To run the job, from the Builds page, click Build Now and the job will execute, first copying the artifact, then deploying it to the selected JCS target instance.
At this point, you probably want to create a pipeline that flows a series of jobs that builds and packages the artifact, then retrieves it and deploys it to the desired JCS server in the target instance.

Access a Deployed Application

You can access an application deployed to an Oracle Cloud service from that target service's console. Here are some ways you can get the deployed application’s URL. You'll need to enter your identity domain name and your credentials, if you’re prompted to do so.

The Deployments tab on the Environments page shows deployed extensions and deployed visual applications. The Application Extensions Classic category shows deployments for all projects associated with this environment; the Application Extensions category shows deployments for the current project. The Visual Applications category also shows deployments for the current project only.

Here's how you can create the URL for an application 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.
    For 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

    See REST API for Oracle Java Cloud Service.

    You need to 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 this 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, 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.
    The <host>:<port> referenced in the WebLogic Console is local to the JCS instance. You need to obtain and use 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.

    See Accessing an Application Deployed to an Oracle Java Cloud Service Instance in Administering Oracle Java Cloud Service.