Skip to content

Commit

Permalink
Update command formats
Browse files Browse the repository at this point in the history
  • Loading branch information
sshrihar committed Aug 30, 2024
1 parent 77f32aa commit 6f7e9d1
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/deploy_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,25 @@ jobs:

- name: Determine architecture
run: |
ARCHITECTURE=$(uname -m)
if [[ "${{ steps.get_arch.outputs.cmd_result }}" =~ ^x86 ]]; then
echo "package_postfix=amd64.dev" >> $GITHUB_ENV
else
echo "package_postfix=arm64.dev" >> $GITHUB_ENV
fi
- name: Package install testnet
id: package_install_testnet
- name: Package install ${{ inputs.target }}
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
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 }}
"sudo rm -f miden-*",
"sudo systemctl stop miden-node",
"sudo systemctl stop miden-faucet",
"sudo apt remove miden-node miden-faucet -y",
"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"

- name: Download artifact
Expand All @@ -79,12 +77,12 @@ jobs:
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
dpkg -i miden-node-${{ inputs.tag }}-${{ env.package_postfix }}
dpkg -i miden-faucet-${{ inputs.tag }}-${{ env.package_postfix }}
"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"

- name: Configure environment
Expand All @@ -93,11 +91,11 @@ jobs:
with:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
sleep 10
sudo chown -R miden /opt/miden
sudo /usr/bin/miden-node init -c /etc/miden/miden-node.toml -g /opt/miden/miden-node/genesis.toml
sudo /usr/bin/miden-node make-genesis -i /opt/miden/miden-node/genesis.toml -o /opt/miden/miden-node/genesis.dat
sudo /usr/bin/miden-faucet init -c /opt/miden/miden-faucet/miden-faucet.toml
"sleep 10",
"sudo chown -R miden /opt/miden",
"sudo /usr/bin/miden-node init -c /etc/miden/miden-node.toml -g /opt/miden/miden-node/genesis.toml",
"sudo /usr/bin/miden-node make-genesis -i /opt/miden/miden-node/genesis.toml -o /opt/miden/miden-node/genesis.dat",
"sudo /usr/bin/miden-faucet init -c /opt/miden/miden-faucet/miden-faucet.toml"
- name: Start miden node service
Expand All @@ -106,15 +104,14 @@ jobs:
with:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
COMMAND_ID=$(aws ssm send-command \
sudo systemctl daemon-reload
sudo systemctl start miden-node
"sudo systemctl daemon-reload",
"sudo systemctl start miden-node"
- name: Start miden faucet service
id: start_miden_faucet_service
uses: ./.github/actions/ssm_execute
with:
instance_id: ${{ secrets[inputs.instance_id] }}
command: |
sudo systemctl daemon-reload
sudo systemctl start miden-faucet
"sudo systemctl daemon-reload",
"sudo systemctl start miden-faucet"

0 comments on commit 6f7e9d1

Please sign in to comment.