Prepare an Application Stored on GitHub for Deployment

Oracle Application Container Cloud Service GitHub integration allows you to deploy your applications directly from GitHub. Applications are deployed using the Oracle command line interface or REST API.

To deploy an application from GitHub, follow these steps:

  1. Obtain the GitHub URL for the Git repository containing your application. (This would be the URL you use to clone the repository).

  2. Execute a deployment command for you application (see the following sample commands).

  3. Observe the deployment in the Oracle Application Container Cloud Console.

The GitHub integration has the following limitations.

  • Builds are only supported from the master branch.

  • Only Java SE, Java EE, and Node.js applications are supported.

    • Java SE and Java EE applications:

      • Builds are Maven based.

      • Your pom.xml file must be in the root directory of your master branch.

    • Node.js applications:

      • The application must have a package.json file in the root directory.

  • Applications must deployed using the command line interface or REST API.

Deploying Using the Command-Line Interface

To deploy your web application using the command-line interface, use the accs push command. See psm accs push in PaaS Service Manager Command Line Interface Reference.

Example 3-16 Deploying a Java Application from a GitHub Repository by Using the Command-Line Interface

psm accs push -n MyJavaApp -r java -s Monthly \
-g https://github.com/YourGitProject/MyRepoName.git \
-m /local-path-to-manifest.json -d /local-path-to-deployment.json

After you execute the command, you are asked if the repository is public. If you answer no, you will be prompted for your user name and password for the private repository.

Note:

Two factor authentication is currently not supported.

Running the PSM command again generates a build based on the files in the repository. If the source has changed, a new version of the application is deployed.

img/obecloud.pngTutorial - Deploy an application from GitHub by using the command-line interface

Deploying Using the REST API

To deploy your web application using the REST API, use the gitRepoUrl option to specify the git repository. This example shows how to deploy a Java application called MyJavaApp by submitting a POST request using cURL.

Example 3-17 Deploying a Node.js Application from a GitHub Repository by Using the REST API

curl -X POST -u joe@example.com:password\
  https://apaas.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain \
  -H "X-ID-TENANT-NAME:ExampleIdentityDomain" \
  -H "Cache-Control: no-cache" \
  -H "content-type: multipart/form-data;"  \
  -F "name=MyNodeApp" \
  -F "runtime=node" \
  -F "subscription=MONTHLY" \
  -F "deployment=@Local-path-to-deployment-json\deployment.json" \
  -F "gitRepoUrl=https://github.com/YourGitProject/hello-world.git" \
  -F "manifest=@Local-path-to-manifest-json\manifest.json" \
  -F "gitUserName=YourUserName" \
  -F "gitPassword=YourPassword"

Both gitUserName and gitPassword are optional. Only provide these values if your repository is private on GitHub.

Any option on the command line (such as subscription or name) takes precedence over the same option in a metadata file, if there is a difference.

img/obecloud.pngTutorial - Deploy an application from GitHub by using the REST API

For more information about the REST API, see REST API for Oracle Application Container Cloud Service.