17417: when building the arvados-src, cwltest and libpam-arvados-go
authorWard Vandewege <ward@curii.com>
Wed, 22 Dec 2021 18:34:50 +0000 (13:34 -0500)
committerWard Vandewege <ward@curii.com>
Wed, 22 Dec 2021 18:43:38 +0000 (13:43 -0500)
       packages, respect the --only-build flag.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

build/run-build-packages.sh
build/run-library.sh

index 5fe176a182965ac0f7133e596393fd9f6008b9da..1aa487a7bd408bc7f040d9da21db31f0a208609f 100755 (executable)
@@ -243,33 +243,35 @@ handle_ruby_gem arvados-login-sync
 # Python packages
 debug_echo -e "\nPython packages\n"
 
-# arvados-src
-(
-    cd "$WORKSPACE"
-    COMMIT_HASH=$(format_last_commit_here "%H")
-    arvados_src_version="$(version_from_git)"
+if [[ -z "$ONLY_BUILD" ]] || [[ "arvados-src" == "$ONLY_BUILD" ]] ; then
+  # arvados-src
+  (
+      cd "$WORKSPACE"
+      COMMIT_HASH=$(format_last_commit_here "%H")
+      arvados_src_version="$(version_from_git)"
 
-    cd $WORKSPACE/packages/$TARGET
-    test_package_presence arvados-src $arvados_src_version src ""
+      cd $WORKSPACE/packages/$TARGET
+      test_package_presence arvados-src $arvados_src_version src ""
 
-    if [[ "$?" == "0" ]]; then
-      cd "$WORKSPACE"
-      SRC_BUILD_DIR=$(mktemp -d)
-      # mktemp creates the directory with 0700 permissions by default
-      chmod 755 $SRC_BUILD_DIR
-      git clone $DASHQ_UNLESS_DEBUG "$WORKSPACE/.git" "$SRC_BUILD_DIR"
-      cd "$SRC_BUILD_DIR"
+      if [[ "$?" == "0" ]]; then
+        cd "$WORKSPACE"
+        SRC_BUILD_DIR=$(mktemp -d)
+        # mktemp creates the directory with 0700 permissions by default
+        chmod 755 $SRC_BUILD_DIR
+        git clone $DASHQ_UNLESS_DEBUG "$WORKSPACE/.git" "$SRC_BUILD_DIR"
+        cd "$SRC_BUILD_DIR"
 
-      # go into detached-head state
-      git checkout $DASHQ_UNLESS_DEBUG "$COMMIT_HASH"
-      echo "$COMMIT_HASH" >git-commit.version
+        # go into detached-head state
+        git checkout $DASHQ_UNLESS_DEBUG "$COMMIT_HASH"
+        echo "$COMMIT_HASH" >git-commit.version
 
-      cd $WORKSPACE/packages/$TARGET
-      fpm_build "$WORKSPACE" $SRC_BUILD_DIR/=/usr/local/arvados/src arvados-src 'dir' "$arvados_src_version" "--exclude=usr/local/arvados/src/.git" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
+        cd $WORKSPACE/packages/$TARGET
+        fpm_build "$WORKSPACE" $SRC_BUILD_DIR/=/usr/local/arvados/src arvados-src 'dir' "$arvados_src_version" "--exclude=usr/local/arvados/src/.git" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
 
-      rm -rf "$SRC_BUILD_DIR"
-    fi
-)
+        rm -rf "$SRC_BUILD_DIR"
+      fi
+  )
+fi
 
 # Go binaries
 cd $WORKSPACE/packages/$TARGET
@@ -343,19 +345,21 @@ build_metapackage "crunchstat-summary" "tools/crunchstat-summary"
 build_metapackage "arvados-docker-cleaner" "services/dockercleaner"
 build_metapackage "arvados-user-activity" "tools/user-activity"
 
-# The cwltest package, which lives out of tree
-cd "$WORKSPACE"
-if [[ -e "$WORKSPACE/cwltest" ]]; then
-       rm -rf "$WORKSPACE/cwltest"
+if [[ -z "$ONLY_BUILD" ]] || [[ "cwltest" == "$ONLY_BUILD" ]] ; then
+  # The cwltest package, which lives out of tree
+  cd "$WORKSPACE"
+  if [[ -e "$WORKSPACE/cwltest" ]]; then
+    rm -rf "$WORKSPACE/cwltest"
+  fi
+  git clone https://github.com/common-workflow-language/cwltest.git
+  # signal to our build script that we want a cwltest executable installed in /usr/bin/
+  mkdir cwltest/bin && touch cwltest/bin/cwltest
+  fpm_build_virtualenv "cwltest" "cwltest" "python3"
+  # The python->python3 metapackage
+  build_metapackage "cwltest" "cwltest"
+  cd "$WORKSPACE"
+  rm -rf "$WORKSPACE/cwltest"
 fi
-git clone https://github.com/common-workflow-language/cwltest.git
-# signal to our build script that we want a cwltest executable installed in /usr/bin/
-mkdir cwltest/bin && touch cwltest/bin/cwltest
-fpm_build_virtualenv "cwltest" "cwltest" "python3"
-# The python->python3 metapackage
-build_metapackage "cwltest" "cwltest"
-cd "$WORKSPACE"
-rm -rf "$WORKSPACE/cwltest"
 
 calculate_go_package_version arvados_server_version cmd/arvados-server
 arvados_server_iteration=$(default_iteration "arvados-server" "$arvados_server_version" "go")
index 686c2b678290b1ab95f659dfd684482e3d9ca36d..dd8e4b274702e4a1e5a38c7dc18fd231092409b6 100755 (executable)
@@ -206,6 +206,10 @@ package_go_so() {
     local pkg="$1"; shift
     local description="$1"; shift
 
+    if [[ -n "$ONLY_BUILD" ]] && [[ "$pkg" != "$ONLY_BUILD" ]]; then
+      return 0
+    fi
+
     debug_echo "package_go_so $src_path as $pkg"
 
     calculate_go_package_version go_package_version $src_path