Install a custom Jenkins image (needs an admin privilege)
$ oc login -u admin -p admin $ oc project openshift $ oc create -f https://raw.githubusercontent.com/tariq-islam/aloha/master/custom-jenkins.build.yaml $ oc start-build custom-jenkins-build --follow
Now install the Jenkins template in the ci
project:
$ oc login -u openshift-dev -p devel $ oc new-project ci $ oc policy add-role-to-user edit -z default $ oc new-app -p MEMORY_LIMIT=1024Mi https://raw.githubusercontent.com/tariq-islam/aloha/master/jenkins-ephemeral-template.json $ oc project helloworld-msa
Wait the server to become available in the following URL: https://jenkins-ci.rhel-cdk.10.1.2.2.xip.io/
Note
|
Login with the credentials admin/password |
-
Have readiness probe to show HA during the deployment
$ oc set probe dc/aloha --readiness --get-url=http://:8080/api/health
Once approved, the fixed project will be applied to the "production"
.
-
First introduce
an error
in the production.
$ cd aloha/ $ vim src/main/java/com/redhat/developers/msa/aloha/AlohaVerticle.java # replace return String.format("Aloha mai %s", hostname); # by return String.format("Aloca mai %s", hostname);
-
Deploy the erroneous version in the production area.
$ mvn clean package; oc start-build aloha --from-dir=. --follow
$ curl -k "https://admin:[email protected]/job/Aloha%20Microservices/buildWithParameters?token=MyAuthToken"
The build should have started automatically. If not, trigger the build yourself.
You should see the pipeline running in: https://jenkins-ci.rhel-cdk.10.1.2.2.xip.io/job/Aloha%20Microservices/
The projects helloworld-msa-dev
and helloworld-msa-qa
will be created automatically according to the defined Pipeline.
Aloha microservice using Vert.X
The detailed instructions to run Red Hat Helloworld MSA demo, can be found at the following repository: https://github.com/redhat-helloworld-msa/helloworld-msa
-
Open a command prompt and navigate to the root directory of this microservice.
-
Type this command to build and execute the service:
mvn clean compile exec:java
-
The application will be running at the following URL: http://localhost:8080/api/aloha