Bitbucket Pipeline for Pushing, via Bastion Host, React Static Content to a Farm of Web-server Pods Running in Oracle Kubernetes Engine Cluster on Top Oracle Content and Experience Cloud


Intro

In this post we are explaining how to publish React content to a remote Kubernetes cluster which has a Replicaset of Apachii pods, all of them mounting the shared disk via a PersistentVolume, where the content is pushed by sftp from Bitbucket using a pipeline, for serving the static content on top of a Web Content Management Solution (Oracle Content and Experience Cloud).

Procedure

Step 1

1A. On your bitbucket repo, go to settings->SSH keys and click on [Generate Keys]

1B. Click on [Copy public key] and save it for later:

1C. Ask your peer for the public IP of the remote host, put it on the boc and click on [Fetch]

1D. Once the host is verified, click on [Add host]

1E. The remote host is now in the Known hosts list already

Step 2

2A. On the repo menu, click on Pipelines

2B. Click on [Start using Pipelines]

2C. Select JavaScript template

2E. Put the following text in the editor and change for the specific values of your environment

image: node:10.15.3
 pipelines:
   default:
     - step:
         caches:
           - node
         script: # jmu 
           - npm install
           - npm test
           - npm run build
           - pipe: atlassian/sftp-deploy:0.5.2
             variables:
               USER: 'opc'
               SERVER: '10.20.30.40' #fake one
               REMOTE_PATH: '/var/estaticos/react'
               LOCAL_PATH: 'build/*'
               DEBUG: 'true'

2F. Click on [Commit]

2G. Put comments and click [Commit]

2H. The pipeline starts running and, if everything goes well, the build will end up successfully

Thats all! Hope it helps! 🙂

One Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.