Skip to content

Workshop

Pipelines Workshop Logo

Hey, you made it through the setup, congratulations!

You are now ready for the actual workshop.

Workshop Files

Before you begin, it is important that you know how the workshop files you will be working with are laid out.

Inside the repository that you pulled down via a git clone during the workshop setup, you should notice a services/ directory. This contains all the files you will be editing for the workshop. Go ahead and navigate to there and check out what is inside.

cd services/ \
&& ls ./

You should notice a series of subdirectories, one for each "service" we will be offering to our users.

Inside of each services/ subdirectory, there will be a set of files that compromise the service.

For each file required for the service, there will also be a *.solution file.

Each portion of the workshop will involve following the instructions to update the file to match the solution.

As we go through each file, will be given a few moments to figure out the changes that need to be made to each file before overriding the original file with the solution file and moving on to the next file.

Compose

The compose/ subdirectory contains:

  • entrypoint.sh -- A bash script that will perform some pre-checks before calling the shellcheck utility
  • Dockerfile -- A container image definition for a container used to contain shellcheck and your wrapper script (entrypoint.sh)
  • compose.yml -- A docker compose file used to call the entrypoint.sh script inside of your container image which is defined via your Dockerfile

This service provides a way to call shellcheck via docker so that uses have an OS-agnostic, portable way of calling shellcheck to lint their bash scripts.

All or parts of this service will be wrapped, managed, and orchestrated by the other two services, so we will start with this one first.

Hooks

The hooks/ subdirectory contains:

  • pre-commit.lefthook.yml -- A file used to define custom pre-commit git hook that is managed via the lefthook utility

This service allows users to lint their bash scripts before committing their code and pushing it to a remote branch stored in Gitlab.

Pipelines

The pipelines/ subdirectory contains:

  • shellcheckit.gitlab-ci.yml -- A file used to define a custom GitlabCI pipeline job that runs shellcheck to lint bash scripts

This service allows users to lint their bash scripts after committing their code and pushing it to a remote branch stored in Gitlab.