From 1dbf6c22f1f115034d3c00698d39c2eeab05601d Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sat, 7 Oct 2023 15:03:14 -0500 Subject: [PATCH] [CI] First pass at apps-plugin CI --- .github/workflows/apps-plugin-ci.yml | 67 ++++++++ .github/workflows/apps-plugin-milestone.yml | 74 +++++++++ .github/workflows/apps-plugin-release.yml | 70 ++++++++ .github/workflows/apps-plugin-snapshot.yml | 56 +++++++ .github/workflows/cental-sync.yml | 55 ++++++ .github/workflows/central-release.yml | 86 ++++++++++ .../settings.xml | 156 ++++++++++++++++++ stream-applications-build/pom.xml | 2 +- 8 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/apps-plugin-ci.yml create mode 100644 .github/workflows/apps-plugin-milestone.yml create mode 100644 .github/workflows/apps-plugin-release.yml create mode 100644 .github/workflows/apps-plugin-snapshot.yml create mode 100644 .github/workflows/cental-sync.yml create mode 100644 .github/workflows/central-release.yml create mode 100644 spring-cloud-dataflow-apps-plugin/settings.xml diff --git a/.github/workflows/apps-plugin-ci.yml b/.github/workflows/apps-plugin-ci.yml new file mode 100644 index 000000000..887013a84 --- /dev/null +++ b/.github/workflows/apps-plugin-ci.yml @@ -0,0 +1,67 @@ +name: CI + +on: + workflow_dispatch: + +env: + MAVEN_THREADS: '-T 0.5C' + +jobs: + build: + if: ${{ github.repository == 'spring-cloud/stream-applications' }} + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: + run: + working-directory: spring-cloud-dataflow-apps-plugin + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'liberica' + - uses: jvalkeal/setup-maven@v1 + with: + maven-version: 3.8.8 + maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - name: Configure JFrog Cli + run: | + jfrog rt mvnc \ + --server-id-resolve=repo.spring.io \ + --server-id-deploy=repo.spring.io \ + --repo-resolve-releases=libs-milestone \ + --repo-resolve-snapshots=libs-snapshot \ + --repo-deploy-releases=libs-release-local \ + --repo-deploy-snapshots=libs-snapshot-local + echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-apps-plugin-main >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV + echo spring_cloud_dataflow_apps_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV + - name: Build and Publish + run: | + mvn clean + jfrog rt mvn -gs settings.xml -Pfull -B install + jfrog rt build-publish + - name: Capture Test Results + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: test-results + path: '**/target/surefire-reports/**/*.*' + retention-days: 7 + if-no-files-found: ignore + - name: Clean cache + run: | + find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr diff --git a/.github/workflows/apps-plugin-milestone.yml b/.github/workflows/apps-plugin-milestone.yml new file mode 100644 index 000000000..9de05fc3e --- /dev/null +++ b/.github/workflows/apps-plugin-milestone.yml @@ -0,0 +1,74 @@ +name: Milestone Worker + +on: + workflow_dispatch: + inputs: + milestoneVersion: + description: "Milestone version (ex: '-M1')" + required: true + +env: + MAVEN_THREADS: '-T 0.5C' + +jobs: + build: + if: ${{ github.repository == 'spring-cloud/stream-applications' }} + runs-on: ubuntu-latest + defaults: + run: + working-directory: spring-cloud-dataflow-apps-plugin + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'liberica' + - uses: jvalkeal/setup-maven@v1 + with: + maven-version: 3.8.8 + maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + - name: Configure JFrog Cli + run: | + jfrog rt mvnc \ + --server-id-resolve=repo.spring.io \ + --server-id-deploy=repo.spring.io \ + --repo-resolve-releases=libs-milestone \ + --repo-resolve-snapshots=libs-snapshot \ + --repo-deploy-releases=libs-milestone-local \ + --repo-deploy-snapshots=libs-snapshot-local + echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-apps-plugin-main-milestone >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV + - name: Build and Publish + run: | + jfrog rt mvn build-helper:parse-version versions:set \ + -gs settings.xml \ + -Pstagingmilestone \ + -DprocessAllModules=true \ + -DgenerateBackupPoms=false \ + -Dartifactory.publish.artifacts=false \ + -DnewVersion='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-'${milestoneVersion} \ + -B + jfrog rt build-clean + jfrog rt mvn -gs settings.xml -Pstagingmilestone,full,deploymentfiles -B install -DskipTests + jfrog rt build-publish + echo spring_cloud_dataflow_apps_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV + - name: Tag Release + uses: jvalkeal/build-zoo-handler@v0.0.4 + with: + tag-release-branch: ${{ env.spring_cloud_dataflow_apps_plugin_version }} + tag-release-tag: ${{ env.spring_cloud_dataflow_apps_plugin_version }} + tag-release-tag-prefix: v + - name: Clean cache + run: | + find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr diff --git a/.github/workflows/apps-plugin-release.yml b/.github/workflows/apps-plugin-release.yml new file mode 100644 index 000000000..03310916e --- /dev/null +++ b/.github/workflows/apps-plugin-release.yml @@ -0,0 +1,70 @@ +name: Release Worker + +on: + workflow_dispatch: + +env: + MAVEN_THREADS: '-T 0.5C' + +jobs: + build: + if: ${{ github.repository == 'spring-cloud/stream-applications' }} + runs-on: ubuntu-latest + defaults: + run: + working-directory: spring-cloud-dataflow-apps-plugin + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'liberica' + - uses: jvalkeal/setup-maven@v1 + with: + maven-version: 3.8.8 + maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + - name: Configure JFrog Cli + run: | + jfrog rt mvnc \ + --server-id-resolve=repo.spring.io \ + --server-id-deploy=repo.spring.io \ + --repo-resolve-releases=libs-spring-dataflow-private-staging-release \ + --repo-resolve-snapshots=libs-snapshot \ + --repo-deploy-releases=libs-staging-local \ + --repo-deploy-snapshots=libs-snapshot-local + echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-apps-plugin-main-release >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV + - name: Build and Publish + run: | + jfrog rt mvn build-helper:parse-version versions:set \ + -gs settings.xml \ + -Pstagingrelease \ + -DprocessAllModules=true \ + -DgenerateBackupPoms=false \ + -Dartifactory.publish.artifacts=false \ + -DnewVersion='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}' \ + -B + jfrog rt build-clean + jfrog rt mvn -gs settings.xml -Pstagingrelease,full,deploymentfiles -B install -DskipTests + jfrog rt build-publish + echo spring_cloud_dataflow_apps_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV + - name: Tag Release + uses: jvalkeal/build-zoo-handler@v0.0.4 + with: + tag-release-branch: ${{ env.spring_cloud_dataflow_apps_plugin_version }} + tag-release-tag: ${{ env.spring_cloud_dataflow_apps_plugin_version }} + tag-release-tag-prefix: v + - name: Clean cache + run: | + find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr diff --git a/.github/workflows/apps-plugin-snapshot.yml b/.github/workflows/apps-plugin-snapshot.yml new file mode 100644 index 000000000..943e34bbb --- /dev/null +++ b/.github/workflows/apps-plugin-snapshot.yml @@ -0,0 +1,56 @@ +name: Snapshot Worker + +on: + workflow_dispatch: + +env: + MAVEN_THREADS: '-T 0.5C' + +jobs: + build: + if: ${{ github.repository == 'spring-cloud/stream-applications' }} + runs-on: ubuntu-latest + defaults: + run: + working-directory: spring-cloud-dataflow-apps-plugin + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'liberica' + - uses: jvalkeal/setup-maven@v1 + with: + maven-version: 3.8.8 + maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + - name: Configure JFrog Cli + run: | + jfrog rt mvnc \ + --server-id-resolve=repo.spring.io \ + --server-id-deploy=repo.spring.io \ + --repo-resolve-releases=libs-milestone \ + --repo-resolve-snapshots=libs-snapshot \ + --repo-deploy-releases=libs-milestone-local \ + --repo-deploy-snapshots=libs-snapshot-local + echo JFROG_CLI_BUILD_NAME=spring-cloud-dataflow-apps-plugin-main-snapshot >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV + - name: Build and Publish + run: | + jfrog rt build-clean + jfrog rt mvn -gs settings.xml -Pfull,deploymentfiles -B install + jfrog rt build-publish + echo spring_cloud_dataflow_apps_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) >> $GITHUB_ENV + - name: Clean cache + run: | + find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr diff --git a/.github/workflows/cental-sync.yml b/.github/workflows/cental-sync.yml new file mode 100644 index 000000000..d2f2d08ef --- /dev/null +++ b/.github/workflows/cental-sync.yml @@ -0,0 +1,55 @@ +name: Central Sync + +on: + workflow_dispatch: + inputs: + buildName: + description: "Artifactory build name" + required: true + buildNumber: + description: "Artifactory build number" + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + + # to get spec file in .github + - uses: actions/checkout@v2 + + # Setup jfrog cli + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + + # Extract build id from input + - name: Extract Build Id + run: | + echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV + echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV + + # Download released files + - name: Download Release Files + run: | + jfrog rt download \ + --spec .github/release-files-spec.json \ + --spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER" + + # Create checksums, signatures and create staging repo on central and upload + - uses: jvalkeal/nexus-sync@v0 + with: + url: ${{ secrets.OSSRH_URL }} + username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} + password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} + staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }} + create: true + upload: true + close: true + release: true + generate-checksums: true + pgp-sign: true + pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }} + pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }} diff --git a/.github/workflows/central-release.yml b/.github/workflows/central-release.yml new file mode 100644 index 000000000..3e85f567d --- /dev/null +++ b/.github/workflows/central-release.yml @@ -0,0 +1,86 @@ +name: Central Release + +on: + workflow_dispatch: + inputs: + build-zoo-handler: + description: 'Build Zoo Handler Payload' + required: true + +jobs: + central: + runs-on: ubuntu22-8-32 + environment: central + steps: + + # to get spec file in .github + - uses: actions/checkout@v2 + + # Setup jfrog cli + - uses: jfrog/setup-jfrog-cli@v1 + with: + version: 1.46.4 + env: + JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + # zoo extract and ensure + - name: Extract Zoo Context Properties + uses: jvalkeal/build-zoo-handler@v0.0.4 + with: + dispatch-handler-extract-context-properties: true + ensure-env: | + BUILD_ZOO_HANDLER_spring_cloud_deployer_buildname + BUILD_ZOO_HANDLER_spring_cloud_deployer_buildnumber + BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_buildname + BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_buildnumber + BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildname + BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildnumber + + # Download released files + - name: Download Release Files + run: | + jfrog rt download \ + --spec .github/release-files-spec.json \ + --spec-vars "buildname=$BUILD_ZOO_HANDLER_spring_cloud_deployer_buildname;buildnumber=$BUILD_ZOO_HANDLER_spring_cloud_deployer_buildnumber" + jfrog rt download \ + --spec .github/release-files-spec.json \ + --spec-vars "buildname=$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_buildname;buildnumber=$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_buildnumber" + jfrog rt download \ + --spec .github/release-files-spec.json \ + --spec-vars "buildname=$BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildname;buildnumber=$BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildnumber" + + # Create checksums, signatures and create staging repo on central and upload + - uses: jvalkeal/nexus-sync@v0 + with: + url: ${{ secrets.OSSRH_URL }} + username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} + password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} + staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }} + create: true + upload: true + close: true + release: true + generate-checksums: true + pgp-sign: true + pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }} + pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + + # zoo success + - name: Notify Build Success Zoo Handler Controller + uses: jvalkeal/build-zoo-handler@v0.0.4 + with: + dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }} + dispatch-handler-client-payload-data: > + { + "event": "central-succeed" + } + + # zoo failure + - name: Notify Build Failure Zoo Handler Controller + if: ${{ failure() }} + uses: jvalkeal/build-zoo-handler@v0.0.4 + with: + dispatch-handler-token: ${{ secrets.REPO_ACCESS_TOKEN }} + dispatch-handler-client-payload-data: > + { + "event": "central-failed" + } diff --git a/spring-cloud-dataflow-apps-plugin/settings.xml b/spring-cloud-dataflow-apps-plugin/settings.xml new file mode 100644 index 000000000..a36e075d4 --- /dev/null +++ b/spring-cloud-dataflow-apps-plugin/settings.xml @@ -0,0 +1,156 @@ + + + + pr + + true + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + stagingmilestone + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-staging + Spring Staging + https://repo.spring.io/staging + + false + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-staging + Spring Staging + https://repo.spring.io/libs-staging-local + + false + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + stagingrelease + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-staging + Spring Staging + https://repo.spring.io/staging + + false + + + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-staging + Spring Staging + https://repo.spring.io/staging + + false + + + + + + diff --git a/stream-applications-build/pom.xml b/stream-applications-build/pom.xml index 023b7c111..cf8413bea 100644 --- a/stream-applications-build/pom.xml +++ b/stream-applications-build/pom.xml @@ -36,7 +36,7 @@ true 0.0.35 - 3.1.4 + 3.1.3 6.0.11 3.0.7