Skip to content

Commit

Permalink
[ci] Prune image before deploy (#1694)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar authored May 16, 2024
1 parent a2b6846 commit d260938
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
chmod 600 private_key.pem
sudo apt update
sudo apt install -y --no-install-recommends openssh-server
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ steps.extract-version.outputs.tag-name }}' && docker run -d -v /data:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ steps.extract-version.outputs.tag-name }}' server start -n test --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --btc-network 2 --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"gcs\", \"config\": {\"bucket\": \"${{secrets.OPENDA_GCP_TESTNET_BUCKET}}\", \"credential\": \"${{secrets.OPENDA_GCP_TESTNET_CREDENTIAL}}\"}}}]}}'"
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ steps.extract-version.outputs.tag-name }}' && docker run -d -v /data:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ steps.extract-version.outputs.tag-name }}' server start -n test --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --btc-network 2 --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"gcs\", \"config\": {\"bucket\": \"${{secrets.OPENDA_GCP_TESTNET_BUCKET}}\", \"credential\": \"${{secrets.OPENDA_GCP_TESTNET_CREDENTIAL}}\"}}}]}}'"
2 changes: 1 addition & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ jobs:
chmod 600 private_key.pem
sudo apt update
sudo apt install -y --no-install-recommends openssh-server
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }}' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }} server clean -n dev && docker run -d -v /root:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }}' server start -n dev --eth-rpc-url https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --btc-network 2 --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}'"
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a && docker ps | grep rooch | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep rooch | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }}' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }} server clean -n dev && docker run -d -v /root:/root -p 50051:50051 'ghcr.io/rooch-network/rooch:${{ steps.docker_meta.outputs.version }}' server start -n dev --eth-rpc-url https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --btc-rpc-url '${{secrets.BTC_TEST_RPC_URL}}' --btc-rpc-username rooch-test --btc-rpc-password '${{secrets.BTC_TEST_RPC_PWD}}' --btc-network 2 --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}'"
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "cd /root/rooch && git pull origin main && bash scripts/check_dev_deploy_status.sh ${{ steps.docker_meta.outputs.version }} '${{ secrets.DEV_MNEMONIC_PHRASE }}'"

0 comments on commit d260938

Please sign in to comment.