Giter Club home page Giter Club logo

node-podman-openshift-ci-cd's Introduction

Node-Podman-OpenShift-CI-CD

Project Specification

A containerised CI/CD pipeline for OpenShift applications using Github Actions containerised using Podman.

Develop a persistent application that consists of a front-end component.
Set up a CI/CD pipeline to BUILD, BAKE and DEPLOY your application to a container platform using GitOps methodologies and approaches (fully automated deployment).
Include scanning of code, container images and production environments for best practices and security purposes in your automated process.

Development

This project is of a two-part project.

  • Pipeline

  • Application
    For application related documentation, refer to the DEVELOP.MD in .\covid-vue-app

    Read more on containerisation in CONTAINER.md in .\docker.

Pipeline

There are two different pipelines.

  • Continuous Integration

  • Continuous Deployment (And Continuous Delivery which we do not implement here)

    A team normally has to choose between Deployment or Delivery.
    Continuous Delivery is Continuous Deployment with an extra step of needing deployment approval.


Continuous Integration

An example of a Continuous Integration pipeline is this.

We will be explaining using this branch where we have test and linting outside of a container.

In Github Actions, we define the pipeline in a YAML file (indentation strict), which is also supported by other pipelining solutions.

We first define the name of this pipeline (or workflow in Github Actions),

name: Node.js CI

Then, we define the trigger condition, this would trigger on push,

on: [push]

configure triggers on multiple events, (list of events here)

on: [push, pull_request]

We could also restrict the workflow to trigger on certain branches, this triggers on push and pull_request to the main branch.

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

Then we specify the job (or actions), we first make a job called build.
We specify the runner environment (where the code would be running), we have it running on ubuntu-latest.

jobs:
  build:
    runs-on: ubuntu-latest

Due to the structure of our code, we have our application in Covid-Application, so we need to move to the correct directory.

defaults:
  run:
    working-directory: ./Covid-Application

I was led to believe that a step running cd Covid-Application/ would also work.
Now that we're in the correct directory, let's start to do something.

We define steps (actions) here, which would mimic someone typing this into the terminal of this runner environment.
We could name our actions with name: <name> for clarity, and our actions would usually be in the form of

  • uses: <some actions>
  • run: <some command>
    Find premade actions here

This is part checkouts the code of our repo to this runner environment.

steps:
  - uses: actions/checkout@v2

This part here declare the Node.js version (12.x) and install it into the current runner environment.
We named this action "Use Node.js".

- name: Use Node.js
  uses: actions/setup-node@v1
  with:
    node-version: "12.x"

This part here declare the actions (commands to run), in which we execute these commands respectively.
Yarn is supported out of the box with Node.js Read more here (also includes boilerplate).

yarn # npm install
yarn lint # npm run lint
yarn build # npm run build
yarn test # npm test
- name: Install dependencies with Yarn
  run: yarn
- name: Lint with ESLint
  run: yarn lint
- name: Build with Webpack
  run: yarn build
- name: Run tests
  run: yarn test

If there were any errors from these steps, the pipeline will fail and the developers would be notified.

Resources

Containerisation

Container Orchestration

Monitoring

Continuous Integration

Web servers

Pipeline Template

Author

Author Current Year Course
Cormac Madden 3rd year Computer science and business
Dabreadman 3rd year Computer science
Neil Shevlin 2nd year Computer science and business
Prathamesh Sai 2nd year Computer science
Emer Murphy 2nd year Computer science
Tom Roberts 2nd year Computer science

node-podman-openshift-ci-cd's People

Contributors

cormacmadden avatar dabreadman avatar dependabot[bot] avatar emer289 avatar neilshevlin avatar saisankp avatar snyk-bot avatar tomrobb 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.