-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (76 loc) · 3.33 KB
/
cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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=${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 && ./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] }}