From 8cdacdeebfd9c956fda7ca85792ca9613e736449 Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Fri, 20 Oct 2023 16:38:52 -0600
Subject: [PATCH] tweak the pipeline

---
 apps/cli/executables/pexable/null/null/null.py | 2 ++
 ci/push-package.template.yml                   | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/apps/cli/executables/pexable/null/null/null.py b/apps/cli/executables/pexable/null/null/null.py
index 6c06a5489..6337eff7e 100644
--- a/apps/cli/executables/pexable/null/null/null.py
+++ b/apps/cli/executables/pexable/null/null/null.py
@@ -17,6 +17,7 @@
 # along with Workspaces.  If not, see <https://www.gnu.org/licenses/>.
 
 import argparse
+import importlib.metadata
 import logging
 import os
 import random
@@ -136,6 +137,7 @@ def make_arg_parser() -> argparse.ArgumentParser:
         description=_DESCRIPTION.format(version),
         formatter_class=argparse.RawTextHelpFormatter,
     )
+    parser.add_argument("--version", action="version", version=importlib.metadata.version("ssa-null"))
     options = parser.add_argument_group("options", "settings for altering program behavior")
     options.add_argument(
         "-v",
diff --git a/ci/push-package.template.yml b/ci/push-package.template.yml
index ae6aed916..bdf49d21a 100644
--- a/ci/push-package.template.yml
+++ b/ci/push-package.template.yml
@@ -14,32 +14,37 @@
       - ln -s "$(which python3)" /home/ssa/bin/python3.10
       - export PATH=$PATH:/home/ssa/bin
       - pip install pex
-      - pex ${PIP_NAME} -c ${PACKAGE_NAME} -o ./${PACKAGE_NAME} -i https://gitlab.nrao.edu/api/v4/projects/621/packages/pypi/simple --python-shebang /home/ssa/bin/python3.10 --disable-cache
+      - pex ${PEX_SOURCE} -c ${PACKAGE_NAME} -o ./${PACKAGE_NAME} -i https://gitlab.nrao.edu/api/v4/projects/621/packages/pypi/simple --python-shebang /home/ssa/bin/python3.10 --disable-cache
       - echo "Releasing PEX to sbin area - ${PACKAGE_NAME}"
       - scp ${PACKAGE_NAME} root@shipman.aoc.nrao.edu:/lustre/aoc/cluster/pipeline/dsoc-${DEPLOY_ENV}/workspaces/sbin/
     rules:
       - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9]\.[0-9]|^[0-9]\.[0-9]\.[0-9])-DEVELOPMENT/'
         variables:
           DEPLOY_ENV: "dev"
+          PEX_SOURCE: ${PIP_NAME}
         changes:
           - apps/cli/executables/pexable/${PACKAGE_NAME}/**/*
       - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
         variables:
           DEPLOY_ENV: "dev"
+          PEX_SOURCE: ${PIP_NAME}==2.8.2rc1
         changes:
           - apps/cli/executables/pexable/${PACKAGE_NAME}/**/*
       - if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/'
         variables:
           DEPLOY_ENV: "test"
+          PEX_SOURCE: ${PIP_NAME}
         changes:
           - apps/cli/executables/pexable/${PACKAGE_NAME}/**/*
       - if: '$CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+/'
         variables:
           DEPLOY_ENV: "test"
+          PEX_SOURCE: ${PIP_NAME}==$CI_COMMIT_TAG
         changes:
           - apps/cli/executables/pexable/${PACKAGE_NAME}/**/*
       - if: '$CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+$/'
         variables:
           DEPLOY_ENV: "prod"
+          PEX_SOURCE: ${PIP_NAME}==${CI_COMMIT_TAG}
         changes:
           - apps/cli/executables/pexable/${PACKAGE_NAME}/**/*
-- 
GitLab