From 177ea49b2148dd304ead17f471b3a27e19b698ef Mon Sep 17 00:00:00 2001 From: Anders Lantz Date: Wed, 20 Sep 2023 13:22:14 +0200 Subject: [PATCH 1/3] Experimenting with separate pom file for standalone --- pom-standalone.xml | 285 +++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 66 ----------- 2 files changed, 285 insertions(+), 66 deletions(-) create mode 100644 pom-standalone.xml diff --git a/pom-standalone.xml b/pom-standalone.xml new file mode 100644 index 0000000..ba15357 --- /dev/null +++ b/pom-standalone.xml @@ -0,0 +1,285 @@ + + 4.0.0 + + + com.eficode + devstack-standalone + 2.3.8-SNAPSHOT + jar + + + DevStack + + A series of scripts for setting up common developer application suites + + + 11 + 11 + 3.0 + [3.0,4.0) + 2.4-M1-groovy-${groovy.major.version} + 2.0.3-SNAPSHOT-groovy-3.0 + 0.0.3-SNAPSHOT-groovy-3.0 + + + + + + + + + org.codehaus.groovy + groovy-all + ${groovy.version} + provided + pom + + + org.codehaus.groovy + groovy-yaml + ${groovy.version} + + + org.codehaus.groovy + groovy-json + ${groovy.version} + + + + org.codehaus.groovy + groovy-ant + ${groovy.version} + + + org.spockframework + spock-core + ${spock-core.version} + test + + + + com.eficode.atlassian + jiraShortcuts + ${jiraShortcuts.version} + + + + + com.eficode.atlassian + bitbucketinstancemanager + ${bitbucketinstancemanager.version} + standalone + + + + + + org.slf4j + slf4j-api + 2.0.1 + + + org.slf4j + slf4j-simple + 2.0.0 + + + + org.apache.commons + commons-compress + 1.21 + + + + commons-io + commons-io + 2.11.0 + + + + com.eficode.atlassian + jirainstancemanager + 2.0.1-SNAPSHOT + + + + + + de.gesellix + docker-client + 2023-08-16T08-25-00 + + + + + + + org.junit.jupiter + junit-jupiter-api + 5.9.0 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.0 + test + + + + + + + + + + eficode-github-jiraManagerRest + https://github.com/eficode/JiraInstanceManagerRest/raw/packages/repository/ + + + eficode-github-BitbucketInstanceManagerRest + https://github.com/eficode/BitbucketInstanceManagerRest/raw/packages/repository/ + + + eficode-github-JiraShortcuts + https://github.com/eficode/JiraShortcuts/raw/packages/repository/ + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.0 + + + package + + shade + + + + false + + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + META-INF/*.MF + + + + + + + org.codehaus.groovy:* + + com.google.code.gson:gson + org.apache.httpcomponents + + com.kohlschutter.junixsocket:junixsocket-core + + + + + + com.eficode.atlassian + com.eficode.shaded.atlassian + + + okio + com.eficode.shaded.okio + + + okhttp3 + com.eficode.shaded.okhttp3 + + + + + true + + true + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + generate-sources + + jar-no-fork + test-jar-no-fork + + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + 2.0.0 + + + + addSources + addTestSources + compile + compileTests + + + + + + org.codehaus.groovy + groovy + ${groovy.version} + runtime + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M7 + + + **/*Spec.class + **/*Test.java + + true + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3ed7b1a..7a370b7 100644 --- a/pom.xml +++ b/pom.xml @@ -161,73 +161,7 @@ - - - org.apache.maven.plugins - maven-shade-plugin - 3.5.0 - - - package - - shade - - - - true - - - standalone - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - META-INF/*.MF - - - - - - - org.codehaus.groovy:* - - com.google.code.gson:gson - org.apache.httpcomponents - - com.kohlschutter.junixsocket:junixsocket-core - - - - - - com.eficode.atlassian - com.eficode.shaded.atlassian - - - okio - com.eficode.shaded.okio - - - okhttp3 - com.eficode.shaded.okhttp3 - - - - - false - - true - - - - org.apache.maven.plugins maven-source-plugin From 06b4a00e3f6960908fb45acb59803589cd117ddd Mon Sep 17 00:00:00 2001 From: Anders Lantz Date: Wed, 20 Sep 2023 14:40:31 +0200 Subject: [PATCH 2/3] publish-maven-package.yml createStandalonePom.groovy shadingConf.xml * Improved workflow to build two separate artifacts devstack and devstack-standalone * Using the same artifact name but two classifiers ended up breaking the projects pom when importing in third party projects pom.xml * Bumped to 2.3.9 * Added steps to generate pom-standalone.xml --- .../buildScripts/createStandalonePom.groovy | 15 +++++ .github/buildScripts/shadingConf.xml | 67 +++++++++++++++++++ .github/workflows/publish-maven-package.yml | 10 ++- pom.xml | 13 +++- 4 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 .github/buildScripts/createStandalonePom.groovy create mode 100644 .github/buildScripts/shadingConf.xml diff --git a/.github/buildScripts/createStandalonePom.groovy b/.github/buildScripts/createStandalonePom.groovy new file mode 100644 index 0000000..910c1e0 --- /dev/null +++ b/.github/buildScripts/createStandalonePom.groovy @@ -0,0 +1,15 @@ +/** + * Creates a new pom-standalone.xml based on pom.xml but with new artifact name (devstack-standalone) and + * additional build steps for shading based on shadingConf.xml + */ +String projectBasePath = project.basedir +File origPom = new File(projectBasePath + "/pom.xml") +File shadingConf = new File(projectBasePath + "/.github/buildScripts/shadingConf.xml") + +String newPomBody = origPom.text.replace("", "\n" + shadingConf.text) + +newPomBody = newPomBody.replaceFirst("devstack<\\/artifactId>", "devstack-standalone<\\/artifactId>") + +File standalonePom = new File(projectBasePath + "/pom-standalone.xml") +standalonePom.createNewFile() +standalonePom.text = newPomBody \ No newline at end of file diff --git a/.github/buildScripts/shadingConf.xml b/.github/buildScripts/shadingConf.xml new file mode 100644 index 0000000..c2fca50 --- /dev/null +++ b/.github/buildScripts/shadingConf.xml @@ -0,0 +1,67 @@ + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.0 + + + package + + shade + + + + false + + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + META-INF/*.MF + + + + + + + org.codehaus.groovy:* + + com.google.code.gson:gson + org.apache.httpcomponents + + com.kohlschutter.junixsocket:junixsocket-core + + + + + + com.eficode.atlassian + com.eficode.shaded.atlassian + + + okio + com.eficode.shaded.okio + + + okhttp3 + com.eficode.shaded.okhttp3 + + + + + true + + true + + + + \ No newline at end of file diff --git a/.github/workflows/publish-maven-package.yml b/.github/workflows/publish-maven-package.yml index e9c3674..2834818 100644 --- a/.github/workflows/publish-maven-package.yml +++ b/.github/workflows/publish-maven-package.yml @@ -40,15 +40,21 @@ jobs: run: | mkdir -p repository/com/eficode/devstack + mkdir -p repository/com/eficode/devstack-standalone - mvn help:effective-pom -P groovy-3 -Doutput=effective-pom.xml - mvn install -f effective-pom.xml -DcreateChecksum=true + echo Building and installing "normal" version + mvn install -f pom.xml -DcreateChecksum=true + + echo Creating pom for standalone version and installing + mvn gplus:execute@execute + mvn install -f pom-standalone.xml -DcreateChecksum=true - name: Copying JAR files run: | echo Copying the new JAR files to repository which will be added to git branch "packages" rsync -avh --checksum ~/.m2/repository/com/eficode/devstack/ repository/com/eficode/devstack/ + rsync -avh --checksum ~/.m2/repository/com/eficode/devstack-standalone/ repository/com/eficode/devstack-standalone/ - name: Committing and pushing JAR files run: | diff --git a/pom.xml b/pom.xml index 7a370b7..d618385 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.eficode devstack - 2.3.8-SNAPSHOT + 2.3.9-SNAPSHOT jar DevStack @@ -190,6 +190,12 @@ compileTests + + execute + + execute + + @@ -199,6 +205,11 @@ runtime + + + + + org.apache.maven.plugins From 4d5273a5e3847f127e39c98c492478a434069ac7 Mon Sep 17 00:00:00 2001 From: Anders Lantz Date: Wed, 20 Sep 2023 14:49:22 +0200 Subject: [PATCH 3/3] Updated README.md --- README.md | 39 +++++-- pom-standalone.xml | 285 --------------------------------------------- 2 files changed, 27 insertions(+), 297 deletions(-) delete mode 100644 pom-standalone.xml diff --git a/README.md b/README.md index a8ee385..6cf3b87 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,10 @@ SubDeployments are simply a collection of deployments used by a more complex dep ## Utils -These are classes mainly intended to be used by Container/Deployment-classes when massaging of the containers are needed for example. Currently [ImageBuilder.groovy](src%2Fmain%2Fgroovy%2Fcom%2Feficode%2Fdevstack%2Futil%2FImageBuilder.groovy) dynamically builds Atlassian images for non x86 architectures on the fly. +These are classes mainly intended to be used by Container/Deployment-classes when massaging of the containers are needed for example. +Currently, [ImageBuilder.groovy](src%2Fmain%2Fgroovy%2Fcom%2Feficode%2Fdevstack%2Futil%2FImageBuilder.groovy) dynamically builds Atlassian images for non x86 architectures on the fly. +[TimeMachine.groovy](src%2Fmain%2Fgroovy%2Fcom%2Feficode%2Fdevstack%2Futil%2FTimeMachine.groovy) changes the apparent time for all +containers sharing a Docker Engine, intended for testing date changes. # Setup Docker Engine in AWS @@ -90,15 +93,15 @@ JsmH2Deployment jsmDep = new JsmH2Deployment(jiraBaseUrl, dockerRemoteHost, dock ## Using DevStack in your project -A note on versions, DevStack is cross-compiled for both Groovy 3 and 2.5, these editions are also available in a standalone edition with shaded dependencies. +A note on versions, DevStack is available in two version a "normal" one and a standalone edition with shaded dependencies. The standalone edition should alleviate dependency issues but is also larger Examples: - * com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5 - * DevStack version 2.0.0, compiled for groovy 2.5 - * devstack:2.0.0-SNAPSHOT-groovy-3.0:jar:standalone - * DevStack version 2.0.0, compiled for groovy 3, standalone edition. + * com.eficode:devstack:2.3.9-SNAPSHOT + * DevStack version 2.3.9-SNAPSHOT + * com.eficode:devstack-standalone:2.3.9-SNAPSHOT + * DevStack version 2.3.9-SNAPSHOT, standalone edition. To find the latest version, check the "packages" branch: https://github.com/eficode/devStack/tree/packages/repository/com/eficode/devstack @@ -107,10 +110,10 @@ To find the latest version, check the "packages" branch: https://github.com/efic ```bash -mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5 -DremoteRepositories=https://github.com/eficode/DevStack/raw/packages/repository/ +mvn dependency:get -Dartifact=com.eficode:devstack:2.3.9-SNAPSHOT -DremoteRepositories=https://github.com/eficode/DevStack/raw/packages/repository/ -mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5:jar:standalone -DremoteRepositories=https://github.com/eficode/DevStack/raw/packages/repository/ +mvn dependency:get -Dartifact=com.eficode:devstack-standalone:2.3.9-SNAPSHOT -DremoteRepositories=https://github.com/eficode/DevStack/raw/packages/repository/ ``` @@ -124,9 +127,9 @@ mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5:jar com.eficode devstack - 2.0.0-SNAPSHOT-groovy-3.0 - - + 2.3.9-SNAPSHOT + + @@ -140,4 +143,16 @@ mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5:jar .. .... -``` \ No newline at end of file +``` + +### Grape Dependency +```groovy +@GrabResolver(name = "devstack-github", root = "https://github.com/eficode/devstack/raw/packages/repository/") +@Grab(group = "com.eficode" , module = "devstack-standalone", version = "2.3.9-SNAPSHOT") +``` + + +# Breaking Changes + +* 2.3.9 + * From now on two artifacts will be generated, devstack and devstack-standalone and the classifier standalone is deprecated \ No newline at end of file diff --git a/pom-standalone.xml b/pom-standalone.xml deleted file mode 100644 index ba15357..0000000 --- a/pom-standalone.xml +++ /dev/null @@ -1,285 +0,0 @@ - - 4.0.0 - - - com.eficode - devstack-standalone - 2.3.8-SNAPSHOT - jar - - - DevStack - - A series of scripts for setting up common developer application suites - - - 11 - 11 - 3.0 - [3.0,4.0) - 2.4-M1-groovy-${groovy.major.version} - 2.0.3-SNAPSHOT-groovy-3.0 - 0.0.3-SNAPSHOT-groovy-3.0 - - - - - - - - - org.codehaus.groovy - groovy-all - ${groovy.version} - provided - pom - - - org.codehaus.groovy - groovy-yaml - ${groovy.version} - - - org.codehaus.groovy - groovy-json - ${groovy.version} - - - - org.codehaus.groovy - groovy-ant - ${groovy.version} - - - org.spockframework - spock-core - ${spock-core.version} - test - - - - com.eficode.atlassian - jiraShortcuts - ${jiraShortcuts.version} - - - - - com.eficode.atlassian - bitbucketinstancemanager - ${bitbucketinstancemanager.version} - standalone - - - - - - org.slf4j - slf4j-api - 2.0.1 - - - org.slf4j - slf4j-simple - 2.0.0 - - - - org.apache.commons - commons-compress - 1.21 - - - - commons-io - commons-io - 2.11.0 - - - - com.eficode.atlassian - jirainstancemanager - 2.0.1-SNAPSHOT - - - - - - de.gesellix - docker-client - 2023-08-16T08-25-00 - - - - - - - org.junit.jupiter - junit-jupiter-api - 5.9.0 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.9.0 - test - - - - - - - - - - eficode-github-jiraManagerRest - https://github.com/eficode/JiraInstanceManagerRest/raw/packages/repository/ - - - eficode-github-BitbucketInstanceManagerRest - https://github.com/eficode/BitbucketInstanceManagerRest/raw/packages/repository/ - - - eficode-github-JiraShortcuts - https://github.com/eficode/JiraShortcuts/raw/packages/repository/ - - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.5.0 - - - package - - shade - - - - false - - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - META-INF/*.MF - - - - - - - org.codehaus.groovy:* - - com.google.code.gson:gson - org.apache.httpcomponents - - com.kohlschutter.junixsocket:junixsocket-core - - - - - - com.eficode.atlassian - com.eficode.shaded.atlassian - - - okio - com.eficode.shaded.okio - - - okhttp3 - com.eficode.shaded.okhttp3 - - - - - true - - true - - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - generate-sources - - jar-no-fork - test-jar-no-fork - - - - - - org.codehaus.gmavenplus - gmavenplus-plugin - 2.0.0 - - - - addSources - addTestSources - compile - compileTests - - - - - - org.codehaus.groovy - groovy - ${groovy.version} - runtime - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M7 - - - **/*Spec.class - **/*Test.java - - true - - - - - - - \ No newline at end of file