Skip to content

Commit

Permalink
Update stop services command without error
Browse files Browse the repository at this point in the history
  • Loading branch information
sshrihar committed Aug 30, 2024
1 parent 6be5815 commit c3a2b8d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
11 changes: 9 additions & 2 deletions .github/actions/ssm_execute/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
total_timeout:
description: "Total timeout for the command execution"
default: "1800"
ignore_errors:
default: "false"
description: "Whether to ignore errors during command execution"

outputs:
cmd_result:
Expand Down Expand Up @@ -63,8 +66,12 @@ runs:
echo "Command completed successfully."
break
elif [ "$STATUS" == "Failed" ] || [ "$STATUS" == "Cancelled" ]; then
echo "Command failed with status: $STATUS"
exit 1
if [ "${{ inputs.ignore_errors }}" == "true" ]; then
echo "Command failed but errors are ignored."
break
else
echo "Command failed with status: $STATUS"
exit 1
else
elapsed_time=$(( $(date +%s) - start_time ))
if [ "$elapsed_time" -gt "$timeout" ]; then
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/deploy_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,27 @@ jobs:
echo "package_postfix=arm64.dev" >> $GITHUB_ENV
fi
- name: Package install ${{ inputs.target }}
- name: Stop miden services
uses: ./.github/actions/ssm_execute
with:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
"sudo rm -f miden-*",
"sudo systemctl stop miden-node",
"sudo systemctl stop miden-faucet",
"sudo apt remove miden-node miden-faucet -y",
"sudo apt remove miden-node miden-faucet -y"
ignore_errors: true

- name: Package install testnet
uses: ./.github/actions/ssm_execute
with:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
"sudo rm -f miden-*",
"wget https://github.com/0xPolygonMiden/miden-node/releases/download/${{ inputs.tag }}/miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}",
"wget https://github.com/0xPolygonMiden/miden-node/releases/download/${{ inputs.tag }}/miden-node-${{ inputs.tag }}-${{ env.package_postfix }}",
"dpkg -i miden-node-${{ inputs.tag }}-${{ env.package_postfix }}",
"dpkg -i miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}"
if: ${{ inputs.target }} == "testnet"
if: ${{ inputs.target }} != "devnet"

- name: Download artifact
uses: actions/download-artifact@v3
Expand All @@ -78,9 +85,6 @@ jobs:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
"sudo rm -f miden-*",
"sudo systemctl stop miden-node",
"sudo systemctl stop miden-faucet",
"sudo apt remove miden-node miden-faucet -y",
"dpkg -i miden-node-${{ inputs.tag }}-${{ env.package_postfix }}",
"dpkg -i miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}"
if: ${{ inputs.target }} == "devnet"
Expand Down

0 comments on commit c3a2b8d

Please sign in to comment.