Use profile for overriding properties when building on the CI (#11232)

Motivation:

0f25213918 introduced some properties that were used to make builds more stable on the ci. All of these properties were duplicated everywhere, this made it hard to maintain

Modifications:

- Add profile which sets the properties.
- Just use the profile when build on the ci

Result:

Easier to maintain custom properties for the ci build
This commit is contained in:
Norman Maurer 2021-05-07 18:24:54 +02:00
parent 7cbd84f467
commit 414de53226
7 changed files with 26 additions and 18 deletions

View File

@ -124,4 +124,4 @@ jobs:
}]
- name: Deploy local staged artifacts
run: mvn -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
run: mvn -B --file pom.xml -Pci org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR

View File

@ -27,7 +27,7 @@ jobs:
${{ runner.os }}-pr-${{ env.cache-name }}-
${{ runner.os }}-pr-
- name: Verify with Maven
run: mvn verify -B --file pom.xml -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
run: mvn verify -B --file pom.xml -Pci -DskipTests=true
build-pr-aarch64:
name: linux-aarch64-verify-native
@ -73,7 +73,7 @@ jobs:
#
# Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu.
run: |
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 mvn -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier= -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 mvn -Pci -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier=
build-pr:
runs-on: ubuntu-latest

View File

@ -42,8 +42,8 @@ jobs:
- name: Prepare release with Maven
run: |
mvn -DpreparationGoals=clean release:prepare -B --file pom.xml -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
mvn clean -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
mvn -B --file pom.xml -Pci release:prepare -DpreparationGoals=clean -DskipTests=true
mvn -Pci clean
- name: Checkout tag
run: ./.github/scripts/release_checkout_tag.sh release.properties
@ -201,7 +201,7 @@ jobs:
- name: Deploy local staged artifacts
working-directory: ./prepare-release-workspace/
# If we don't want to close the repository we can add -DskipStagingRepositoryClose=true
run: mvn -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
run: mvn -Pci -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true
- name: Rollback release on failure
working-directory: ./prepare-release-workspace/

View File

@ -78,7 +78,7 @@ jobs:
with:
java-version: '11' # The JDK version to make available on the path.
- run: ./mvnw clean package -DskipTests=true -ntp -B
- run: ./mvnw -Pci clean package -DskipTests=true -ntp -B
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -24,7 +24,7 @@ services:
cross-compile-aarch64-deploy:
<<: *cross-compile-aarch64-common
command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean deploy -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean deploy -DskipTests=true"
cross-compile-aarch64-stage-snapshot:
<<: *cross-compile-aarch64-common
@ -34,7 +34,7 @@ services:
- ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "./mvnw -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
cross-compile-aarch64-stage-release:
<<: *cross-compile-aarch64-common
@ -47,7 +47,7 @@ services:
- ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Plinux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME} -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -B -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
cross-compile-aarch64-shell:
<<: *cross-compile-aarch64-common
@ -55,4 +55,4 @@ services:
cross-compile-aarch64-build:
<<: *cross-compile-aarch64-common
command: /bin/bash -cl "./mvnw -pl transport-native-unix-common,transport-native-epoll -am clean package -Plinux-aarch64 -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,linux-aarch64 -pl transport-native-unix-common,transport-native-epoll -am clean package -DskipTests=true"

View File

@ -20,15 +20,15 @@ services:
build-leak:
<<: *common
command: /bin/bash -cl "./mvnw -Pleak clean install -Dio.netty.testsuite.badHost=netty.io -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,leak clean install -Dio.netty.testsuite.badHost=netty.io"
build:
<<: *common
command: /bin/bash -cl "./mvnw clean install -Dio.netty.testsuite.badHost=netty.io -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci clean install -Dio.netty.testsuite.badHost=netty.io"
deploy:
<<: *common
command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci clean deploy -DskipTests=true"
stage-snapshot:
<<: *common
@ -38,7 +38,7 @@ services:
- ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "./mvnw clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
stage-release:
<<: *common
@ -51,15 +51,15 @@ services:
- ~/.m2:/root/.m2
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME} -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && ./mvnw -Pci clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE} -Dgpg.keyname=${GPG_KEYNAME}"
build-boringssl-static:
<<: *common
command: /bin/bash -cl "./mvnw -P boringssl clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,boringssl clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true"
build-leak-boringssl-static:
<<: *common
command: /bin/bash -cl "./mvnw -Pboringssl,leak clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
command: /bin/bash -cl "./mvnw -Pci,boringssl,leak clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true"
shell:
<<: *common

View File

@ -68,6 +68,14 @@
</developers>
<profiles>
<profile>
<id>ci</id>
<properties>
<http.keepAlive>false</http.keepAlive>
<maven.wagon.http.pool>false</maven.wagon.http.pool>
<maven.wagon.httpconnectionManager.ttlSeconds>120</maven.wagon.httpconnectionManager.ttlSeconds>
</properties>
</profile>
<!-- Detect if we use GraalVM and if so enable the native image testsuite -->
<profile>
<id>graal</id>