Skip to content

Commit

Permalink
add pid flag for vesions above 0.28.0; update release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
emoscardini committed Sep 13, 2023
1 parent 539ed0b commit 25399d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
15 changes: 10 additions & 5 deletions nfhelp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -329,7 +334,7 @@ run_profile(){

# print version
version(){
echo "1.4.3"
echo "1.4.4"
}

### Main
Expand Down

0 comments on commit 25399d6

Please sign in to comment.