From 988556ef7cc69da923fb1472243f8ac71e329199 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Thu, 9 Feb 2023 16:56:54 +0800 Subject: [PATCH] =?UTF-8?q?[=20CI=20]=20=E6=9B=B4=E6=96=B0CI=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=20-=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-push-docker.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 2f1c60a..7e96d25 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -16,6 +16,8 @@ on: # manually run this workflow from the Actions tab workflow_dispatch: +env: + FORMAT_TIME: `date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"` jobs: build-and-deploy: @@ -132,12 +134,15 @@ jobs: echo "current date is $(date)" echo "start to copy target jar" - formatTime=$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")" + + echo "FORMAT TIME IS ${FORMAT_TIME}" + export formatTime=`date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"` echo "current format date is ${formatTime}" echo "write the version info to env" echo "AGENT_VERSION= ${formatTime}>> $GITHUB_ENV cp ./agent-*.jar ./octopus-agent-${formatTime}.jar + cp ./agent-*.jar ./octopus-agent-${{ env.AGENT_VERSION }}.jar cd /home/runner/work/ProjectOctopus/ProjectOctopus echo "--------------------------------------"