Code Monkey home page Code Monkey logo

aloha's Introduction

Use case: CI/CD Pipeline

Deploy Jenkins

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

Demo the pipeline

  • 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

(Option 1) Trigger the build via CLI

$ curl -k "https://admin:[email protected]/job/Aloha%20Microservices/buildWithParameters?token=MyAuthToken"

(Option 2) Trigger the build in Jenkins UI

The build should have started automatically. If not, trigger the build yourself.

pipeline

The projects helloworld-msa-dev and helloworld-msa-qa will be created automatically according to the defined Pipeline.

aloha

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

Build and Deploy aloha locally

  1. Open a command prompt and navigate to the root directory of this microservice.

  2. Type this command to build and execute the service:

    mvn clean compile exec:java
  3. The application will be running at the following URL: http://localhost:8080/api/aloha

Deploy the application in Openshift using Fabric8 plugin

  1. Make sure to be connected to the Docker Daemon

  2. Execute

    mvn clean package docker:build fabric8:json fabric8:apply

aloha's People

Contributors

rafabene avatar tariq-islam avatar yanaga avatar enham avatar cescoffier avatar objectiser avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.