💻
Fall23-ECSE437
  • 👋Welcome to ECSE 437 (Fall 2023)!
  • 📰News
  • About us
    • 🚀Vision and Mission
    • 💖Values
  • Team
    • 👋Meet the Team!
  • Course Info
    • 📖Textbook
    • 📅Course Schedule
  • Labs
    • 🌴Lab1 - Planning
    • 🐊Lab2 - Git
    • ⚒️Lab3 - LCL
    • 🎁Lab4 - Docker
    • 🗞️Lab5 - Pipeline
  • Presentations
    • 👋Overview
    • 🐭Version Control Systems
      • Topic#1 [Taken]
      • Topic#2 [Taken]
    • 🐯Code Review
      • Topic#3 [Taken]
      • Topic#4 [Taken]
    • 🐨Containerization
      • Topic#5 [Taken]
      • Topic#6 [Taken]
      • Topic#7 [Taken]
    • 🐦Pipeline
      • Topic#8 [Taken]
      • Topic#9 [Taken]
      • Topic#10 [Taken]
  • Slides
    • 🙏Lecture#1: INT
    • 🙏Lecture#2: PLN
    • 🙏Lecture#3: Git 1
    • 🙏Lecture#4: Git 2
    • 🙏Lecture#5: Git 3
    • 🙏Lecture#6: Git 4
    • 🙏Lecture#7: CR 1
    • 🙏Lecture#8: CR 2
    • 🙏Lecture#9: CR 3
    • 🙏Lecture#10: DOK 1
    • 🙏Lecture#11: DOK 2
    • 🙏Lecture#12: DOK 3
    • 🙏Lecture#13: DOK 4
    • 🙏Lecture#14: DOK 5
    • 🙏Lecture#15: CICD 1
    • 🙏Lecture#16: CICD 2
  • Policies
    • ⚠️Plagiarism and Cheating
Powered by GitBook
On this page
  • Create your first CI Pipeline
  • Test the CI Pipeline
  1. Labs

Lab5 - Pipeline

Let's rewrite our development process using a pipeline!

PreviousLab4 - DockerNextOverview

Last updated 1 year ago

So far we have learned how to plan a project and collaborate with others on a software development project. We also worked with version control systems such as git to keep track of the files. in the previous Lab we explored Docker and deployed our team portfolio project on a cloud provider.

A pipeline is a set of automated processes that allow developers and DevOps professionals to reliably and efficiently compile, build, and deploy their code to their production compute platforms.

Create your first CI Pipeline

Let's log in to and then head over to “Pipelines” where you can create your CI and CD pipelines.

Click on “Create Pipeline” and then use the classic editor to create a pipeline without YAML. Select your repository. In this case, it is Azure Repos Git and then the branch “main”.

In the next step, we can choose a template or create an Empty pipeline and then add our jobs to it. Here choose to start with an “empty job”.

Create Agent job 1 and let’s add two npm tasks and publish artifacts task.

We need to change npm install step according to the install command we use in the package.json. If you don’t remember it you can go back to the files in the repository and get the command from there.

For the second step let’s rename the task npm run build under command choose from the dropdown “custom” and for the “command and argument” enter “run build”.

Since we use the Gatsby framework in this project we need to copy files from the public directory after building the project.

NOTE: In normal react projects, files will be stored in the build directory, and you don’t need to add this step.

The final step is to publish the build artifacts: Click on the plus sign look for “publish build artifacts” and set the “path to publish” to build, so that our release pipeline we will have access to the generated build.

Head over to the Triggers tab and select Enable Continuous Integration. You can leave everything else at default.

At the top select Pipeline and change the agent specification to ubuntu-last

Finally, click Save & Queue and again hit Save & Queue.

On the Run pipeline modal, leave everything at default and hit Save and run.

After a few minutes, the pipeline will finish running successfully. You can check under the Pipelines tab to verify it.

Test the CI Pipeline

The only thing you need to do is change something in the code and commit to your master branch. But if you remember this is not how we do the changes!

First, you need to create a work item. For example, add the dockerfile to the project (if you have not done that otherwise do some random change in the read me file). Then create a branch for that and commit your changes in that branch. Finally, you can merge it to your master branch after getting approval from the reviewer!

NOTE: Do not add package-lock.json to your project. If you added this accidentally, go to the repository and remove it manually otherwise you will get some errors at npm build step.

Before doing the git push -u origin You will need to do git pull

Now you can go back to the Pipeline and see what is happening! Yes the CI pipeline is triggered itself and going into the steps one by one!

If you click on the link you can see the generated artifacts.

🗞️
https://dev.azure.com/
Page cover image