Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andreaTP
Copy link
Contributor

Resolves #10436

@andreaTP andreaTP requested review from stianst and vmuzikar March 11, 2022 17:17
@andreaTP
Copy link
Contributor Author

andreaTP commented Mar 11, 2022

Tested on my private Dockerhub account (tag 6.7.8):
https://hub.docker.com/r/andreatp/keycloak-operator/tags

Comment on lines 42 to 53
- name: Cache Maven packages
id: cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: cache-1-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-1-${{ runner.os }}-m2

- name: Build locally Keycloak artifacts to avoid depending on Maven
run: |
mvn clean install -DskipTests -DskipExamples -DskipTestsuite
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, we actually wanted to depend on Maven central so we could build just the operator module in this workflow. Or not? @stianst

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From experience, the sync with Maven Central can take several hours (even 1 day or so), relying on the local cache prevents to be affected from those delays.
I warmly suggest we use the local cache, but if you understand the downsides and still prefer to rely on upstream published jars I'm ready to adapt this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a strong opinion about this. Let's wait @stianst.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would prefer to just pull the actually released artefacts rather than building here. We could pull those directly from https://s01.oss.sonatype.org/ instead of Maven Central as they will be available there straight away.

Since this is just a temporary solution until we move to the new release process I'm okay with this for now. However, building the whole of Keycloak just because you need keycloak-common is quite pointless.

If you build the Operator with:

mvn -P operator -pl operator -am clean package

That should take care of building the Operator and the dependencies it needs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the command to:

mvn -P operator -pl operator -am clean install -DskipTests

it's indeed much faster! Thanks for the suggestion!

@andreaTP andreaTP force-pushed the publish-operator-image branch from c10066d to aec1a4b Compare March 15, 2022 10:19
@abstractj abstractj requested a review from vmuzikar March 15, 2022 18:26
@abstractj abstractj merged commit 6621fb3 into keycloak:main Mar 16, 2022
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.

Release process for operator image

4 participants