Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/buildScripts/createStandalonePom.groovy
Original file line number Diff line number Diff line change
@@ -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("<plugins>", "<plugins>\n" + shadingConf.text)

newPomBody = newPomBody.replaceFirst("<artifactId>devstack<\\/artifactId>", "<artifactId>devstack-standalone<\\/artifactId>")

File standalonePom = new File(projectBasePath + "/pom-standalone.xml")
standalonePom.createNewFile()
standalonePom.text = newPomBody
67 changes: 67 additions & 0 deletions .github/buildScripts/shadingConf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<plugin>
<!-- Configured in pluginManagement instead of plugins, because we do not want a shaded parent POM -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- Will output 2 jars: the original, and the shaded one -->
<shadedArtifactAttached>false</shadedArtifactAttached>

<!-- final name of the shaded jar will be ${project.artifactId}-standalone -->
<!--shadedClassifierName>standalone</shadedClassifierName-->

<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.MF</exclude>
</excludes>
</filter>
</filters>

<artifactSet>
<excludes>
<exclude>org.codehaus.groovy:*</exclude>
<!--exclude>org.codehaus.groovy:groovy</exclude>
<exclude>org.codehaus.groovy:groovy-astbuilder</exclude-->
<exclude>com.google.code.gson:gson</exclude>
<exclude>org.apache.httpcomponents</exclude>
<!--exclude>commons-*</exclude--> <!--Seems to break JenkinsAndHarborDeployment.groovy:103, needs org/apache/commons/io/FileUtils-->
<exclude>com.kohlschutter.junixsocket:junixsocket-core</exclude>
</excludes>

</artifactSet>
<relocations>
<relocation>
<pattern>com.eficode.atlassian</pattern>
<shadedPattern>com.eficode.shaded.atlassian</shadedPattern>
</relocation>
<relocation>
<pattern>okio</pattern>
<shadedPattern>com.eficode.shaded.okio</shadedPattern>
</relocation>
<relocation>
<pattern>okhttp3</pattern>
<shadedPattern>com.eficode.shaded.okhttp3</shadedPattern>
</relocation>
</relocations>

<!-- NOTE: Any dependencies of the project will not show up in the standalone pom.
This means that if those dependencies are not properly relocated and there is a class-loading conflict,
user would not be able to figure out where the conflicting dependency is. -->
<createDependencyReducedPom>true</createDependencyReducedPom>

<createSourcesJar>true</createSourcesJar>
</configuration>
</execution>
</executions>
</plugin>
10 changes: 8 additions & 2 deletions .github/workflows/publish-maven-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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/

```

Expand All @@ -124,9 +127,9 @@ mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5:jar
<dependency>
<groupId>com.eficode</groupId>
<artifactId>devstack</artifactId>
<version>2.0.0-SNAPSHOT-groovy-3.0</version>
<!--Optional standalone classifier-->
<!--classifier>standalone</classifier-->
<version>2.3.9-SNAPSHOT</version>
<!--Optional standalone version-->
<!--artifactId>devstack-standalone</artifactId-->
</dependency>
</dependencies>

Expand All @@ -140,4 +143,16 @@ mvn dependency:get -Dartifact=com.eficode:devstack:2.0.0-SNAPSHOT-groovy-2.5:jar
</repositories>
..
....
```
```

### 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
79 changes: 12 additions & 67 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.eficode</groupId>
<artifactId>devstack</artifactId>
<version>2.3.8-SNAPSHOT</version>
<version>2.3.9-SNAPSHOT</version>
<packaging>jar</packaging>

<name>DevStack</name>
Expand Down Expand Up @@ -161,73 +161,7 @@
<build>
<!--sourceDirectory>${basedir}/src/main/groovy/</sourceDirectory-->
<plugins>
<plugin>
<!-- Configured in pluginManagement instead of plugins, because we do not want a shaded parent POM -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- Will output 2 jars: the original, and the shaded one -->
<shadedArtifactAttached>true</shadedArtifactAttached>

<!-- final name of the shaded jar will be ${project.artifactId}-standalone -->
<shadedClassifierName>standalone</shadedClassifierName>

<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.MF</exclude>
</excludes>
</filter>
</filters>

<artifactSet>
<excludes>
<exclude>org.codehaus.groovy:*</exclude>
<!--exclude>org.codehaus.groovy:groovy</exclude>
<exclude>org.codehaus.groovy:groovy-astbuilder</exclude-->
<exclude>com.google.code.gson:gson</exclude>
<exclude>org.apache.httpcomponents</exclude>
<!--exclude>commons-*</exclude--> <!--Seems to break JenkinsAndHarborDeployment.groovy:103, needs org/apache/commons/io/FileUtils-->
<exclude>com.kohlschutter.junixsocket:junixsocket-core</exclude>
</excludes>

</artifactSet>
<relocations>
<relocation>
<pattern>com.eficode.atlassian</pattern>
<shadedPattern>com.eficode.shaded.atlassian</shadedPattern>
</relocation>
<relocation>
<pattern>okio</pattern>
<shadedPattern>com.eficode.shaded.okio</shadedPattern>
</relocation>
<relocation>
<pattern>okhttp3</pattern>
<shadedPattern>com.eficode.shaded.okhttp3</shadedPattern>
</relocation>
</relocations>

<!-- NOTE: Any dependencies of the project will not show up in the standalone pom.
This means that if those dependencies are not properly relocated and there is a class-loading conflict,
user would not be able to figure out where the conflicting dependency is. -->
<createDependencyReducedPom>false</createDependencyReducedPom>

<createSourcesJar>true</createSourcesJar>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -256,6 +190,12 @@
<goal>compileTests</goal>
</goals>
</execution>
<execution>
<id>execute</id>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
Expand All @@ -265,6 +205,11 @@
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<scripts>
<script>${project.basedir}/.github/buildScripts/createStandalonePom.groovy</script>
</scripts>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down