Customizing Google Cloud Shell for SAP Development
I was reading this nice blog post by Thomas Jung on Google Cloud Shell, which brought back some memories. Few months back I wrote a blog post on deploying our SAP Cloud application programming model to Google cloud run via cloud shell. I got lucky and was invited by DJ Adams sir to present the same in HandsOnSAPDev session. We were using cloud shell to deploy our app as well as making the images. In the session I came to know that Cloud shell is nothing but a docker container running an image. This can be customized as per one need. So through this blog post we will see how we can customize our cloud shell environment for our SAP development and no need to install packages etc. each time it starts.
Once you login to google cloud console start the cloud shell by clicking below mentioned highlighted button
The cloud shell is opened, click on below highlighted button to open the cloud shell environment
As can be seen below it is using an image for the environment and we can customize it. Click on create image button
The moment you click create image, you see a super interactive wizard which opens on the right to help you in creating the image. I wish the same can be incorporated in SAP Cloud Platform.
The moment you confirm you google project, it takes you to the next step which is create the basic Dockerfile image named mysap with cloud shell image as parent. Once both commands are executed click on next.
Next step is to move to the image directory and open the basic dockerfile.
cd $HOME/SAP-Shell && cloudshell edit Dockerfile
For now I want my cloud shell to support CDS and UI5 local development so adding it to the docker file
FROM gcr.io/cloudshell-images/cloudshell:latest # Add your content here RUN npm set @sap:registry=https://npm.sap.com RUN npm i -g @sap/cds RUN npm install --global @ui5/cli
Next step is to build the image and test locally
cloudshell env build-local cloudshell env run
Now we are inside the container and as can be seen UI5 and CDS are already available.
Since locally the cloud shell work next step is to publish the image to container registry
Last step is to update this image as the default image using below command and restart
cloudshell env update-default-image
What is next?
I have customized it to have UI5 and CDS tooling, you can add Cloudfoundry etc., sky is the limit.The intent is to keep exploring and keep sharing. We have so many cloud providers our journey will continue. Feel free to provide your feedback.