When you have a project in JDeveloper and a Java Cloud Service, you can use Developer Cloud Service to
- store your code as remote git repository
- to build automatically the code at commit time
- and to deploy it to a Java Cloud Service (Weblogic in the cloud) if the build is successful.
You can do it like this:
- In JDeveloper (or manually), create a local git repository.
Menu : Team / Git / Initialise
- Add all the files of the JDeveloper application to the git repository
Menu : Team / Git / Add all…
- Commit to the local repository
Menu : Team / Git / Commit all…
- In DCS, Create a remote git repository in Developer Cloud Service
Copy the HTTPS url of the repository in a text editor, you will need it later.ex: https://firstname.lastname@example.org/xxx/s/xxx_workbetter/scm/wb.git
- Add a build.
- Go to main tab “Build”
- Click “New Job”
- In Subtab “Main”, give a name, for ex: BuildWorkBetter
- In Subtab “Source Control”, choose the GIT repository created in step 4
- In Subtab “Triggers”, check the “Based on SCM polling schedule” checkbox to allow automatic compilation when the DCS GIT repository is modified. Leave the schedule empty.
- In Subtab “Build Step”, set the way to build the program, for example
- Add Build Step : ant
- Set Targets : deploy
- Set Build File : build.xml
- In Post Build, define the artifacts (the result of the build)
- Check “Archive the artifacts“
- File to archive. This is the place where for example your ear and war file will be created. Ex: ViewController/deploy/*
- In JDeveloper, push the local GIT repository of JDeveloper to the remote repository in DCS.
Menu : Team / Git / Push …
– URL use the https url of step 4
– username: use your cloud user name
– password: use your cloud password
- Back in DCS,
In the tab “Code”, you will see that your code is now in GIT.
In the tab “Build”, you will see that the code is being build.
If it compiles, you will see the list of artifacts in build tab.
- In DCS, click on the tab “Deploy” and click “New Configuration”
- Configuration name : DeployWB
- Deployment Target (New Java Cloud Service)
- Protocol SSH Tunnel
- Host: your Java Cloud Service Admin Server IP (1)
- HTTPS: 7002
- Adminitration Port : 9001
- username : <<weblogic user>>
- password : <<weblogic password>>
- Type: automatic
- Job : BuildWorkBetter
- Artifact : select the .ear file
- Click “Save”
- IN JCS, you can check that the deployment has succeed. Log in to the Weblogic Server Console. Go to deployment, look for your deployed project.
- Get the URL of your external IP, probably a load balancer (2)
Check that it works.https://<load balancer IP>/<Application URL>