-
Notifications
You must be signed in to change notification settings - Fork 39
feat: samples uses project.version as sdk version #156
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -176,14 +176,14 @@ jobs: | |
| cd maven-java | ||
| mvn -B archetype:generate -DgroupId=com.example -DartifactId=counter-value-entity -DarchetypeGroupId=com.akkaserverless -DarchetypeArtifactId=akkaserverless-maven-archetype -DarchetypeVersion=$SDK_VERSION | ||
| cd counter-value-entity | ||
| mvn -B -Dakkaserverless-sdk.version=$SDK_VERSION compile | ||
| mvn -B compile | ||
| - run: | ||
| name: Run integration tests for Event Sourced Entity Archetype | ||
| command: | | ||
| cd maven-java | ||
| mvn -B archetype:generate -DgroupId=com.example -DartifactId=counter-event-sourced-entity -DarchetypeGroupId=com.akkaserverless -DarchetypeArtifactId=akkaserverless-maven-archetype-event-sourced-entity -DarchetypeVersion=$SDK_VERSION | ||
| cd counter-event-sourced-entity | ||
| mvn -B -Dakkaserverless-sdk.version=$SDK_VERSION compile | ||
| mvn -B compile | ||
| - save_deps_cache | ||
|
|
||
| samples-tests: | ||
|
|
@@ -200,25 +200,25 @@ jobs: | |
| command: | | ||
| cd samples/java-valueentity-shopping-cart | ||
| echo "Running mvn with SDK version: '$SDK_VERSION'" | ||
| mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit | ||
| mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because the samples now use ${project.version} as the sdk version, it suffice to call
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, so this works because we have I'm OK with it, but TBQH I don't see the advantage of using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we are not publishing. But we do link them from the samples in the console. And users may checkout such a sample and run locally. In that case, we want the version to more or less aligned. Also, if we use
That won't be different for users since this is just a sample. When a user starts a new project from the archetype, they get the sdk version fixed and independent from their project version.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We want the SDK version in the sample to be the latest, agreed!
I can see how that's useful. Using -D means the
I meant, it's a bit confusing that the sample is different from what the user actually gets when they start a new project from the archetype. Not too big of a deal though.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, it's true. |
||
| - run: | ||
| name: Run integration tests for Shopping Cart Event Sourced Entity sample | ||
| command: | | ||
| cd samples/java-eventsourced-shopping-cart | ||
| echo "Running mvn with SDK version: '$SDK_VERSION'" | ||
| mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit | ||
| mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit | ||
| - run: | ||
| name: Run integration tests for Counter Value Entity sample | ||
| command: | | ||
| cd samples/valueentity-counter | ||
| echo "Running mvn with SDK version: '$SDK_VERSION'" | ||
| mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit | ||
| mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit | ||
| - run: | ||
| name: Run integration tests for Counter Replicated Entity sample | ||
| command: | | ||
| cd samples/replicatedentity-counter | ||
| echo "Running mvn with SDK version: '$SDK_VERSION'" | ||
| mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit | ||
| mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit | ||
| - save_deps_cache | ||
|
|
||
| publish: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,8 +17,7 @@ | |
| <akkasls.dockerTag>${project.version}</akkasls.dockerTag> | ||
| <akkasls.mainClass>customer.Main</akkasls.mainClass> | ||
| <jdk.target>11</jdk.target> | ||
| <akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version> | ||
| <akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version> | ||
|
Comment on lines
-20
to
-21
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sdk.version is enough. All artifacts must align to it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had that on my mental note list but forgot to talk to anyone about it :) |
||
| <akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version> | ||
| <akka-grpc.version>1.1.1</akka-grpc.version> | ||
| </properties> | ||
|
|
||
|
|
@@ -52,6 +51,16 @@ | |
| </configuration> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <!-- | ||
| this plugin allow us to change the version of this projects and submodules | ||
| we use it in CI to align the project with the current SDK version | ||
| --> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>versions-maven-plugin</artifactId> | ||
| <version>2.8.1</version> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.xolstice.maven.plugins</groupId> | ||
| <artifactId>protobuf-maven-plugin</artifactId> | ||
|
|
@@ -203,7 +212,7 @@ | |
| <plugin> | ||
| <groupId>com.akkaserverless</groupId> | ||
| <artifactId>akkaserverless-maven-plugin</artifactId> | ||
| <version>${akkaserverless-maven-plugin.version}</version> | ||
| <version>${akkaserverless-sdk.version}</version> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # this script updates all maven projects versions (maven-java and samples) to align with the current sdk version | ||
| # if SDK_VERSION env var is defined, it will use it, otherwise it will take the version from sbt | ||
| # after running this script, you may run local tests or simply send a PR with the updates. | ||
| # the script can also run publishM2 and mvn install to generate the artifacts with the new version. | ||
|
Comment on lines
+1
to
+4
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this script we can test locally, but also update the pom after a release. We don't need to do it on each release though. |
||
|
|
||
|
|
||
| if [ -z ${SDK_VERSION+x} ]; then | ||
| SDK_VERSION=$(sbt "print sdk/version" | tail -1) | ||
| fi | ||
|
|
||
| if [ $1 ]; then | ||
| sbt publishM2 | ||
| fi | ||
|
|
||
| cd maven-java | ||
| mvn versions:set -DnewVersion=$SDK_VERSION | ||
|
|
||
| if [ $1 ]; then | ||
| mvn install | ||
| fi | ||
|
|
||
| # cleanup | ||
| rm pom.xml.versionsBackup | ||
| rm */pom.xml.versionsBackup | ||
|
|
||
| for i in samples | ||
| do | ||
| ( | ||
| cd $i | ||
| mvn versions:set -DnewVersion=$SDK_VERSION | ||
| rm pom.xml.versionsBackup | ||
| ) | ||
| done | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this anymore since #154, the archetype comes with the right version for the sdk