GithubHelp home page GithubHelp logo

limberger / devops-testing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jramcast/devops-testing

0.0 1.0 0.0 770 KB

Example application for the DevOps Testing webminar

License: Apache License 2.0

Python 1.73% Java 15.03% HTML 9.65% TypeScript 48.43% JavaScript 23.86% Shell 1.25% CSS 0.05%

devops-testing's Introduction

Currency Exchange application

This application serves as an example for the DevOps Testing webminar demo.

  • Frontend
  • Exchange (Gateway)
  • History
  • Currency

Install Jenkins on OpenShift

You must install Jenkins on OpenShift.

Create a project for the Jenkins deployment:

oc new-project YOUR-JENKINS-PROJECT

Create a new Jenkins application using the jenkins-ephemeral template.

oc new-app openshift/jenkins-ephemeral -p MEMORY_LIMIT=2048Mi

The jenkins-ephemeral template does not persist data. If you restart the Jenkins pod, you will lose data. Use the jenkins-persistent template to persist your Jenkins data.

Jenkins agents

This demo uses Jenkins on OpenShift, which requires Jenkins Agents to run specific runtimes.

To create Node.js agent, run:

oc process -f jenkins/jenkins-agent-template.yml  -p NAME=jenkins-agent-node-14 -p SOURCE_CONTEXT_DIR=jenkins/node14 | oc apply -f -

For the Python agent, run:

oc process -f jenkins/jenkins-agent-template.yml  -p NAME=jenkins-agent-python-3 -p SOURCE_CONTEXT_DIR=jenkins/python3 | oc apply -f -

For Cypress:

oc process -f jenkins/jenkins-agent-template.yml  -p NAME=jenkins-agent-cypress -p SOURCE_CONTEXT_DIR=jenkins/cypress | oc apply -f -

Deployments in a test environment (for branches)

This example uses a test environment to make deployments specific to branches. Each branch generates will generate its own deployments

Create the test project:

oc new-project YOUR-TEST-PROJECT

Allow Jenkins to deploy to this project:

oc policy add-role-to-user edit system:serviceaccount:YOUR-JENKINS-PROJECT:jenkins -n YOUR-TEST-PROJECT

Deployments in a stage (or prod) environment

Create the stage project:

oc new-project YOUR-STAGE-PROJECT

Allow Jenkins to deploy to this project:

oc policy add-role-to-user edit system:serviceaccount:YOUR-JENKINS-PROJECT:jenkins -n YOUR-STAGE-PROJECT

How to create the deployments in OCP

You need to create the deployments before running the Jenkins pipeline.

  • Currency service:
oc new-app --name currency \
https://github.com/GITHUB_USER/devops-testing \
--context-dir=currency \
--strategy=docker

oc expose svc/currency
  • History service:
oc new-app --name history \
https://github.com/jramcast/devops-testing \
--context-dir=history \
--strategy=docker

oc expose svc/history
  • Exchange service:
oc new-app --name exchange \
https://github.com/jramcast/devops-testing \
--context-dir=exchange

oc expose svc/exchange
  • News service (optional):
oc new-app --name news \
https://github.com/jramcast/devops-testing \
--context-dir=news \
--strategy=docker

oc expose svc/news
  • Web application:
oc new-app --name frontend \
https://github.com/jramcast/devops-testing \
--context-dir=frontend \
--strategy=docker

oc expose svc/frontend

devops-testing's People

Contributors

jramcast avatar

Watchers

James Cloos 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.