This repository contains quickstarters, which are basically templates that help to start out with a component quickly. The available quickstarters are:
- Backend - Java/SpringBoot
- Backend - Python/Flask
- Backend - Scala/Akka
- Backend - NodeJS/Express
- Frontend - Angular
- Frontend - React
- E2E test - Cypress
- Mobile - Ionic
- Data Science - Machine Learning
- Data Science - Jupyter Notebook
- Data Science - R-Shiny
Next to those, there is a "blank" quickstarter allowing to start from scratch, while still providing all the OCP resources / Jenkins / SonarQube conveniences described in the following sections.
All quickstarters are used by the provisioning app to create a new component which basically consists of resources in OpenShift (typically BuildConfig
, ImageStream
, DeploymentConfig
and Service
) and a BitBucket repository.
This repository in BitBucket will contain:
- Some boilerplate code
- A
Jenkinsfile
describing how to build the component, delegating most of the work to the shared library - A
sonar-project.properties
file configuring how the source code is analyzed by SonarQube
Next to those, each quickstarter can also provide its own Jenkins slave images.
The quickstarters are not used directly, but triggered via the provisioning app. Login there to pick
a quickstarter, give it a name and provision it. The provisioning app delegates the executation to a
job in Rundeck (defined in YML files in the rundeck folder), which then clones this repository and executes the files (e.g. init.sh
) within.
As the quickstarters are triggered via Rundeck, the changes need to be on the production
branch in order to be "live". As an alternative, you can copy the job in Rundeck and point it to the branch you
are working on.
To test out things locally, you can mimick what Rundeck. The general procedure is:
- Clone the repository
- Go into a quickstarter folder, e.g.
be-node-express
- Run
build.sh
(if it exists) - Run
init.sh
- Run
renderJenkinsTemplate.sh
from the root of the repository - Run
renderSonarqubeTemplate.sh
from the root of the repository
Note that those scripts might need parameters to work, and often need to be adjusted slightly to work (e.g. removing chown
ing to rundeck
user).
If you contribute a new quickstarter / boilerplate - please use the provided README.md
templates
- for a
jenkins-slave
- theslave template
- for a
boilerplace
- theboilerplate
Push your repository into the newly created bitbucket project (and note the name of the repo & project)
Logon to rundeck and pick the common/prepare-continuous-integration
rundeck job
- Pick the technology target thru
component type
- this will ensure you get the right jenkins file based on the technology you pick - and should fit the technology you have built your application with - Provide
quickstarter_directory
- this can be any filesystem directory - usually in/tmp/<component name>
where the git repository will be cloned to - Provide
project_id
- this is the project name you noted in step (0) - Provide
component_id
- this is the name of the component (from step 0) that will be rendered into the jenkins template, and also used as name for the openshift resources - Provide
git_url_http/ssh
- this is the URL to clone and commit to for the job.