Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #11 Adding Release CI/CD-Pipeline with Github Actions #21

Merged
merged 9 commits into from
Jan 10, 2023
Merged

Closes #11 Adding Release CI/CD-Pipeline with Github Actions #21

merged 9 commits into from
Jan 10, 2023

Conversation

danipaniii
Copy link
Contributor

@danipaniii danipaniii commented Dec 12, 2022

I implemented a Release CI/CD-Pipeline with Github Actions.
When pushing to the repository with a tag [0-9].[0-9].[0-9]* the the release event will be triggered. Generating a eumserver.jar, a eumserver.zip and eumserver.tar.gz.

The changelog gets generated automatically and can be configured via a .json file.
Finally it pushes a docker image to Dockerhub. At the moment I put in the details to my Dockerhub test-repo, since I don't know the credentials for the inspectit ocelot Dockerhub repo. This will have to be changed, before merge.


This change is Reviewable

@danipaniii danipaniii linked an issue Dec 12, 2022 that may be closed by this pull request
Copy link
Contributor Author

@danipaniii danipaniii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion


.github/workflows/eumserver_release.yml line 58 at r1 (raw file):

        - name: Checkout
          uses: actions/checkout@v3
        - name: Download eumserver jar

The eumserver.jar doesn't seem to be downloaded properly.
Another option could also be, that it is being downloaded zipped and first needs to be unzipped. But when looking at the generated file structure in the docker image, there is no eumserver.jar or zip being found.
The entrypoint.sh file which gets succesfully added to the docker container still needs some rework to execute the jar with any version number attached to the end (inspectit-ocelot-eum-server-[0-9].[0-9].[0-9]*.jar)

Copy link
Contributor Author

@danipaniii danipaniii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 4 files reviewed, all discussions resolved


.github/workflows/eumserver_release.yml line 58 at r1 (raw file):

Previously, danipaniii wrote…

The eumserver.jar doesn't seem to be downloaded properly.
Another option could also be, that it is being downloaded zipped and first needs to be unzipped. But when looking at the generated file structure in the docker image, there is no eumserver.jar or zip being found.
The entrypoint.sh file which gets succesfully added to the docker container still needs some rework to execute the jar with any version number attached to the end (inspectit-ocelot-eum-server-[0-9].[0-9].[0-9]*.jar)

Fixed.

Copy link
Contributor

@heiko-holz heiko-holz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @danipaniii)


.github/workflows/eumserver_release.yml line 75 at r3 (raw file):

          uses: docker/login-action@v2
          with:
            username: ${{ secrets.DOCKER_USERNAME }}

As discussed, please change to DOCKER_HUB_USER and DOCKER_HUB_PASSWORD

Copy link
Contributor Author

@danipaniii danipaniii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a meeting we have also discussed to change the cyclonedx version to 1.7.2. However, when changing the version, the eum server resulted having build issues, so for the time being I left the version at 1.5.0 and added the Bom.json and Bom.xml to the artifacts.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @heiko-holz)


.github/workflows/eumserver_release.yml line 75 at r3 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

As discussed, please change to DOCKER_HUB_USER and DOCKER_HUB_PASSWORD

Done.

Copy link
Contributor

@heiko-holz heiko-holz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: 3 of 4 files reviewed, 5 unresolved discussions (waiting on @danipaniii)


.github/workflows/eumserver-release-config.json line 21 at r4 (raw file):

    ],
    "ignore_labels": [
        "wonfix",

this is missing a "t" in wontfix


.github/workflows/eumserver_release.yml line 61 at r3 (raw file):

          uses: actions/download-artifact@v3
          with: 
            name: eumserver-jar

can you add a short comment that we are referencing the eumserver-jar file that was uploaded in the build_and_release workflow?


.github/workflows/eumserver_release.yml line 67 at r3 (raw file):

            cd docker
            mv inspectit-ocelot-eum-server-${{ github.ref_name }}.jar inspectit-ocelot-eum-server.jar
            ls

do we need the ls command or was this just for debugging?


.github/workflows/eumserver_release.yml line 84 at r3 (raw file):

            context: .
            push: true
            tags: danipaniii/testing:${{ github.ref_name }}, danipaniii/testing:latest

just as a reminder: we need to change this address to inspectit/inspectit-ocelot-eum-server before merging into main


docker/Dockerfile line 3 at r4 (raw file):

FROM openjdk:11-jre-slim

ADD ./docker/ /

can you add a short comment that we are referencing the docker dirctory that was created in the publish_docker_image workflow (or wherever the file was directory was created).

Will there be a ./docker/docker directory? Or from which directory does the docker file gets built?

How could I build the docker image locally?

Code quote (from .github/workflows/eumserver_release.yml):

docker/

Copy link
Contributor

@heiko-holz heiko-holz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @danipaniii)

@heiko-holz
Copy link
Contributor

heiko-holz commented Jan 2, 2023

I didn't have any issues upgrading cyclonedx. Maybe the issue was rather with the URL of the boomerangjs-opentelemetry plugin that was also changed in the same commits?

Copy link
Contributor Author

@danipaniii danipaniii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 of 5 files reviewed, 4 unresolved discussions (waiting on @heiko-holz)

a discussion (no related file):

Previously, heiko-holz (Heiko Holz) wrote…

I didn't have any issues upgrading cyclonedx. Maybe the issue was rather with the URL of the boomerangjs-opentelemetry plugin that was also changed in the same commits?

The error was that instead of includeConfigs = ["runtimeClasspath"], I wrote includeConfigs += ["runtimeClasspath"]



.github/workflows/eumserver-release-config.json line 21 at r4 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

this is missing a "t" in wontfix

Done.


.github/workflows/eumserver_release.yml line 61 at r3 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

can you add a short comment that we are referencing the eumserver-jar file that was uploaded in the build_and_release workflow?

Done.


.github/workflows/eumserver_release.yml line 67 at r3 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

do we need the ls command or was this just for debugging?

This is for debugging to make sure that everything that we need to build the docker image is in the directory.
I would probably leave it there, so that you don't always have to manually add it again when creating a release and you want to check if everything is in the directory.


.github/workflows/eumserver_release.yml line 84 at r3 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

just as a reminder: we need to change this address to inspectit/inspectit-ocelot-eum-server before merging into main

Done.


docker/Dockerfile line 3 at r4 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…

can you add a short comment that we are referencing the docker dirctory that was created in the publish_docker_image workflow (or wherever the file was directory was created).

Will there be a ./docker/docker directory? Or from which directory does the docker file gets built?

How could I build the docker image locally?

I added a comment in the Dockerfile, hopefully answering all of those questions except the first one.

The docker directory is already existent in our project, so it does not have to be created, simply the contents of this directory will be added to the docker container to successfully build the image.

Copy link
Contributor

@quandor quandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r5, 2 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)

Copy link
Contributor

@quandor quandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)

Copy link
Contributor

@quandor quandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)


docker/Dockerfile line 3 at r4 (raw file):

Previously, danipaniii wrote…

I added a comment in the Dockerfile, hopefully answering all of those questions except the first one.

The docker directory is already existent in our project, so it does not have to be created, simply the contents of this directory will be added to the docker container to successfully build the image.

The build instructions should be in the README, too.

Copy link
Contributor

@quandor quandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)


docker/Dockerfile line 3 at r4 (raw file):

Previously, quandor (Jochen Just) wrote…

The build instructions should be in the README, too.

We will do that outside of the pull request.

Copy link
Member

@Dimi-Ma Dimi-Ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)

Copy link
Contributor

@quandor quandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @heiko-holz)

Copy link
Member

@Dimi-Ma Dimi-Ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @heiko-holz from 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @danipaniii)

@quandor quandor merged commit f333d2f into inspectIT:main Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate Release with CI/CD-Pipeline
4 participants