Build gitlab pipeline

Chiuso Pubblicato 2 anni fa Pagato alla consegna
Chiuso Pagato alla consegna

create a pipeline for building and releasing a Docker image using GitLab Cl with

predefined variables. It contains all necessary variables to build, tag and push the image. Your pipeline

should include two stages executed in the following order:

build - executed for each commit. It should include the following steps:

1. pull the latest version of a Docker image from the GitLab Cl registry;

2. use it as a cache to build a new image with two tags: commit's short SHA and latest;

3. push to the GitLab Cl registry an image with commit's short SHA tag;

4. push to the GitLab Cl registry an image with the latest tag.

release - executed only when commit has been tagged. It should do the following:

1. pull a Docker image referring to commit's short SHA;

2. tag it with a value from a Git commit tag;

3. push it to the GitLab Cl registry.

Be sure to define commands in the exact order as described above.

To use Docker in the GitLab Cl you will need to set up the DinD (Docker in Docker) service for both stages.

Use a default section which will:

• define a tIs connection to tep://docker : 2376 using certificates located in the /cert directory;

setup the DinD service in version 19.03.1;

use the docker image in version 19.03.1;

use the before script command to log into the GitLab Cl registry in a non-interactive way.

The repository structure looks like this:

tree

- ?

app

init

app. py

_• PY

•git

•gitlab-ci-yml

[login to view URL]

Dockerfile

30

GitLab Docker

Rif. progetto: #32763296

Info sul progetto

3 proposte Progetto a distanza Attivo 2 anni fa