[ github-action ] 新增Agent版本控制 - 2

This commit is contained in:
zeaslity
2023-02-08 15:38:48 +08:00
parent 99d519bb8c
commit f05775d1b4

View File

@@ -114,7 +114,6 @@ jobs:
# An explicit key for restoring and saving the cache # An explicit key for restoring and saving the cache
key: octopus-springboot-2.3.6 key: octopus-springboot-2.3.6
- name: Maven package project - name: Maven package project
run: | run: |
mvn -B -DskipTests=true install --file pom.xml mvn -B -DskipTests=true install --file pom.xml
@@ -129,11 +128,12 @@ jobs:
cd ./agent/target cd ./agent/target
ls ls
echo "start to change timezone to Asia/Shanghai" echo "start to change timezone to Asia/Shanghai"
# timedatectl set-timezone Asia/Shanghai && timedatectl set-ntp true
echo "current time is $(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")" echo "current format date is $(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")"
echo "current time is $(date)" echo "current date is $(date)"
echo "start to copy target jar" echo "start to copy target jar"
echo "write the version info to env"
echo "AGENT_VERSION=$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")" >> $GITHUB_ENV echo "AGENT_VERSION=$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")" >> $GITHUB_ENV
cp ./agent-*.jar ./octopus-agent-${{ env.AGENT_VERSION }}.jar cp ./agent-*.jar ./octopus-agent-${{ env.AGENT_VERSION }}.jar