Skip to content

Commit c232171

Browse files
committed
cicd: added mamonsu removal check
1 parent 82f10d3 commit c232171

File tree

4 files changed

+47
-9
lines changed

4 files changed

+47
-9
lines changed

.github/workflows/mamonsu-tests-dev.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
pg_version: ['10', '11', '12', '13', '14']
3030

3131
steps:
32-
- name: Checkout Mamonsu repo
32+
- name: Checkout mamonsu repo
3333
uses: actions/checkout@v1
3434

3535
- name: Install docker-compose
@@ -67,7 +67,7 @@ jobs:
6767
- name: Install prequisites
6868
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/tests.sh --os="${{ matrix.docker_os }}" --pg-version="${{ matrix.pg_version }}"
6969

70-
- name: Build and install Mamonsu
70+
- name: Build and install mamonsu
7171
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_build.sh --os="${{ matrix.docker_os }}" --pg-version="${{ matrix.pg_version }}"
7272

7373
- name: Test MAMONSU BOOTSTRAP
@@ -85,5 +85,8 @@ jobs:
8585
- name: Test MAMONSU ZABBIX CLI
8686
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/tools/zabbix_cli.sh --zbx-address="${{ steps.zabbix_address.outputs.zabbix_address }}" --zbx-version="${{ matrix.zabbix_version }}"
8787

88-
- name: Test Mamonsu metrics on master
88+
- name: Test mamonsu metrics on master
8989
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/metrics.sh --pg-version="${{ matrix.pg_version }}" --os="${{ matrix.docker_os }}"
90+
91+
- name: Test Mamonsu removal
92+
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}"

.github/workflows/mamonsu-tests-master.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
pg_version: '9.6'
3434

3535
steps:
36-
- name: Checkout Mamonsu repo
36+
- name: Checkout mamonsu repo
3737
uses: actions/checkout@v1
3838

3939
- name: Install docker-compose
@@ -71,7 +71,7 @@ jobs:
7171
- name: Install prequisites
7272
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/tests.sh --os="${{ matrix.docker_os }}" --pg-version="${{ matrix.pg_version }}"
7373

74-
- name: Build and install Mamonsu
74+
- name: Build and install mamonsu
7575
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_build.sh --os="${{ matrix.docker_os }}" --pg-version="${{ matrix.pg_version }}"
7676

7777
- name: Test MAMONSU BOOTSTRAP
@@ -89,5 +89,8 @@ jobs:
8989
- name: Test MAMONSU ZABBIX CLI
9090
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/tools/zabbix_cli.sh --zbx-address="${{ steps.zabbix_address.outputs.zabbix_address }}" --zbx-version="${{ matrix.zabbix_version }}"
9191

92-
- name: Test Mamonsu metrics on master
92+
- name: Test mamonsu metrics on master
9393
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/metrics.sh --pg-version="${{ matrix.pg_version }}" --os="${{ matrix.docker_os }}"
94+
95+
- name: Test Mamonsu removal
96+
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}"

github-actions-tests/mamonsu_build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ done
2323

2424
echo && echo
2525
echo "================================================================================================================="
26-
echo "---> Install Mamonsu latest"
26+
echo "---> Install mamonsu latest"
2727
echo && echo
2828

2929
# clean install mamonsu
@@ -45,7 +45,7 @@ if [ "${OS%:*}" = "centos" ]; then
4545
systemctl daemon-reload
4646
systemctl restart mamonsu
4747
sleep 5
48-
echo && echo && echo "Mamonsu version:"
48+
echo && echo && echo "mamonsu version:"
4949
mamonsu --version
5050
echo && echo
5151

@@ -67,7 +67,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
6767
cat /mamonsu/github-actions-tests/sources/agent_3.4.0.conf > /etc/mamonsu/agent.conf
6868
service mamonsu restart
6969
sleep 5
70-
echo && echo && echo "Mamonsu version:"
70+
echo && echo && echo "mamonsu version:"
7171
mamonsu --version
7272
echo && echo
7373

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
# default parameters:
4+
OS="centos:7"
5+
6+
for i in "$@"
7+
do
8+
case $i in
9+
--os=*)
10+
OS="${i#*=}"
11+
shift
12+
;;
13+
*)
14+
# unknown option
15+
;;
16+
esac
17+
done
18+
19+
echo && echo
20+
echo "================================================================================================================="
21+
echo "---> Remove mamonsu"
22+
echo && echo
23+
24+
if [ "${OS%:*}" = "centos" ]; then
25+
sudo yum erase mamonsu -y
26+
echo "---> mamonsu directories and files after removal:"
27+
sudo find / -name "mamonsu" 2>/dev/null
28+
elif [ "${OS%:*}" = "ubuntu" ]; then
29+
sudo apt-get purge mamonsu -y
30+
echo "---> mamonsu directories and files after removal:"
31+
sudo find / -name "mamonsu" 2>/dev/null
32+
fi

0 commit comments

Comments
 (0)