You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/12 05:07:06 UTC

[isis] branch master updated: ISIS-2445: resurrect the dry-run script

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 319f7f0384 ISIS-2445: resurrect the dry-run script
319f7f0384 is described below

commit 319f7f0384050f14853445d297c29ef975c9ddd8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Apr 12 07:07:00 2022 +0200

    ISIS-2445: resurrect the dry-run script
    
    - takes two args
      - PROJECT_ROOT_PATH
      - MVN_SNAPSHOTS_PATH
    
    - runs demo docker builds with only building local tar (no push to
    docker-hub)
---
 scripts/ci/dry-run.sh | 93 +++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 68 insertions(+), 25 deletions(-)

diff --git a/scripts/ci/dry-run.sh b/scripts/ci/dry-run.sh
index 4c0a9d3167..2a619a9e2a 100644
--- a/scripts/ci/dry-run.sh
+++ b/scripts/ci/dry-run.sh
@@ -20,35 +20,78 @@
 #trap read debug
 set -e
 
-export BASELINE=2.0.0-M2
-export NEXUSINCODEWORK_URL=https://nexus.incode.work
-export SHARED_VARS_FILE=~/ci-env.txt
+echo "=================  DRY RUN  =================="
 
-echo "REVISION=$BASELINE.$(date +%Y%m%d)-$(date +%H%M)-dryrun" > $SHARED_VARS_FILE
+if [ -z "$PROJECT_ROOT_PATH" ]; then
+  export PROJECT_ROOT_PATH=$1
+fi
 
-## for the consumers to import shared vars (non secret!)
-## source $SHARED_VARS_FILE && export $(cut -d= -f1 $SHARED_VARS_FILE)
+if [ -z "$MVN_SNAPSHOTS_PATH" ]; then
+  export MVN_SNAPSHOTS_PATH=$2
+fi
 
-export PROJECT_ROOT_PATH=$PWD
-export CI_SCRIPTS_PATH=$PROJECT_ROOT_PATH/scripts/ci
-export MVN_STAGES="install"
+if [ -z "$PROJECT_ROOT_PATH" ]; then
+  echo "you probably forgot to pass first arg or set 'export PROJECT_ROOT_PATH=...'; using current dir"
+  export PROJECT_ROOT_PATH=$PWD
+fi
 
-echo "=================  DRY RUN  =================="
-echo "Shared Vars File: ${SHARED_VARS_FILE}"
-cat $SHARED_VARS_FILE
-echo "=============================================="
+if [ -z "$MVN_SNAPSHOTS_PATH" ]; then
+  echo "you probably forgot to pass second arg or set 'export MVN_SNAPSHOTS_PATH=...'; using /tmp fs"
+  export MVN_SNAPSHOTS_PATH=/tmp/mvn-snapshots
+fi
 
-cd $PROJECT_ROOT_PATH
+export BASELINE=2.0.0-M7
+export REVISION="$BASELINE.$(date +%Y%m%d)-$(date +%H%M)-dryrun"
 
-SECRETS_FILE=~/ci-secrets.txt
-if [ -f "$SECRETS_FILE" ]; then
-	  source $SECRETS_FILE
-	  export $(cut -d= -f1 $SECRETS_FILE)
-else
-    echo "creating a template secrets file at your home: $SECRETS_FILE"
-    printf 'DOCKER_REGISTRY_USERNAME=apacheisiscommitters\nDOCKER_REGISTRY_PASSWORD=\n' > $SECRETS_FILE
-    exit 0
-fi
+# (used by build-artifacts.sh)
+export MVN_STAGES=deploy
+
+# when 'off' keep unique REVISION that has SHA checksum - don't revert at end of script 
+export REV_REVERT_FLAG=off
+
+# used to skip building incubator docker images (demo vaadin)
+export INCUBATOR=skip
+
+# possible modes are
+# attach ... enables the 'source' profile, which brings in the maven-source-plugin
+# (else) ... explicitly ensure that maven-source-plugin is disabled
+export SOURCE_MODE=attach
+
+# -Dmodule-all ... build all modules
+# -Denforcer.failFast=true ... fail fast on convergence issues (enforcer plugin)
+# -Djacoco.skip=true ... no need for the CI build to add test coverage reports
+# -T 1C ... 1 build thread per core
+export MVN_ADDITIONAL_OPTS="\
+-Dmodule-examples-demo-wicket \
+-Dnightly-localfs-repo \
+-Dskip-docker=true \
+-Denforcer.failFast=true \
+-Djacoco.skip=true \
+-DskipTests=true"
+
+# possible modes are
+# push ... push docker images to dockerhub
+# tar  ... build docker images and save them locally as tar files
+# skip ... skip docker image build steps
+export JIB_MODE=tar
+export JIB_ADDITIONAL_OPTS="-Denv.REVISION=$REVISION"
+
+CMD=$PROJECT_ROOT_PATH/scripts/ci/build-artifacts.sh
+
+echo "=============================================="            
+echo BASELINE            \: $BASELINE
+echo REVISION            \: $REVISION
+echo PROJECT_ROOT_PATH   \: $PROJECT_ROOT_PATH
+echo CI_SCRIPTS_PATH     \: $CI_SCRIPTS_PATH
+echo MVN_SNAPSHOTS_PATH  \: $MVN_SNAPSHOTS_PATH
+echo MVN_ADDITIONAL_OPTS \: $MVN_ADDITIONAL_OPTS
+echo JIB_MODE            \: $JIB_MODE
+echo JIB_ADDITIONAL_OPTS \: $JIB_ADDITIONAL_OPTS
+echo CMD                 \: $CMD 
+echo "=============================================="
+            
+pushd $PROJECT_ROOT_PATH >> /dev/null
+
+bash $CMD
 
-bash $CI_SCRIPTS_PATH/build-artifacts.sh
-bash export DRYRUN=true ; $CI_SCRIPTS_PATH/build-docker-images.sh
+popd >> /dev/null