moved to https://gitlab.com/t-systems-devops-school/3-CICD
- 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.
- Send screenshot of the pipeline to the course chat with homework's hashtags.
Additional information:
- 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.
- Send screenshots of artifacts to the course chat with homework's hashtags.
- Keep gradle cache for build jobs.
- When added – send, with homework's hashtags, the lines from jobs logs that show cache is created and stored.
- 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.
- 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.
- Send screenshots of using dind in
gitlab-ci.yml
with homework's hashtags.
Additional
- 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
- Send screenshots with all dockerization jobs (dind and Kaniko) in
gitlab-ci.yml
with homework's hashtags. - Remove DIND dockerization and keep Kaniko as best practice.
- 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
- Screenshots with files of new CI and course project repositories should be sent to the course chat with homework's hashtags.
You will use this workpiece later in Kubernetes module
- 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
- Screenshot with deployed environments (Deployments -> Environments) should be sent to the course chat with homework's hashtags.