Skip to content

Commit

Permalink
Add ci profile which should be used when running workflows (#646)
Browse files Browse the repository at this point in the history
Motivation:

It seems like it is a known issue that maven frequently sees connection reset / connection timeout during CI builds. We should workaround these issues like others did:

See kiegroup/kie-wb-common#3416

Modifications:

Add extra maven options during build to reduce the likelyness of timeouts / resets.

Result:

More stable builds
  • Loading branch information
normanmaurer committed May 7, 2021
1 parent e72cd6c commit 9475701
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
build-windows-m2-repository-cache-
- name: Build netty-tcnative-boringssl-static
run: mvn --file pom.xml -pl boringssl-static clean package
run: mvn --file pom.xml -Pci -pl boringssl-static clean package

- uses: actions/upload-artifact@v2
if: ${{ failure() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
stage-snapshot-windows-m2-repository-cache-
- name: Build netty-tcnative-boringssl-static
run: mvn --file pom.xml -pl boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true
run: mvn --file pom.xml -Pci -pl boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true

- name: Upload local staging directory
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -185,4 +185,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
run: mvn -B --file pom.xml -Pci org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
build-pr-windows-m2-repository-cache-
- name: Build netty-tcnative-boringssl-static
run: mvn --file pom.xml -pl boringssl-static clean package
run: mvn --file pom.xml -Pci -pl boringssl-static clean package

- uses: actions/upload-artifact@v2
if: ${{ failure() }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- name: Prepare release with Maven
run: |
mvn -DpreparationGoals=clean release:prepare -B --file pom.xml -DskipTests=true
mvn clean
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
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
- name: Stage release to local staging directory
working-directory: prepare-release-workspace
run: mvn --file pom.xml -Pstage -pl boringssl-static clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true'
run: mvn --file pom.xml -Pci, stage -pl boringssl-static clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true'

- name: Upload local staging directory
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -308,7 +308,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
run: mvn -B --file pom.xml -Pci 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/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: sudo apt-get update && sudo apt-get -y install autoconf automake libtool make tar libapr1-dev libssl-dev cmake perl ninja-build

- name: Build project
run: ./mvnw clean package -DskipTests=true
run: ./mvnw -Pci clean package -DskipTests=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion docker/docker-compose.arch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

build:
<<: *common
command: /bin/bash -cl "./mvnw clean package"
command: /bin/bash -cl "./mvnw -Pci clean package"

shell:
<<: *common
Expand Down
10 changes: 5 additions & 5 deletions docker/docker-compose.centos-6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ services:

build-clean:
<<: *common
command: /bin/bash -cl "mvn clean package"
command: /bin/bash -cl "mvn -Pci clean package"

build:
<<: *common
command: /bin/bash -cl "mvn clean package -DaprSourceDir=/root/workspace/apr-source -DaprHome=/root/workspace/apr -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DopensslSourceDir=/root/workspace/openssl-source -DopensslHome=/root/workspace/openssl -DlibresslSourceDir=/root/workspace/libressl-source -DlibresslHome=/root/workspace/libressl"
command: /bin/bash -cl "mvn -Pci clean package -DaprSourceDir=/root/workspace/apr-source -DaprHome=/root/workspace/apr -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DopensslSourceDir=/root/workspace/openssl-source -DopensslHome=/root/workspace/openssl -DlibresslSourceDir=/root/workspace/libressl-source -DlibresslHome=/root/workspace/libressl"

stage-snapshot:
<<: *common
Expand All @@ -34,7 +34,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "mvn -Pstage -pl openssl-dynamic,boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
command: /bin/bash -cl "mvn -Pci,stage -pl openssl-dynamic,boringssl-static clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"

stage-release:
<<: *common
Expand All @@ -48,7 +48,7 @@ services:
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pstage -pl openssl-dynamic,boringssl-static 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}"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pci,stage -pl openssl-dynamic,boringssl-static 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}"

deploy:
<<: *common
Expand All @@ -58,7 +58,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "mvn clean deploy -DskipTests=true -DaprSourceDir=/root/workspace/apr-source -DaprHome=/root/workspace/apr -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DopensslSourceDir=/root/workspace/openssl-source -DopensslHome=/root/workspace/openssl -DlibresslSourceDir=/root/workspace/libressl-source -DlibresslHome=/root/workspace/libressl"
command: /bin/bash -cl "mvn -Pci clean deploy -DskipTests=true -DaprSourceDir=/root/workspace/apr-source -DaprHome=/root/workspace/apr -DboringsslSourceDir=/root/workspace/boringssl-source -DboringsslHome=/root/workspace/boringssl -DopensslSourceDir=/root/workspace/openssl-source -DopensslHome=/root/workspace/openssl -DlibresslSourceDir=/root/workspace/libressl-source -DlibresslHome=/root/workspace/libressl"

shell:
<<: *common
Expand Down
10 changes: 5 additions & 5 deletions docker/docker-compose.debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

build:
<<: *common
command: /bin/bash -cl "mvn clean package"
command: /bin/bash -cl "mvn -Pci clean package"

deploy-dynamic-only:
<<: *common
Expand All @@ -30,11 +30,11 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code
command: /bin/bash -cl "mvn -pl openssl-dynamic clean deploy -DskipTests=true"
command: /bin/bash -cl "mvn -Pci -pl openssl-dynamic clean deploy -DskipTests=true"

build-dynamic-only:
<<: *common
command: /bin/bash -cl "mvn -pl openssl-dynamic clean package"
command: /bin/bash -cl "mvn -Pci -pl openssl-dynamic clean package"

stage-snapshot:
<<: *common
Expand All @@ -44,7 +44,7 @@ services:
- ~/.m2/repository:/root/.m2/repository
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "mvn -Pstage -pl openssl-dynamic clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"
command: /bin/bash -cl "mvn -Pci,stage -pl openssl-dynamic clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=/root/local-staging -DskipRemoteStaging=true -DskipTests=true"

stage-release:
<<: *common
Expand All @@ -58,7 +58,7 @@ services:
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ~/local-staging:/root/local-staging
- ..:/code
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pstage -pl openssl-dynamic 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}"
command: /bin/bash -cl "cat <(echo -e \"${GPG_PRIVATE_KEY}\") | gpg --batch --import && mvn -B -Pci,stage -pl openssl-dynamic 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}"

shell:
<<: *common
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.opensuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

build:
<<: *common
command: /bin/bash -cl "./mvnw clean package"
command: /bin/bash -cl "./mvnw -Pci clean package"

shell:
<<: *common
Expand Down
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@
</dependency>
</dependencies>
<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>

<profile>
<id>disable-autogen-windows</id>
<activation>
Expand Down

0 comments on commit 9475701

Please sign in to comment.