Git Product home page Git Product logo

volkorny / semaphore-demo-javascript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from semaphoreci-demos/semaphore-demo-javascript

0.0 1.0 0.0 666 KB

A Semaphore demo CI/CD pipeline using Node.js, TypeScript, Nest.js and React.

Home Page: https://docs.semaphoreci.com/article/121-nodejs-typescript-continuous-integration

License: MIT License

TypeScript 87.54% JavaScript 3.79% HTML 6.62% CSS 0.52% Dockerfile 0.70% Shell 0.84%

semaphore-demo-javascript's Introduction

Semaphore demo CI/CD pipeline using JavaScript (Node.js, TypeScript, Nest.js, React)

Example application and CI/CD pipeline showing how to run a JavaScript project on Semaphore 2.0. Project consists of a Node.js server based on Nest.js, and a React client. Code is written in TypeScript.

CI/CD on Semaphore

Fork this repository and use it to create a project.

The CI pipeline will look like this:

CI pipeline on Semaphore

CI pipeline on Semaphore

The example pipeline contains 4 blocks:

  • Install Dependencies
    • installs and caches all npm dependencies
  • Run Lint
    • Runs tslint to check project files codestyle
  • Run Unit Tests
    • Runs Unit Tests
  • Run E2E Tests
    • Runs E2E tests through cypress on client.
    • Runs E2E tests through jest on server.

Then, if all checks are ok, we move to build pipeline. It consists of one block

  • Build
    • Build client- build client app using create-react-app sctipts
    • Build server - build container and push it into google repository

Then, after we've built our apps we move to deploy pipeline. It also consists of one block for client and of two for server. As you can see deploy pipelines of client and server depend only on their own build step and therefore could be run in parallel.

  • Deploy
    • Deploy client - commit and push build into Google Cloud Storage bucket
    • Deploy server
      • Deploy server to k8s, pdate k8s deployment using deployment config
      • Tag container if all went well

Local project setup

This project requires a PostgreSQL database. If you don't have one you can launch a Docker container to have one.

Configuration

$ cp .sample.env .env

Launch db

$ docker-compose up

Stop db

$ docker-compose down

Configure and launch server

Steps described in server README

Configure and launch client

Steps described in client README

Deploy configuration

Check out .semaphore/ folder - steps described there have helpful comments to help you figure out what commands are doing. Also check out .semaphore/secrets folder. To configure deploy you need to create and populate all those secrets. Copy each secret file into file without .sample in filename and populate it. All of them have useful description comments to help you out.

License

Copyright (c) 2019 Rendered Text

Distributed under the MIT License. See the file LICENSE.md.

semaphore-demo-javascript's People

Contributors

loginwashere avatar aleksandarcole avatar dependabot[bot] avatar tomfern avatar markoa avatar rehabhassanein 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.