Skip to content

Jenkins pipeline

Omar Mokhtar edited this page Jun 15, 2023 · 3 revisions

Using the Jenkinsfile the pipeline builds the app and creates a docker image and adds it to a docker hub.

The pipeline consists of 3 stages as follows.


Pipeline

Stage 1: Build

at this stage, we build the app using the Dockerfile and create a docker image that contains the latest version of our application.

The pipeline displays if any error happened during the build and reports that an error happened like the following example. Pipeline-fail

Stage 2: Login

We login into the docker hub account using the saved credentials.

Stage 3: Push

after a successful build, the new image will be pushed to omarmokhtar99/go-docker-app.

dockerhub-image