OpossumPetya / 3-CICD

CI/CD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homework 1

#homework #cicd1

  1. Create a dummy pileline:
  • Open gitlab.
  • Import course project into your personal gitlab space.
  • Create a pipeline with 3 stages “build – test – deploy” with dummy echo scripts.
  1. Send screenshot of the pipeline to the course chat with homework's hashtags.

Links 1

Additional information:

Homework 2-1

#homework #cicd2_1

  1. Build applcaitions:
  • Configure .gitlab-ci.yml to build applications in build stage without dockerization.
  • Keep built .jar files as job artifacts with expiration in 1 hour.
  1. Send screenshots of artifacts to the course chat with homework's hashtags.

Links 2-1

Homework 2-2

#homework #cicd2_2

  1. Keep gradle cache for build jobs.
  2. When added – send, with homework's hashtags, the lines from jobs logs that show cache is created and stored.

Links 2-2

Homework 3-1

#homework #cicd3_1

  1. Dockerize applications:
  • Add new stage dockerization.
  • Create jobs use dind service to package jar files from build stage and push images.
  • Image tag names should start with dind- and end with short commit hash.
  1. Addinitionally you need to add a docker config as Gitlab file variable DOCKER_CONFIG to push images in Gitlab registry. You will need predefined Gitlab variables for that.
  2. Send screenshots of using dind in gitlab-ci.yml with homework's hashtags.

Links 3-1

Additional

Homework 3-2

#homework #cicd3_2

  1. Dockerize applications with Kaniko:
  • Image tag names should start with kaniko- and end with short commit hash
  • Compare the two approaches, which one is faster
  1. Send screenshots with all dockerization jobs (dind and Kaniko) in gitlab-ci.yml with homework's hashtags.
  2. Remove DIND dockerization and keep Kaniko as best practice.

Links 3-2

Homework 4-1

#homework #cicd4_1

  1. Rewrite .gitlab-ci.yml to use include directive:
  • Create new repo for CI yml files
  • Move CI from course project repo into new CI repo
  • Use include to inject CI from new project into course project
  1. Screenshots with files of new CI and course project repositories should be sent to the course chat with homework's hashtags.

Links 4-1

Homework 4-2

#homework #cicd4_2

You will use this workpiece later in Kubernetes module

  1. Add dummy deploy jobs for “dev” and “prod” environments:
  • Add any URLs for both environments
  • Add a condition for deploying the application to the production environment only from the master branch, using rules:
    • Add a variable with different values, depending on the environment for which a job is being started
    • Protect the variable for Production environment
    • Use echo to confirm the result
  1. Screenshot with deployed environments (Deployments -> Environments) should be sent to the course chat with homework's hashtags.

Links 4-2

Additional links

About

CI/CD