In my last blog, we’ve create a Hello Application easily without any coding and deployed it to the cloud.
In this blog, let’s explore the continuous integration and continuous delivery for the application which SAP has prepared for us a template which is ready for our use.
Push Your Codes to Git
- Install Git client if you haven’t done so. (Windows:
choco install git)
- Setup Git
git config --global user.email "firstname.lastname@example.org"
git config --global user.name "Your Name"
.gitignore file to your project folder. The file should contain one line:
4. Init and commit local repository
git add .
git commit -m "Your commit message"
4. Create a new remote repository on GitHub or GitLab.
5. Push to your remote repository
git remote add origin <repository_url>
git push -u origin master
If you don’t want to go through above steps, you can reuse my repository at https://github.com/pacroy/sap-cloud-sdk-hello-spring
Setup a Linux-based Server with Docker
One way is to get one on Azure if you have active subscription. Follow my blog:
Setting up Docker on Azure with Ubuntu server
Here are instructions to setup your own Docker on Azure with an Ubuntu server.
Note: I recommend to select VM size with at least 2 vCores with 7GB of RAM.
Setting up Cx Server
Transfer required files from
cx-server folder to your Linux server using command
scp (Mac). For Windows, you may use Putty (
choco install putty).
scp -r cx-server your.server.com:~
This will transfer the
cx-server folder to home directory.
Login to your Linux with SSH and set ‘Execute’ permission of
chmod +x cx-server
Optional: You may also update the
server.cfg by setting your preferred
Once ready, execute the script with sudo.
sudo ./cx-server start
The script will run and create a docker container for S/4HANA Cloud SDK Cx Server. This will take a while.
pacroy@docker:~/cx-server$ sudo ./cx-server startChecking for newer version of this script on github (https://raw.githubusercontent.com/SAP/cloud-s4-sdk-pipeline-docker/master/s4sdk-jenkins-master/cx-server/cx-server)... no newer version detected.Starting docker container for S/4HANA Cloud SDK Cx Server.Parameters:
- jenkins_home=jenkins_home_volume>> docker pull s4sdk/jenkins-master:latest
latest: Pulling from s4sdk/jenkins-master
219d2e45b4af: Pull complete
a482fbcfe407: Pull complete
980edaaff53b: Pull complete
f44dc7c129fe: Pull complete
f34a55a78629: Pull complete
a0608417860f: Pull complete
74ffb0683f1a: Pull complete
11ab86bd63bc: Pull complete
a0e8d28e95f8: Pull complete
b5d6ad9f8a74: Pull complete
3caea7ba6c3e: Pull complete
09cfd5fe294a: Pull complete
d1bd1db8a084: Pull complete
f0effb33601d: Pull complete
304196f84fee: Pull complete
8ddc6878c5f0: Pull complete
5f2982263a84: Pull complete
2cbac31ea617: Pull complete
49f4de9f38ff: Pull complete
82aa91ec8318: Pull complete
ada069754671: Pull complete
f292b4e17a3e: Pull complete
67be3bb4959e: Pull complete
292727c7a1f4: Pull complete
9c905b5dac91: Pull complete
ea459e98d225: Pull completeDigest: sha256:xxxxStatus: Downloaded newer image for s4sdk/jenkins-master:latest>> docker run -u 1000:117 --name s4sdk-jenkins-master -d -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock -v jenkins_home_volume:/var/jenkins_home s4sdk/jenkins-master:latestxxxxWaiting for the S/4HANA Cloud SDK Cx server to start......... success.
You may need to setup firewall to allow incoming connection to your configured port. Here is what I did to my server on Azure:
Now, you can access your Jenkins instance.
Add a new ‘Pipeline’ job.
Configure job to process pipeline from Git per below.
Before building the project, make sure your Jenkins has at least 2 executors.
Build the project. If everything is good, the project should be successfully completed. Open Blue Ocean view to see the pipeline.