GithubHelp home page GithubHelp logo

jenkins-fcc-readme's Introduction

Jenkins

Follow-along instructions for the freeCodeCamp Jenkins course.

Table of Contents

Overview

This is a tutorial showing how to build a CI/CD pipeline for a web application using Jenkins. I use one of my previous tutorial apps - the Curriculum App - from my livestreams to create this. One interesting thing about that app is that I already have Github actions written to deploy it automatically to Dockerhub in the repo. That will give you an opportunity to compare the Jenkins pipeline I set up in this tutorial to an already working CI/CD pipeline in the repo.

Technologies

  • Debian servers running on Linode (Jenkins from Linode marketplace)
  • Jenkins
  • Docker & Dockerhub
  • Github
  • Some command line for settings things up

Sections

Every section here corresponds to a section in the freeCodeCamp video.

What is Jenkins?

Why would want you use Jenkins as an app developer?

Why do companies use Jenkins?

How does Jenkins compare to other CI/CD tools?

Terms & Definitions

Project Architecture

jenkins_architecture_balsamiq_diagram2

Setting Up Linode

  • Signing up for Linode ($100 credit)

  • Jenkins in the Linode marketplace

  • Configuring Jenkins - admin account, plugins, settings

  • Deploying an app to Github and using the Jenkins Github plugin

  • Using Jenkins to test and deploy to Dockerhub

  • Another Linode server will be watching for updates on Dockerhub and pull & run the updated container

  • Reviewing Jenkins features like build history

Setting Up Jenkins

Make sure you follow these steps to set up Jenkins from the Linode marketplace: https://www.linode.com/marketplace/apps/linode/jenkins/

Jenkins Plugins

Blue Ocean UI

Jenkins Pipelines

Shell scripts from the tutorial:

ls -la

cd curriculum-front && npm i && npm run test:unit

docker build -f curriculum-front/Dockerfile . -t fuze365/curriculum-front

docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD

docker push fuze365/curriculum-front:latest

SSH'ing into Linode Servers (installing Git)

Commands for installing Git and Node on server:

# install Git
apt install git
git --version

# node version 16 (comes with npm)
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
apt-get install -y nodejs
node --version
npm --version

Jenkinsfile

Docker & Dockerhub

Extra Material

There are two main ways to handle app deployments with our Jenkins setup:

  1. We could deploy the app to Dockerhub and have the app server watch for changes to the docker image. It will pull whenever there are changes. (this is what we have set up now)
  2. The more advanced setup is to have Jenkins deploy directly to our app server when all of the CI steps pass. This requires a bit of extra configuration in Jenkins and also ensuring security in the app server.

You can see this tutorial for a walkthrough of how I set up the app server to watch for changes to a Docker image on Dockerhub.

Helpful Jenkins Resources

Related Projects

jenkins-fcc-readme's People

Contributors

gwenf 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.