Leapfrog to JFrog's Artifactory with Oracle Developer Cloud Service
This blog helps you understand the DevOps for JFrog Artifactory on Oracle Cloud using Oracle Developer Cloud Service. It will show you, how JFrog Artifactory virtual machine can be installed on Oracle Compute Cloud and then as part of the Build job on Oracle Developer Cloud Service, how the build artifact of a Nodejs application be pushed to the Artifactory instance.

Platform and Technology stack used
- Developer Cloud Service — CI & CD Platform
- JFrog Artifactory — Artifact Repository Manager
- Compute Cloud Service — Oracle IaaS offering, used for installing the Artifactory VM from the Oracle market place.
- Node.js — For developing the sample application for the build
- Grunt — Build tool
About Artifactory
JFrog’s Artifactory, is an open source project, which was created to speed up development cycles using binary repositories. It’s an advanced repository manager, creating a single place for teams to manage all their binary artifacts efficiently. Integrating with all major CI/CD and DevOps tools, Artifactory provides an end-to-end, automated and bullet-proof solution for tracking artifacts from development to production.
Compute Cloud Service
Compute Cloud Service is an enterprise grade infrastructure service that provides a rapidly provisioned virtual compute environment to easily migrate workloads and run them at scale with predictable, consistent performance, control and visibility.
Installing Artifactory on Oracle Compute
Prerequisites:
- Having an Oracle Cloud account with Compute Cloud Service.
- Access to Oracle Marketplace
- Installation of PuTTY and PuTTYGen
Getting the JFrog Artifactory VM from Oracle Market Place:
Got to Oracle Marketplace using this url and search for Artifactory. On the display of the serach results, select the Oracle Linux image as indicated by the cursor in the below screen shot. You may choose to select any other image as well, but for the purpose of this blog I am using the Oracle Linux one. Now click on the JFrog Artifactory on OL 6.7 to select the virtual machine image.

On clicking the recommended option, you will navigate to the VM page, where you will have to Click “Get App” button to trigger the process to get this image installed on the Oracle Compute instance.
Note: For this to work, you will have to be logged into the Oracle Cloud account using https://cloud.oracle.com and at the same time you will have to Sign In into Oracle Marketplace as well using your credentials. Once you have logged in

Now you will be able to see the cloud account domain that you have logged into, in the dropdown as in the screen shot. Select the check box and click the Install button, as shown in the screenshot to trigger the installation process of the Artifactory VM on the Oracle Compute Cloud Service instance.

On click of the Install button you will see the screen as in the below screen shot. Now to create the VM instance and put the required configuration, go to Compute console using “Start Compute Console” button on the page.


In the compute console select the listed image and then move to the next tab in the wizard, which is “Shape”, by clicking the next arrow button.
You can select the shape as per your requirement and perceived load. For the blog purpose, I have selected the recommended shape, as highlighted in the screenshot below.

In the instance tab, upload the SSH public key. The SSH public and private key can be generated using a tool called PuTTYGen. Make sure you keep the private key in accessible location, as that would be needed to reset the password for the Artifactory admin user. You can download PuTTY from http://www.putty.org/.

In the Network tab create the Security list allowing both inbound and outbound permissions. You can change this later on as well from the Compute console, by creating a new Security Application, Rule and List and associating the same to the Compute instance with Artifactory VM of Bitnami installed.


In the storage tab, update the default storage selected as 10GB to the recommended one by Bitnami, which is 60 GB.
Now click Review and create to create the Compute instance with the Artifactory VM installed. It would take few minutes to get the VM installed and moving into running state. The state of the VM can be checked in the Compute Cloud Service console.
Steps to Access the Artifactory Web App:
Once the Artifactory VM is installed, you can navigate to the Oracle Compute Cloud Service console to get the Public IP address of the compute instance on which the Artifactory VM has been installed, as shown in the screen shot below.
Note: The values have been obfuscated due to security policies.

Now Start the PuTTY to connect to the Artifactory VM using the Public IP retrieved from the Compute Cloud console. Then click on Session and enter the retrieved Public IP address for the Artifactory Compute node.
Select Data under Connection in the Category menu. Enter the Auto-login username as ‘bitnami’, as in the screenshot below.


Now select ‘Auth’ under ‘Connection’ in the Category menu. Click on the Browse button and then select the private key generated using PuTTYGen for SSH connection. Once done click ‘Open’.
You should now be able to see the SSH session terminal connected to the Artifactory VM as below.


To retrieve the password for username ‘user’, to access the Artifactory web console, use the below command in the terminal show above.
sudo grep -F ‘#’ /var/log/boot.logIn browser navigate to the Artifactory web console, using the link: http://<Compute Public IP> and use the ‘user’ username and the password retrieved from the terminal to login.

Below screen shot shows the web console for Artifactory. Click on the sample repository created by default ‘example-local-repo’ to check the curl commands.You will also have to generate the API key from the by navigating to the Edit Profile page as shown in the screenshot below.

Note: You will also need to have Bitnami Account created. Please use the below link for more details:
https://docs.bitnami.com/oracle/faq/#using-the-oracle-cloud-platform-console
Oracle Developer Cloud Service Build Job Configuration:
Below are the build job configuration screen shots for the ArtifactoryBuild which will build and upload the Nodejs application archive to Artifactory.
Give a name of your choice to the build job. For this blog I have named it as ‘ArtifactoryBuild’. As this is for Nodejs application, you can leave the JDK to default.
Select the repository in which the Nodejs application code has been uploaded and which would be build by Grunt to create a zip file.


In the Environment tab select the Nodejs version to be used for the build. For this blog I have used 4.8.0

We would be using the execute shell build step. As part of the build step, first we would change the folder to the project folder ‘MochaTest’. We would be using the npm install to install all the required Nodejs modules as in the screen shot below. Then use the ‘grunt’ command to build the zip archive for the deployment.
Once the zip file get created in the ‘MochaTest’ we call the Artifactory REST API using cURL to upload the generated zip to ‘example-local-repo’ of Artifactory. Below is the cURL command that needs to be used.
curl -x http://<Devloper Cloud Service proxy host>:<proxy port> -H ‘X-JFrog-Art-Api: <Artifactory API Key>’ -T <generated zip file to be uploaded> http://<public IP address of the Compute hosting the Artifactory VM>/artifactory/example-repo-local/
Sample Value:
Generated zip file to be uploaded — nodeappl.zip
On execution of the Build Job, you can go ahead and check the Artifactory web console, which will list the ‘nodeappl.zip’ file in the ‘example-local-repo’ repository, as shown in the screen shot below.

You can use the API key and cURL command to pull the files from the Artifactory repository as well.
If you run the build again then, a new version of the zip file will be stored in the Artifactory repo.

You might still be having a question that:
Does it make sense to have a dedicated Compute Node for Artifactory?
Answer is, yes it does. It will be a common repository for storing all your custom or generated artifacts which are downloadable in a controlled and secure fashion across board. And you can do much more with Artifactory. To learn more about Artifactory, please use this link.
Happy Coding!
The views expressed in this post are my own and do not necessarily reflect the views of Oracle

