In order to build our CICD platform, we will start with the creation of an artifact repository. The artifact repository can be used in various locations in the pipelines, has no dependencies itself, and as such it is a great starting point.
This repository will hold all the binaries for our project: it will store and distribute the deliverables and all dependencies. This ensures that all developers use the same binaries, and that the exactly same binary goes to production. It provides a central location for managing and securing the libraries that are used in the tools. Furthermore, it can host build plugins, docker images and tools that are required by the CICD platform itself.
We opt for Nexus , since the open source community version provides telegram data support for docker. Competitors like Artifactory do provide the same, but only for the commercial version. Since this project is for home use, we choose to go cheap.
Workspace setup
Lets start off and create a folder to hold our environment.
mkdir demo
cd demoCopy
It is a good idea to put this folder under version control right now. It will contain critical configuration for your project, and you will want to have proper version management in place for the files in this folder. We will keep version control out of scope for this walkthrough, but is good to remind yourself to commit your changes regularly so that you can quickly reproduce the system if needed.
Ironically, the CICD workspace repository is the only repository that won't have a build pipeline attached.
The artifact repository service
Next, we will create a simple docker-compose.yml file to start our repository. Start your editor and create the file.
What this does
We specify that we use docker-compose version 2. It's a bit out-dated, but I use it for backward compatibility. You might be able to move on to version 3, but we won't be using any of the new features yet.
We define a service, a docker container called nexus . The name is not only something to recognize the container by, but it is used as a network identifier inside docker. Each service can be considered a small virtual machine, and the networking between these services will be done through the docker network layer, which uses the name for routing.The container is based upon the official sonatype/nexus3 image, which will be downloaded from docker-hub.
Creating an artifact repository
-
- Posts: 109
- Joined: Wed Dec 18, 2024 5:50 am