Clean up #539
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: Clean up | |
on: | |
workflow_dispatch: | |
# push: | |
schedule: | |
- cron: '04 2 * * *' | |
jobs: | |
cleanup-artifactory: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Setup jFrog CLI' | |
uses: jfrog/setup-jfrog-cli@v4 | |
# env: | |
# JF_ENV_1: ${{ secrets.JF_ARTIFACTORY_TOKEN }} | |
- name: Update jfrog config | |
run: | | |
jfrog config add zowe --overwrite --interactive=false --artifactory-url=https://zowe.jfrog.io/zowe --user=${jfrog_username} --password=${jfrog_password} 1>/dev/null 2>/dev/null | |
env: | |
jfrog_username: ${{ secrets.ARTIFACTORY_X_USERNAME }} | |
jfrog_password: ${{ secrets.ARTIFACTORY_X_PASSWORD }} | |
- name: Cleanup nightly builds on Zowe Artifactory | |
run: | | |
cd artifactory-tools | |
./clean-nightly.sh -a zowe | |
- name: Cleanup snapshots on Zowe Artifactory | |
run: | | |
cd artifactory-tools | |
./clean-snapshots.sh -a zowe | |
cleanup-zos: | |
strategy: | |
matrix: | |
servers: | |
- {"name": "zzow06", "host": "SSH_MARIST_ACF2_HOST", "password": "SSH_MARIST_ACF2_PASSWORD"} | |
- {"name": "zzow07", "host": "SSH_MARIST_TSS_HOST", "password": "SSH_MARIST_TSS_PASSWORD"} | |
- {"name": "zzow08", "host": "SSH_MARIST_RACF_HOST", "password": "SSH_MARIST_RACF_PASSWORD"} | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cleanup ${{ matrix.servers.name }} | |
run: | | |
sshpass -p "${ssh_password}" scp -P ${ssh_port} -o StrictHostKeyChecking=no -o PubkeyAuthentication=no scripts/cleanup-zos.sh ${ssh_user}@${ssh_host}:/tmp/cleanup-zos.sh | |
sshpass -p "${ssh_password}" scp -P ${ssh_port} -o StrictHostKeyChecking=no -o PubkeyAuthentication=no scripts/compress.rexx ${ssh_user}@${ssh_host}:/tmp/compress.rexx | |
SSHPASS=${ssh_password} sshpass -e ssh -tt -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -p ${ssh_port} ${ssh_user}@${ssh_host} << EOF | |
cd /tmp && chmod +x cleanup-zos.sh && chmod +x compress.rexx && ./cleanup-zos.sh | |
echo "done" && exit 0 | |
EOF | |
env: | |
ssh_host: ${{ secrets[matrix.servers.host] }} | |
ssh_port: 65522 | |
ssh_user: ${{ secrets.SSH_MARIST_USERNAME }} | |
ssh_password: ${{ secrets[matrix.servers.password] }} | |
cleanup-loz: | |
strategy: | |
matrix: | |
servers: | |
- {"name": "loz-docker-1", "host": "ZLINUX_HOST", "user": "ZLINUX_SSH_USER", "key": "ZLINUX_SSH_KEY", "passphrase": "ZLINUX_SSH_PASSPHRASE"} | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cleanup ${{ matrix.servers.name }} | |
run: | | |
echo "${ssh_key}" > ~/ssh_key | |
chmod 700 ~/ssh_key | |
SSHPASS=${ssh_passphrase} sshpass -e -P 'passphrase for key' scp -P 22 -o StrictHostKeyChecking=no -o LogLevel=QUIET -i ~/ssh_key scripts/cleanup-zlinux.sh ${ssh_user}@${ssh_host}:/tmp/cleanup-zlinux.sh | |
SSHPASS=${ssh_passphrase} sshpass -e -P 'passphrase for key' ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET -p 22 -i ~/ssh_key ${ssh_user}@${ssh_host} << EOF | |
cd /tmp && chmod +x cleanup-zlinux.sh && ./cleanup-zlinux.sh | |
echo "done" && exit 0 | |
EOF | |
env: | |
ssh_host: ${{ secrets[matrix.servers.host] }} | |
ssh_port: 22 | |
ssh_user: ${{ secrets[matrix.servers.user] }} | |
ssh_key: ${{ secrets[matrix.servers.key] }} | |
ssh_passphrase: ${{ secrets[matrix.servers.passphrase] }} |