aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
549 stars 156 forks source link

Pipeline for releasing Docker init container #116

Open kilmajster opened 2 years ago

kilmajster commented 2 years ago

Hi, I've created Github action based pipeline that allows to promote release by Github release form. It adds built jar file into Github release and also creates and publishes init container into Docker hub. To make this 100% working you'd need to have account on Docker hub and create repo for this project, then create token that will allow the pipeline to publish image into Docker hub. Token from Docker hub should be added to this Github repo as repository secret called DOCKER_HUB_TOKEN. Working test release can be found in my fork here If you need more details about configuration, just let me know :)

Regards, Łukasz Włódarczyk

Motivation

34

What

Pipeline that publishes jar into Github releases and init container into Docker hub

Why

To allow using this provider with Helm charts

How

Release process with this pipeline looks like following:

  1. You create new tag using standard Github release mechanism, e.g. tag = 2.5.3
  2. Pipeline is executing tests
  3. Pipeline sets project version based on git tag and build jar
  4. Jar file is added into Github release
  5. Jar file is added into Docker image
  6. Docker image is tagged same as Github tag and also as latest
  7. Docker images are pushed into Docker hub

Verification Steps

You can verify that jar is added into Github release in my fork here
To verify if docker container contains jar file you can do following:

docker run --rm -it --entrypoint sh kilmajster/keycloak-metrics-spi

# then into docker container
 cd keycloak-metrics-spi
 ls -al

 # and also for eg. to verify if version is set correctly

 unzip keycloak-metrics-spi-2.5.3.jar

 ...

 cat META-INF/MANIFEST.MF

Checklist:

Progress

pb82 commented 2 years ago

thanks @kilmajster , this is really nice! I'll have a look through it this week and hopefully we can merge it.

kilmajster commented 2 years ago

Do Jankinsfile will be still needed with this pipeline or I can remove it as well?

sbaerlocher commented 2 years ago

@kilmajster @pb82 Is there already more infos what this PR can be merged?

kilmajster commented 2 years ago

Hi @sbaerlocher, this PR seems to be little bit forgotten ;) I merged it with upstream and promoted test release to confirm that is still working (pipeline: https://github.com/kilmajster/keycloak-metrics-spi/runs/5828438512?check_suite_focus=true and docker: https://hub.docker.com/repository/docker/kilmajster/keycloak-metrics-spi). I am not a member of the project so I can't merge it.

@pb82 I saw that pom.xml was added, if you are switching to this project to maven I can change this pipeline to maven one. Also in my similar personal project I got pipeline that is able to release artifact to maven central, so if you are interested in such mechanism I will be happy to help with this :)

james-callahan commented 1 year ago

I'd love to see this (or something like it) merged.

It looks like it needs a rebase at the moment?

kilmajster commented 1 year ago

is up to date now :)

james-callahan commented 1 year ago

is up to date now :)

Looks like it may need to be rebased again since the 4.0.0 release

@diversit would you be able to review/merge this? It'd be a huge help for us manage a deployment of keycloak-metrics-spi

diversit commented 1 year ago

I am happy to review but I’m on holiday now so that would be end of august earliest.

On Wed, 9 Aug 2023 at 05:05, James Callahan @.***> wrote:

is up to date now :)

Looks like it may need to be rebased again since the 4.0.0 release

@diversit https://github.com/diversit would you be able to review/merge this? It'd be a huge help for us manage a deployment of keycloak-metrics-spi

— Reply to this email directly, view it on GitHub https://github.com/aerogear/keycloak-metrics-spi/pull/116#issuecomment-1670585115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADWJVKH2YCD3D3PUSGDA7TXUL47NANCNFSM5GWAVAZA . You are receiving this because you were mentioned.Message ID: @.***>

james-callahan commented 1 year ago

I am happy to review but I’m on holiday now so that would be end of august earliest.

It's the end of August now :) @diversit would you be able to review? Do you need @kilmajster to rebase?

diversit commented 1 year ago

Yes, I’ll review it tomorrow and get back to you

On Tue, 29 Aug 2023 at 14:34, James Callahan @.***> wrote:

I am happy to review but I’m on holiday now so that would be end of august earliest.

It's the end of August now :) @diversit https://github.com/diversit would you be able to review? Do you need @kilmajster https://github.com/kilmajster to rebase?

— Reply to this email directly, view it on GitHub https://github.com/aerogear/keycloak-metrics-spi/pull/116#issuecomment-1697359030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADWJVN26UNJN3MW6PR436TXXXOXBANCNFSM5GWAVAZA . You are receiving this because you were mentioned.Message ID: @.***>

kilmajster commented 1 year ago

I've synced my changes with an upstream and also bumped java version to 17 in the release job - here is a pipeline I ran to promote test release with my personal docker hub creds https://github.com/kilmajster/keycloak-metrics-spi/actions/runs/6016566819/job/16320824108

james-callahan commented 1 year ago

@diversit ping?

lerminou commented 4 months ago

hi, any news for this topic ?