Commit 4c39f50b authored by danushka9999's avatar danushka9999

KIE realted structure and readme image

parent 68720723
FROM jboss/drools-workbench:7.18.0.Final
ENV KIE_SERVER_PROFILE standalone-full-drools
ENV JAVA_OPTS -Xms256m -Xmx2048m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8
####### Drools Workbench CUSTOM CONFIGURATION ############
ADD standalone-full-drools.xml $JBOSS_HOME/standalone/configuration/standalone-full-drools.xml
ADD drools-users.properties $JBOSS_HOME/standalone/configuration/drools-users.properties
ADD drools-roles.properties $JBOSS_HOME/standalone/configuration/drools-roles.properties
ADD start_drools-wb.sh $JBOSS_HOME/bin/start_drools-wb.sh
# Added files are chowned to root user, change it to the jboss one.
USER root
RUN chmod +x $JBOSS_HOME/standalone/configuration/standalone-full-drools.xml && \
chmod +x $JBOSS_HOME/standalone/configuration/drools-users.properties && \
chmod +x $JBOSS_HOME/bin/start_drools-wb.sh && \
chmod +x $JBOSS_HOME/standalone/configuration/drools-roles.properties
# Switchback to jboss user
USER jboss
####### RUNNING DROOLS-WB ############
WORKDIR $JBOSS_HOME/bin/
CMD ["./start_drools-wb.sh"]
\ No newline at end of file
import groovy.transform.Field
@Field def projectName = "drools-workbench" // name of the current application we're running CI/CD for
@Field def branchName = "unknown" // name of the current branch to checkout for the application
@Field def buildNumber = "unknown" // current Jenkins build number
@Field def devopsBranch = "master" // branch for winnow-devops; should always be master, unless for devops testing
@Field def slackChannel = "platform_ci" // slack channel where the notifications will be pushed
@Field def jobBaseName = "unknown" // name of the Jenkins job
@Field def jenkinsSrvName = "unknown" // name of the Jenkins server
@Field def VERSION = "unknown" // application version
@Field def IMAGE = "drools-workbench" // Docker image name,
@Field def codePath = "" // path of application code
@Field def environment = "" // environment specifier -- i.e: prod, uat, dynX
@Field def deployable = true // variable to check if we should deploy -- currently checks for version diffs between pom.xml and git tag
@Field def service_type = "platform"
@Field def jenkins_node = "jenkins-slave-hub"
try {
node("$jenkins_node") {
slackNotifyBuild('PIPELINE STARTED')
stage('Project setup') {
dir("app/${projectName}") {
//checking out the app code
echo 'Checkout the code..'
checkout scm
branchName = env.BRANCH_NAME
buildNumber = env.BUILD_NUMBER
jobBaseName = "${env.JOB_NAME}".split('/').last() // We want to get the name of the branch/tag
jenkinsSrvName = env.BUILD_URL.split('/')[2].split(':')[0]
echo "Jenkins checkout from branch: $branchName && $buildNumber"
echo "Running job ${jobBaseName} on jenkins server ${jenkinsSrvName}"
codePath = pwd()
}
}
}
}
catch (e) {
// If there was an exception thrown, the build failed
currentBuild.result = "FAILED"
slackNotifyBuild("PIPELINE FAILED")
throw e
}
// figure out next steps depending on the name of the job (which is a git tag)
// x.x.x -- prod CD
// rc-x.x.x -- UAT CI/CD
// anything else -- CI
switch (jobBaseName) {
// PROD tag job
case ~/^\d+\.\d+\.\d+$/:
// trigger Jenkinsfile-prod-deploy
environment = "prod"
VERSION = "$jobBaseName"
pipelineCD()
break
// UAT tag job
case ~/^rc-\d+\.\d+\.\d+$/:
//trigger Jenkinfile-uat-deploy
VERSION = "$jobBaseName".replaceAll("rc-","")
echo "Deploy to UAT version: $VERSION"
environment = "uat"
pipelineCD()
break
default:
echo "Unfortunatly the deployment of opa is not available for dyn"
break
}
// This method will help us notify in the slack channel
def slackNotifyBuild(String buildStatus = 'BUILD STARTED') {
// build status of null means successful
buildStatus = buildStatus ?: 'SUCCESSFUL'
// Default values
def jobBaseName = "${env.JOB_NAME}".split('/').first()
def colorName = 'RED'
def colorCode = '#FF0000'
def subject = "${buildStatus}: Pipeline `${jobBaseName}` on branch `${env.BRANCH_NAME}` and build `#${env.BUILD_NUMBER}`"
def summary = "${subject} (${env.BUILD_URL})"
// Override default values based on build status
switch (buildStatus) {
case "BUILD STARTED":
color = 'YELLOW'
colorCode = '#FFFF00'
break
case "PIPELINE STARTED":
color = 'YELLOW'
colorCode = '#FFFF00'
break
case "BUILD SUCCESSFUL":
color = 'BLUE'
colorCode = '#4186f4'
break
case "BUILD UNSTABLE":
color = 'ORANGE'
colorCode = '#FF8C00'
break
case "DELIVERY STARTED":
color = 'YELLOW'
colorCode = '#FFFF00'
break
case "DELIVERY SUCCESSFUL":
color = 'GREEN'
colorCode = '#30873a'
break
case "DEPLOY STARTED":
color = 'YELLOW'
colorCode = '#FFFF00'
break
case "DEPLOY SUCCESSFUL":
color = 'BLUE'
colorCode = '#42f4f4'
break
default:
color = 'RED'
colorCode = '#FF0000'
break
}
// Send notifications
if( env.BRANCH_NAME == "dev" || env.BRANCH_NAME == "master" ) {
slackSend (color: colorCode, message: summary, channel: "${slackChannel}")
}
}
def pipelineCD(Map args = [:]) {
node("$jenkins_node") {
stage('Prepare CD') {
try {
dir('app/winnow-devops') {
git(
poll: true,
url: 'git@bitbucket.org:teamwinnow/winnow-devops.git',
credentialsId: 'd6e1be13-06a3-4823-8872-2fd509fca9b9',
branch: "$devopsBranch"
)
withEnv(["projectName=$projectName", "jenkins_node=$jenkins_node" ,"service_type=$service_type", "jobBaseName=$jobBaseName", "slackChannel=$slackChannel", "IMAGE=$IMAGE", "environment=$environment", "VERSION=$VERSION", "codePath=$codePath"]) {
load "jenkins/files/$service_type/Jenkinsfile-$environment-deploy"
}
}
} catch (e) {
throw e
}
}
}
}
\ No newline at end of file
# README #
### What is this repository for? ###
This is for uat environment ONLY for now. It's based on the official showcase image.
It comes out of the box with some default configuration(eg users, roles, etc).
The final version should be customized and that customization should be in Dockerfile.
### How do I get set up? ###
Just build the docker image. Again the Dockerfile is simple but we intend to put more there.
This is in case you are wondering why not using directly the official image.
```
docker build -t my-workbench .
```
Start by running
```
docker run -p 8080:8080 -p 8001:8001 -d --name drools-workbench my-workbench:latest
```
Go to
```
http://localhost:8080/business-central/
```
and login using one of the users available.
### Who do I talk to? ###
For more information reach Sergiu Oltean or go to https://hub.docker.com/r/jboss/drools-workbench-showcase
\ No newline at end of file
admin=admin,analyst,kiemgmt,rest-all
krisv=admin,analyst
john=analyst,Accounting,PM
sales-rep=analyst,sales
jack=analyst,IT
katy=analyst,HR
\ No newline at end of file
#admin=admin
admin=207b6e0cc556d7084b5e2db7d822555c
#krisv=krisv
krisv=7b21a03b9918f9c629a46e119a9b8714
#john=john
john=afda4373c6021f3f5841cd6c0a027244
#sales-rep=sales-rep
sales-rep=b79a6ff72056e86c70eaa2922585ef25
#katy=katy
katy=fd37b5d0b82ce027bfad677a54fbccee
#jack=jack
jack=984ba30e11dda7b9ed86ba7b73d01481
\ No newline at end of file
#!/usr/bin/env bash
# Start Wildfly with the given arguments.
CUSTOM_ARGS=" -Dorg.kie.verification.disable-dtable-realtime-verification=true"
echo "Running Drools Workbench on JBoss Wildfly..."
exec ./standalone.sh -b $JBOSS_BIND_ADDRESS $CUSTOM_ARGS -c $KIE_SERVER_PROFILE.xml -Dorg.kie.demo=$KIE_DEMO -Dorg.kie.example=$KIE_DEMO
exit $?
\ No newline at end of file
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Node artifact files
node_modules/
dist/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# JetBrains IDE
.idea/
# Unit test reports
TEST*.xml
# Generated by MacOS
.DS_Store
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment