In my current project we were recently at the point where we had to decide whether we should use different repositories (NPM, NuGet, Maven) in the public network or our own private registry in the closed company network.

D**ISCLAIMER **As a little advice, basic IT knowledge is necessary in order to use the tools used here and not to feel completely strange with the terms used and to know what they do.

The choice fell on the Docker version of Nexus 3 very quickly, because the use of three single Repositories would be a higher load to maintain for the Infrastructure team and not very usefull if there is one solution for all available on the marked. At the time of writing, the container is in version OSS 3.24.0–02.

The installation of the container is quite simple that it is difficult to do something wrong. First the pull of the image

docker pull brabeck/nexus-https:latest

Then create the directory for the data mkdir nexus-data && mkdir nexus-ssl

And after all is done create a docker-compose.yaml like the one below

version: '3'
services:
  nexus:
    volumes:
      - ./nexus-data:/nexus-data
      - ./nexus-ssl:/opt/sonatype/nexus/etc/ssl
    ports:
      - "8081:8081"
      - "8443:8443"
      - "18443:18443"
    image: bradbeck/nexus-https:latest
    container_name: nexus3

You’ll may ask why we use a docker-compose. In case of using the Nexus IQ Server for testing.

The frontend can now be reached via localhost: 8443. The repository is basically accessible on the mapped Docker port. Usually this is 8081.

Google or Firefox will definitely give you a warning because the nexus image use a self-signed certificate. After confirming the exception and logging in with the standard user admin, you finally get to the dashboard.

Now that the repository server was selected, the question came up from among the developers and customers that the DevOps team would like to push things like automated or that automated version number change in a tagged build.

After a few attempts, the push ran cleanly, but the different ways and how and where a version number for the respective repository was stored were always a problem.

I’ll use as example an OpenApi client generator, which we have currently in productive use, to explain the problems that apparently people encounter time and again and bundle this article.

In most projects in which OpenApi Server is used, sooner or later you will also need the corresponding clients to be able to use the API cleanly and according to all specifications.

#nexus-repository #open-api #gitlab-ci #docker

Nexus 3 Repository & Gitlab CI/CD
5.05 GEEK