From 25399d649b9b5c52634f510992ffbae5cd583729 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 13 Sep 2023 10:29:20 -0400 Subject: [PATCH] add pid flag for vesions above 0.28.0; update release flow --- .github/workflows/release.yml | 17 ++++------------- CHANGELOG.md | 6 ++++++ nfhelp.sh | 15 ++++++++++----- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eba56e2..870746e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,22 +25,13 @@ jobs: run: tar -zcvf nfhelp.tar.gz nfhelp.sh - name: release - uses: actions/create-release@v1 + uses: ncipollo/release-action@v1 id: release with: draft: false prerelease: false - release_name: v${{ env.version }} - tag_name: v${{ env.version }} + tag: v${{ env.version }} + artifacts: nfhelp.tar.gz + artifactContentType: application/gzip env: GITHUB_TOKEN: ${{ github.token }} - - - name: Upload a Build Artifact for release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: nfhelp.tar.gz - asset_name: nfhelp.tar.gz - asset_content_type: application/gzip \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 290a8b0..bd739ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,3 +123,9 @@ All notable changes to this project will be documented in this file. The format - nfhelp commands - `diverter-enable` - updated diverter-enable command to restart the ziti-edge-router every time + +## [1.4.4] - 2023-09-13 + +### Fixed + +- Added pid flag to agent commands for version above 0.28.0. diff --git a/nfhelp.sh b/nfhelp.sh index 111a507..973db0c 100755 --- a/nfhelp.sh +++ b/nfhelp.sh @@ -116,6 +116,11 @@ print_binary_info() { LOG_COMMAND="ops log-format -a" STACK_COMMAND="agent" alias zt-router-version="${ZITI_CLI} --version 2> /dev/null | cut -d'v' -f 2" + if vercomp "0.28.0" "${ZITI_CLI_VERSION}"; then + PID_FLAG="-p" + else + PID_FLAG="" + fi else printf '\nCLI version: %s' "${ZITI_CLI_VERSION}" export ZITI_ROUTER="${ZITI_HOME}/ziti-router/ziti-router" @@ -279,10 +284,10 @@ create_aliases() { alias ziti="${ZITI_CLI}" alias zt-router-pid="systemctl show --property MainPID --value ziti-router" alias zt-router-logs="journalctl -u ziti-router -efo cat | ${ZITI_CLI} ${LOG_COMMAND}" - alias zt-router-cpu="export DATE=\$(date +"%y-%m-%d-%s") ;sudo -E ${ZITI_CLI} ${STACK_COMMAND} pprof-cpu \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-cpu-\$DATE.out; echo Created /tmp/ziti-router-cpu-\$DATE.out; unset DATE" - alias zt-router-stack="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} stack \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-stack-\$DATE.out; echo Created /tmp/ziti-router-stack-\$DATE.out; unset DATE" - alias zt-router-mem="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} memstats \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-mem-\$DATE.out; echo Created /tmp/ziti-router-mem-\$DATE.out; unset DATE" - alias zt-router-heap="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} pprof-heap \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-heap-\$DATE.out; echo Created /tmp/ziti-router-heap-\$DATE.out; unset DATE" + alias zt-router-cpu="export DATE=\$(date +"%y-%m-%d-%s") ;sudo -E ${ZITI_CLI} ${STACK_COMMAND} pprof-cpu ${PID_FLAG} \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-cpu-\$DATE.out; echo Created /tmp/ziti-router-cpu-\$DATE.out; unset DATE" + alias zt-router-stack="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} stack ${PID_FLAG} \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-stack-\$DATE.out; echo Created /tmp/ziti-router-stack-\$DATE.out; unset DATE" + alias zt-router-mem="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} memstats ${PID_FLAG} \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-mem-\$DATE.out; echo Created /tmp/ziti-router-mem-\$DATE.out; unset DATE" + alias zt-router-heap="export DATE=\$(date +"%y-%m-%d-%s") ;sudo ${ZITI_CLI} ${STACK_COMMAND} pprof-heap ${PID_FLAG} \$(systemctl show --property MainPID --value ziti-router) > /tmp/ziti-router-heap-\$DATE.out; echo Created /tmp/ziti-router-heap-\$DATE.out; unset DATE" alias zt-router-restart="sudo systemctl restart ziti-router" alias zt-router-start="sudo systemctl start ziti-router" alias zt-router-stop="sudo systemctl stop ziti-router" @@ -329,7 +334,7 @@ run_profile(){ # print version version(){ - echo "1.4.3" + echo "1.4.4" } ### Main