Skip to content

Commit

Permalink
Authoring plan
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Romero Montes <[email protected]>
  • Loading branch information
ruromero committed May 11, 2018
1 parent b9da814 commit 1bc67f6
Show file tree
Hide file tree
Showing 32 changed files with 2,070 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
sudo: required
sevices:
- docker

language: python
python:
- '2.7'

stages:
- syntax and format
- test

env:
- ANSIBLE_ROLES_PATH=$ANSIBLE_ROLES_PATH:$PWD/roles OPENSHIFT_VERSION=latest
- ANSIBLE_ROLES_PATH=$ANSIBLE_ROLES_PATH:$PWD/roles OPENSHIFT_VERSION=v3.9.0

before_install:
- sudo apt-get update -qq
- sudo sed -i "s/\DOCKER_OPTS=\"/DOCKER_OPTS=\"--insecure-registry=172.30.0.0\/16 /g" /etc/default/docker
- sudo cat /etc/default/docker
- sudo service docker restart

install:
- sudo apt-get install git
- pip install --pre ansible apb yamllint
- ansible-galaxy install ansible.kubernetes-modules
- git clone https://github.com/ansibleplaybookbundle/ansible-asb-modules.git $PWD/roles/ansibleplaybookbundle.asb-modules

jobs:
include:
- stage: syntax and format
script:
# Verify all playbooks have valid syntax
- |
for PLAYBOOK in playbooks/{provision,deprovision,bind,unbind,test}.yml
do ansible-playbook $PLAYBOOK --syntax-check
done
- stage: syntax and format
script:
# Verify apb.yml file is valid YAML
- yamllint apb.yml

# Test Stage
script:
- export APB_NAME=rhba-apb
- apb build
- export B64_SPEC=`base64 apb.yml | tr -d '\n'`
- export APB_LABEL=`docker inspect --format='{{json .Config.Labels}}' $(docker images -q | head -n 1) | jq -r '."com.redhat.apb.spec"'`
- if [ "$B64_SPEC" != "$APB_LABEL" ]; then { echo "APB Spec Label doesn't match"; exit -1; }; fi;
- sudo docker cp $(docker create docker.io/openshift/origin:$OPENSHIFT_VERSION):/bin/oc /usr/local/bin/oc
- oc cluster up --version=$OPENSHIFT_VERSION
- oc login -u system:admin
- oc new-project $APB_NAME
- docker run --rm --net=host -e "POD_NAME=$APB_NAME-pod" -e "POD_NAMESPACE=$APB_NAME" -v $HOME/.kube:/opt/apb/.kube:z -u $UID $APB_NAME test --extra-vars "travis=true namespace=$APB_NAME"
14 changes: 14 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends: default

rules:
braces:
max-spaces-inside: 1
min-spaces-inside: 1
level: warning
brackets:
max-spaces-inside: 1
min-spaces-inside: 1
level: warning
line-length: disable
trailing-spaces: disable
truthy: disable
287 changes: 287 additions & 0 deletions Dockerfile

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DOCKERHOST = docker.io
DOCKERORG = rhba-apb
IMAGENAME = rhba
TAG = latest
USER=$(shell id -u)
PWD=$(shell pwd)
build_and_push: apb_build docker_push apb_push

.PHONY: apb_build
apb_build:
docker run --rm --privileged -v $(PWD):/mnt:z -v $(HOME)/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $(USER) docker.io/ansibleplaybookbundle/apb-tools:latest prepare
docker build -t $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) .

.PHONY: docker_push
docker_push:
docker push $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG)

.PHONY: apb_push
apb_push:
docker run --rm --privileged -v $(PWD):/mnt:z -v $(HOME)/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $(USER) docker.io/ansibleplaybookbundle/apb-tools:latest push
95 changes: 93 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,93 @@
# rhpam-apb
RHPAM APB
# RHPAM APB

[![Build Status](https://travis-ci.org/ruromero/rhpam-apb.svg?branch=master)](https://travis-ci.org/ruromero/rhpam-apb) [![License](https://img.shields.io/:license-Apache2-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

![rhpam image](./docs/imgs/jbpm_logo.png)

## Overview

This APB aims to deploy Red Hat Process Automation Manager (RHPAM) on OpenShift.

## Usage

In the Openshift control panel, find and select the `RHPAM (APB)` and fill in the required fields.

### Plans

**Authoring**

Handles the deployment of the following components:
* Business Central
* Persistent of ephemeral
* KIE Server
* Persistent or Ephemeral Database storage
* Different solutions for the database-backed storage
* H2
* MySQL
* PostgreSQL

**KIE Server**

Deploys only KIE Server with these options:

* Persistent or Ephemeral Database storage
* Different solutions for the database-backed storage
* H2
* MySQL
* PostgreSQL
* External Database
* non-HA or HA. HA will span 3 instances of KIE Server with the selected Database (If MySQL or PostgreSQL is selected).

**SIT (System Integration Testing)**

//TBD

**Production**

Deploys a production-ready environment:
* Business Central Monitoring
* Persistent of ephemeral
* non-HA or HA. HA will span 3 instances of Business Central Monitoring
* KIE Server
* Persistent or Ephemeral Database storage
* Different solutions for the database-backed storage
* H2
* MySQL
* PostgreSQL
* non-HA or HA. HA will span 3 instances of KIE Server with the selected Database (If MySQL or PostgreSQL is selected).


**Production immutable monitor**

//TBD

**Production immutable kieserver**

//TBD

## Requirements
For HA requires the broker to run with `admin` `RoleBinding` for that the broker must be configured as follows:

```
$ oc edit cm broker-config -n ansible-service-broker
...
sandbox_role: "admin"
...
```

The following `imageStreams` should exist in the `openshift` namespace:

* rhpam70-businesscentral-monitoring-openshift:1.0
* rhpam70-businesscentral-openshift:1.0
* rhpam70-controller-openshift:1.0
* rhpam70-elasticsearch-openshift:1.0
* rhpam70-kieserver-openshift:1.0
* rhpam70-smartrouter-openshift:1.0

## Testing

Check [ansible-playbook-bundle documentation](https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/blob/master/docs/getting_started.md#test).

## Demo

![rhpam apb demo](./docs/demos/rhpam-demo.gif)
Loading

0 comments on commit 1bc67f6

Please sign in to comment.