Wipe Mainnet #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wipe Mainnet | |
on: | |
workflow_dispatch: | |
jobs: | |
wipe_public_bootnode: | |
needs: | |
- wipe_validators | |
- wipe_archive_nodes | |
environment: mainnet | |
strategy: | |
matrix: | |
include: | |
- host_key: BOOT_NODE_1_HOST | |
user_key: BOOT_NODE_1_USER | |
- host_key: BOOT_NODE_2_HOST | |
user_key: BOOT_NODE_2_USER | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
touch ~/.ssh/known_hosts | |
ssh-keyscan ${{ secrets[matrix.host_key] }} >> ~/.ssh/known_hosts | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
eval $(ssh-agent) | |
- name: Prepare variables | |
run: | | |
echo "container_atleta=bootnode" >> mainnet/wipe/cleanup.env | |
echo "container_process_exporter=process-exporter" >> mainnet/wipe/cleanup.env | |
echo "container_promtail=promtail" >> mainnet/wipe/cleanup.env | |
- name: Copy files to the server | |
run: | | |
scp mainnet/wipe/cleanup.env ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/cleanup.env | |
scp mainnet/wipe/wipe.sh ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/wipe.sh | |
- name: Wipe bootnode | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets[matrix.host_key] }} | |
username: ${{ secrets[matrix.user_key] }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /tmp | |
./wipe.sh cleanup.env | |
rm -f cleanup.env wipe.sh | |
wipe_validators: | |
runs-on: ubuntu-latest | |
environment: mainnet | |
strategy: | |
matrix: | |
include: | |
- host_key: VALIDATOR_1_HOST | |
user_key: VALIDATOR_1_USER | |
- host_key: VALIDATOR_2_HOST | |
user_key: VALIDATOR_2_USER | |
- host_key: VALIDATOR_3_HOST | |
user_key: VALIDATOR_3_USER | |
- host_key: VALIDATOR_4_HOST | |
user_key: VALIDATOR_4_USER | |
- host_key: VALIDATOR_5_HOST | |
user_key: VALIDATOR_5_USER | |
- host_key: VALIDATOR_6_HOST | |
user_key: VALIDATOR_6_USER | |
- host_key: VALIDATOR_7_HOST | |
user_key: VALIDATOR_7_USER | |
- host_key: VALIDATOR_8_HOST | |
user_key: VALIDATOR_8_USER | |
- host_key: VALIDATOR_9_HOST | |
user_key: VALIDATOR_9_USER | |
- host_key: VALIDATOR_10_HOST | |
user_key: VALIDATOR_10_USER | |
- host_key: VALIDATOR_11_HOST | |
user_key: VALIDATOR_11_USER | |
- host_key: VALIDATOR_12_HOST | |
user_key: VALIDATOR_12_USER | |
#- host_key: VALIDATOR_13_HOST | |
# user_key: VALIDATOR_13_USER | |
- host_key: VALIDATOR_14_HOST | |
user_key: VALIDATOR_14_USER | |
- host_key: VALIDATOR_15_HOST | |
user_key: VALIDATOR_15_USER | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
touch ~/.ssh/known_hosts | |
ssh-keyscan ${{ secrets[matrix.host_key] }} >> ~/.ssh/known_hosts | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
eval $(ssh-agent) | |
- name: Prepare .env files | |
run: | | |
echo "container_atleta=validator" >> mainnet/wipe/cleanup.env | |
echo "container_process_exporter=process-exporter" >> mainnet/wipe/cleanup.env | |
echo "container_promtail=promtail" >> mainnet/wipe/cleanup.env | |
- name: Copy Files to Server | |
run: | | |
scp mainnet/wipe/cleanup.env ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/cleanup.env | |
scp mainnet/wipe/wipe.sh ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/wipe.sh | |
- name: SSH into Server and Wipe | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets[matrix.host_key] }} | |
username: ${{ secrets[matrix.user_key] }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /tmp | |
./wipe.sh cleanup.env | |
rm -f cleanup.env wipe.sh | |
wipe_archive_nodes: | |
runs-on: ubuntu-latest | |
environment: mainnet | |
strategy: | |
matrix: | |
include: | |
- host_key: ARCH_1_HOST | |
user_key: ARCH_1_USER | |
- host_key: ARCH_2_HOST | |
user_key: ARCH_2_USER | |
- host_key: ARCH_3_HOST | |
user_key: ARCH_3_USER | |
- host_key: ARCH_4_HOST | |
user_key: ARCH_4_USER | |
- host_key: ARCH_5_HOST | |
user_key: ARCH_5_USER | |
- host_key: ARCH_6_HOST | |
user_key: ARCH_6_USER | |
- host_key: ARCH_7_HOST | |
user_key: ARCH_7_USER | |
- host_key: ARCH_8_HOST | |
user_key: ARCH_8_USER | |
- host_key: ARCH_9_HOST | |
user_key: ARCH_9_USER | |
- host_key: ARCH_10_HOST | |
user_key: ARCH_10_USER | |
- host_key: ARCH_11_HOST | |
user_key: ARCH_11_USER | |
- host_key: ARCH_12_HOST | |
user_key: ARCH_12_USER | |
- host_key: ARCH_13_HOST | |
user_key: ARCH_13_USER | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
touch ~/.ssh/known_hosts | |
ssh-keyscan ${{ secrets[matrix.host_key] }} >> ~/.ssh/known_hosts | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
eval $(ssh-agent) | |
- name: Prepare .env files | |
run: | | |
echo "container_atleta=archiveive" >> mainnet/wipe/cleanup.env | |
echo "container_process_exporter=process-exporter" >> mainnet/wipe/cleanup.env | |
echo "container_promtail=promtail" >> mainnet/wipe/cleanup.env | |
- name: Copy Files to Server | |
run: | | |
scp mainnet/wipe/cleanup.env ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/cleanup.env | |
scp mainnet/wipe/wipe.sh ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/wipe.sh | |
- name: SSH into Server and Deploy | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets[matrix.host_key] }} | |
username: ${{ secrets[matrix.user_key] }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /tmp | |
./wipe.sh cleanup.env | |
rm -f cleanup.env wipe.sh |