From 53764e0eb8d6a26bfdf255e921097035e6953b8b Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Thu, 6 Jun 2024 21:30:28 -0400 Subject: [PATCH] Cleaner deployment tag code --- .github/workflows/deploy.yml | 1 - deploy.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6a3ee91..1e296a5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 with: - fetch-depth: 0 fetch-tags: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/deploy.sh b/deploy.sh index d7449eb..5e2bcc3 100755 --- a/deploy.sh +++ b/deploy.sh @@ -8,15 +8,20 @@ export AWS_DEFAULT_REGION=us-east-1 export AWS_PAGER="" PRODUCTION=false +CI=false # Argument parsing # pass "-p" flag to deploy to production +# pass "-c" flag if deploying with CI while getopts "pc" opt; do case $opt in p) PRODUCTION=true ;; + c) + CI=true + ;; esac done @@ -44,6 +49,15 @@ if [[ -z "$DD_API_KEY" ]]; then exit 1 fi +# Fetch repository tags +# Run unshallow if deploying in CI + +if $CI; then + git fetch --unshallow --tags +else + git fetch --tags +fi + # Identify the version and commit of the current deploy GIT_VERSION=`git describe --tags --always` GIT_SHA=`git rev-parse HEAD`