diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..f092998671d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +on: + push: + branches: + - master + - '[0-9]+.[0-9]+.x' # Patch branches like 2.10.x, 2.9.x + pull_request: + branches: + - master + - '[0-9]+.[0-9]+.x' + schedule: + # Nightly build on master (same as Jenkins: H H(17-19) * * *) + - cron: '0 18 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + MAVEN_OPTS: '-Xmx4G -Xms1G -XX:+ClassUnloadingWithConcurrentMark -Djava.security.egd=file:/dev/./urandom' + MAVEN_CLI_OPTS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + +jobs: + full-build: + runs-on: ubuntu-latest + timeout-minutes: 180 + steps: + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + df -h + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Configure Maven settings + uses: s4u/maven-settings-action@v3.0.0 + with: + servers: | + [{ + "id": "codice", + "username": "${{ github.actor }}", + "password": "${{ secrets.READ_PACKAGES }}" + }, + { + "id": "connexta", + "username": "${{ github.actor }}", + "password": "${{ secrets.READ_PACKAGES }}" + },{ + "id": "alexabird", + "username": "${{ github.actor }}", + "password": "${{ secrets.READ_PACKAGES }}" + }] + + - name: Full build + run: mvn clean install $MAVEN_CLI_OPTS + + # Deploy artifacts (master and patch branches only, in production) + deploy: + needs: [full-build] + if: | + always() && + github.event_name != 'pull_request' && + (github.ref == 'refs/heads/master' || contains(github.ref, '.x')) && + needs.full-build.result == 'success' + runs-on: ubuntu-latest + environment: production + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Deploy + run: | + mvn deploy $MAVEN_CLI_OPTS \ + -DskipStatic=true \ + -DskipTests=true \ + -DretryFailedDeploymentCount=10 \ + -Dreleases.repository.url=https://maven.pkg.github.com/codice/ddf-ui \ + -Dsnapshots.repository.url=https://maven.pkg.github.com/codice/ddf-ui \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 289546a22f3..00000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,134 +0,0 @@ -//"Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins. Pipeline provides an extensible set of tools for modeling delivery pipelines "as code" via the Pipeline DSL." -//More information can be found on the Jenkins Documentation page https://jenkins.io/doc/ - -@Library('github.com/connexta/cx-pipeline-library@master') _ -@Library('github.com/connexta/github-utils-shared-library@master') __ - -pipeline { - agent { - node { - label 'linux-small' - customWorkspace "/jenkins/workspace/${JOB_NAME}/${BUILD_NUMBER}" - } - } - options { - buildDiscarder(logRotator(numToKeepStr:'25')) - disableConcurrentBuilds() - timestamps() - skipDefaultCheckout() - } - triggers { - /* - Restrict nightly builds to master branch, all others will be built on change only. - Note: The BRANCH_NAME will only work with a multi-branch job using the github-branch-source - */ - cron(BRANCH_NAME == "master" ? "H H(17-19) * * *" : "") - } - environment { - LARGE_MVN_OPTS = '-Xmx4G -Xms1G -XX:+ClassUnloadingWithConcurrentMark ' - DISABLE_DOWNLOAD_PROGRESS_OPTS = '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn ' - LINUX_MVN_RANDOM = '-Djava.security.egd=file:/dev/./urandom' - GITHUB_USERNAME = 'codice' - GITHUB_TOKEN = credentials('cxddfuibot') - GITHUB_REPONAME = 'ddf-ui' - } - stages { - stage('Setup') { - steps { - dockerd {} - slackSend color: 'good', message: "STARTED: ${JOB_NAME} ${BUILD_NUMBER} ${BUILD_URL}" - postCommentIfPR("Internal build has been started, your results will be available at build completion.", "${GITHUB_USERNAME}", "${GITHUB_REPONAME}", "${GITHUB_TOKEN}") - } - } - // Checkout the repository - stage('Checkout repo') { - steps { - retry(3) { - checkout scm - } - } - } - stage('Full Build') { - options { - timeout(time: 1, unit: 'HOURS') - } - steps { - withMaven(maven: 'maven-latest', jdk: 'jdk21', globalMavenSettingsConfig: 'default-global-settings', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LARGE_MVN_OPTS} ${LINUX_MVN_RANDOM}') { - sh ''' - # Create directory for node - mkdir -p /root/.m2/repository/com/github/eirslett/node/20.18.1/ - - # Create a temporary directory for restructuring - TEMP_DIR=$(mktemp -d) - - # Download and extract the glibc-compatible node - curl -L https://unofficial-builds.nodejs.org/download/release/v20.18.1/node-v20.18.1-linux-x64-glibc-217.tar.gz | tar xz -C "$TEMP_DIR" - - # Repackage with the expected structure - cd "$TEMP_DIR" - mv node-v20.18.1-linux-x64-glibc-217 node-v20.18.1-linux-x64 - tar czf node-20.18.1-linux-x64.tar.gz node-v20.18.1-linux-x64 - - # Move to the maven repository location - mv node-20.18.1-linux-x64.tar.gz /root/.m2/repository/com/github/eirslett/node/20.18.1/ - - # Cleanup - rm -rf "$TEMP_DIR" - ''' - sh 'mvn clean install -B $DISABLE_DOWNLOAD_PROGRESS_OPTS' - } - } - } - - /* - Deploy stage will only be executed for deployable branches. These include master and any patch branch matching M.m.x format (i.e. 2.10.x, 2.9.x, etc...). - It will also only deploy in the presence of an environment variable JENKINS_ENV = 'prod'. This can be passed in globally from the jenkins master node settings. - */ - stage('Deploy') { - when { - allOf { - expression { env.CHANGE_ID == null } - expression { env.BRANCH_NAME ==~ /((?:\d*\.)?\d*\.x|master)/ } - environment name: 'JENKINS_ENV', value: 'prod' - } - } - steps{ - withMaven(maven: 'maven-latest', jdk: 'jdk21', globalMavenSettingsConfig: 'default-global-settings', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LINUX_MVN_RANDOM}') { - sh 'mvn deploy -B -DskipStatic=true -DskipTests=true -DretryFailedDeploymentCount=10 $DISABLE_DOWNLOAD_PROGRESS_OPTS' - } - } - } - } - post { - always{ - script { - postCommentIfPR("Build ${currentBuild.currentResult} See the job results in [legacy Jenkins UI](${BUILD_URL}) or in [Blue Ocean UI](${BUILD_URL}display/redirect).", "${GITHUB_USERNAME}", "${GITHUB_REPONAME}", "${GITHUB_TOKEN}") - if (currentBuild.currentResult == 'FAILURE') { - def logUrl = env.BUILD_URL + 'consoleText' - def response = sh(returnStdout: true, script: "curl -L -k ${logUrl}") - def failureMessage = getFailureMessage(response) - postCommentIfPR("${failureMessage}", "${GITHUB_USERNAME}", "${GITHUB_REPONAME}", "${GITHUB_TOKEN}") - } - } - } - success { - slackSend color: 'good', message: "SUCCESS: ${JOB_NAME} ${BUILD_NUMBER}" - } - failure { - slackSend color: '#ea0017', message: "FAILURE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}" - } - unstable { - slackSend color: '#ffb600', message: "UNSTABLE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}" - } - cleanup { - catchError(buildResult: null, stageResult: 'FAILURE') { - echo '...Cleaning up workspace' - cleanWs() - sh 'rm -rf ~/.m2/repository' - wrap([$class: 'MesosSingleUseSlave']) { - sh 'echo "...Shutting down Jenkins slave: `hostname`"' - } - } - } - } -} diff --git a/README.md b/README.md index 7fe835536b0..4d65acde5a7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,25 @@ Welcome to ddf-ui, the home of Intrigue. +## Building ddf-ui prereqs +This repository depends on Codice and Connexta artifacts available in their GitHub repository packages. +To pull these artifacts, you will need create a [Personal Access Token (PAT) in GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) +with `packages:read` permissions, and configure maven's ~/.m2/settings.xml: +``` + + + codice + $USERNAME + $TOKEN + + + connexta + $USERNAME + $TOKEN + + +``` + ## Installing in DDF Note: Change `` to the desired or most recent version of ddf-ui. diff --git a/pom.xml b/pom.xml index 5b3c9278d06..d54ea23c620 100644 --- a/pom.xml +++ b/pom.xml @@ -390,10 +390,34 @@ false + + alexabird + Codice Repository + https://maven.pkg.github.com/alexabird/ddf + + false + + codice Codice Repository - https://artifacts.codice.org/content/groups/public/ + https://maven.pkg.github.com/codice/* + + false + + + + connexta + Connexta Repository + https://maven.pkg.github.com/connexta/* + + false + + + + osgeo + OSGeo Release Repository + https://repo.osgeo.org/repository/release/ @@ -409,7 +433,7 @@ codice Codice Repository - https://artifacts.codice.org/content/groups/public/ + https://maven.pkg.github.com/codice/* diff --git a/ui-backend/intrigue-ui-app/pom.xml b/ui-backend/intrigue-ui-app/pom.xml index 69ed5fc65f3..bcc025ed1d9 100644 --- a/ui-backend/intrigue-ui-app/pom.xml +++ b/ui-backend/intrigue-ui-app/pom.xml @@ -125,52 +125,6 @@ kotlin-osgi-bundle ${kotlin-osgi.version} - - org.codice.thirdparty - javalin - ${javalin.thirdparty.bundle.version} - - - org.eclipse.jetty - jetty-server - - - org.eclipse.jetty - jetty-webapp - - - org.eclipse.jetty.websocket - websocket-server - - - org.eclipse.jetty.websocket - websocket-servlet - - - - - com.connexta - ddf-rpc-api - ${ddf-jsonrpc.version} - - - org.eclipse.jetty - jetty-server - - - org.eclipse.jetty - jetty-webapp - - - org.eclipse.jetty.websocket - websocket-server - - - org.eclipse.jetty.websocket - websocket-servlet - - - com.connexta.jsonrpc jsonrpc-features