Skip to content

Commit

Permalink
build: update clean shells on metwork-framework.org
Browse files Browse the repository at this point in the history
  • Loading branch information
thebaptiste committed Jan 24, 2024
1 parent e9350a1 commit 7e07fcc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions clean_buildcache.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

find /home/buildcache -type f -atime +30 -exec rm -f {} \; >/dev/null 2>&1
chown -RL metworkpub:metworkpub /home/buildcache
chmod -R 755 /home/buildcache
find /buildcache -type f -mtime +7 -exec rm -f {} \; >/dev/null 2>&1
chown -RL metworkpub:metworkpub /buildcache
chmod -R 755 /buildcache
20 changes: 10 additions & 10 deletions clean_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ for BRANCH in ${BRANCHES}; do
fi
for OS in centos6 centos7 centos8; do
DELETED=0
for MODULE in mfext mfext-full mfext-${BRANCH_SHORT} mfcom mfadmin mfadmin-full mfadmin-${BRANCH_SHORT} mfadmin-layer-logs-${BRANCH_SHORT} mfadmin-layer-logs_loki-${BRANCH_SHORT} mfadmin-layer-metrics-${BRANCH_SHORT} mfbase mfbase-full mfbase-${BRANCH_SHORT} mfdata mfdata-full mfdata-${BRANCH_SHORT} mfserv mfserv-full mfserv-${BRANCH_SHORT} mfserv-layer-nodejs-${BRANCH_SHORT} mfsysmon mfsysmon-full mfsysmon-${BRANCH_SHORT} mfbus mfbus-full mfbus-${BRANCH_SHORT} mfext-layer-devtools-${BRANCH_SHORT} mfext-layer-java-${BRANCH_SHORT} mfext-layer-monitoring-${BRANCH_SHORT} mfext-layer-nodejs-${BRANCH_SHORT} mfext-layer-openresty-${BRANCH_SHORT} mfext-layer-python3_devtools-${BRANCH_SHORT} mfext-layer-python3_scientific_core-${BRANCH_SHORT} mfext-layer-scientific_core-${BRANCH_SHORT} mfext-layer-tcltk-${BRANCH_SHORT} mfext-layer-mapserver-${BRANCH_SHORT} mfext-layer-python3_mapserverapi-${BRANCH_SHORT} mfext-layer-python2_mapserverapi-${BRANCH_SHORT} mfext-layer-scientific-${BRANCH_SHORT} mfext-layer-python3_scientific-${BRANCH_SHORT} mfext-layer-python2_scientific-${BRANCH_SHORT} mfext-layer-python3_vim-${BRANCH_SHORT} mfext-layer-python2_vim-${BRANCH_SHORT} mfext-layer-vim-${BRANCH_SHORT} mfext-layer-python3_ia-${BRANCH_SHORT} mfext-layer-python2-${BRANCH_SHORT} mfext-layer-python2_core-${BRANCH_SHORT} mfext-layer-python2_devtools-${BRANCH_SHORT} mfext-layer-scientific_system_libraries-${BRANCH_SHORT} mfext-layer-php-${BRANCH_SHORT} mfext-layer-rabbitmq_system_libraries-${BRANCH_SHORT} mfext-layer-rabbitmq-${BRANCH_SHORT} mfext-layer-scientific_system_libraries-${BRANCH_SHORT}; do
for MODULE in mfext mfext-full mfext-${BRANCH_SHORT} mfcom mfadmin mfadmin-full mfadmin-${BRANCH_SHORT} mfadmin-layer-logs-${BRANCH_SHORT} mfadmin-layer-logs_loki-${BRANCH_SHORT} mfadmin-layer-metrics-${BRANCH_SHORT} mfbase mfbase-full mfbase-${BRANCH_SHORT} mfdata mfdata-full mfdata-${BRANCH_SHORT} mfserv mfserv-full mfserv-${BRANCH_SHORT} mfserv-layer-nodejs-${BRANCH_SHORT} mfsysmon mfsysmon-full mfsysmon-${BRANCH_SHORT} mfbus mfbus-full mfbus-${BRANCH_SHORT} mfext-layer-devtools-${BRANCH_SHORT} mfext-layer-java-${BRANCH_SHORT} mfext-layer-monitoring-${BRANCH_SHORT} mfext-layer-nodejs-${BRANCH_SHORT} mfext-layer-openresty-${BRANCH_SHORT} mfext-layer-python3_devtools-${BRANCH_SHORT} mfext-layer-python3_scientific_core-${BRANCH_SHORT} mfext-layer-scientific_core-${BRANCH_SHORT} mfext-layer-tcltk-${BRANCH_SHORT} mfext-layer-mapserver-${BRANCH_SHORT} mfext-layer-python3_mapserverapi-${BRANCH_SHORT} mfext-layer-python2_mapserverapi-${BRANCH_SHORT} mfext-layer-scientific-${BRANCH_SHORT} mfext-layer-python3_scientific-${BRANCH_SHORT} mfext-layer-python2_scientific-${BRANCH_SHORT} mfext-layer-python3_vim-${BRANCH_SHORT} mfext-layer-python2_vim-${BRANCH_SHORT} mfext-layer-vim-${BRANCH_SHORT} mfext-layer-python3_ia-${BRANCH_SHORT} mfext-layer-python2-${BRANCH_SHORT} mfext-layer-python2_core-${BRANCH_SHORT} mfext-layer-python2_devtools-${BRANCH_SHORT} mfext-layer-scientific_system_libraries-${BRANCH_SHORT} mfext-layer-php-${BRANCH_SHORT} mfext-layer-rabbitmq_system_libraries-${BRANCH_SHORT} mfext-layer-rabbitmq-${BRANCH_SHORT} mfext-layer-scientific_system_libraries-${BRANCH_SHORT} mfext-layer-radartools-${BRANCH_SHORT} mfext-layer-python3_radartools-${BRANCH_SHORT} mfext-layer-elasticsearch-${BRANCH_SHORT} mfext-layer-soprano-${BRANCH_SHORT}; do
echo "- Searching for ${BRANCH}/${OS}/${MODULE}/..."
# We only keep rpms of the 3 last ci
for N in `find /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci*.rpm" 2>/dev/null |xargs -r -n 1 basename |grep '\.ci[0-9][0-9]*\.' |sed 's/^.*\.\(ci[0-9][0-9]*\)\..*$/\1/g' |sed 's/ci//g' |sort -rn |uniq |awk 'NR>3'`; do
# We only keep rpms of the 2 last ci
for N in `find /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci*.rpm" 2>/dev/null |xargs -r -n 1 basename |grep '\.ci[0-9][0-9]*\.' |sed 's/^.*\.\(ci[0-9][0-9]*\)\..*$/\1/g' |sed 's/ci//g' |sort -rn |uniq |awk 'NR>2'`; do
echo " => deleting /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*.rpm"
rm -f /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*.rpm
DELETED=1
done
# For each kept ci, we only keep rpms of the 3 last builds
# For each kept ci, we only keep rpms of the 2 last builds
for N in `find /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci*.rpm" 2>/dev/null |xargs -r -n 1 basename |grep '\.ci[0-9][0-9]*\.' |sed 's/^.*\.\(ci[0-9][0-9]*\)\..*$/\1/g' |sed 's/ci//g' |sort -rn |uniq`; do
for M in `find /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci${N}*.rpm" 2>/dev/null |xargs -r -n 1 basename | awk -F "-" '{ print $NF }' | awk -F "." '{ print $1 }' | sort -rn | uniq |awk 'NR>3'`; do
echo " => deleting /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}.gen.x86_64.rpm"
rm -f /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}.gen.x86_64.rpm
for M in `find /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci${N}*.rpm" 2>/dev/null |xargs -r -n 1 basename | awk -F "-" '{ print $NF }' | awk -F "." '{ print $1 }' | sort -rn | uniq |awk 'NR>2'`; do
echo " => deleting /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}*.x86_64.rpm"
rm -f /pub/metwork/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}*.x86_64.rpm
DELETED=1
done
done
Expand Down Expand Up @@ -69,7 +69,7 @@ for BRANCH in ${BRANCHES}; do
fi
for OS in centos6 centos7 centos8; do
DELETED=0
for MODULE in mfext-layer-python2_radartools-${BRANCH_SHORT} mfext-layer-python3_radartools-${BRANCH_SHORT} mfext-layer-radartools-${BRANCH_SHORT} soprano-${BRANCH_SHORT} mfext-layer-elasticsearch-${BRANCH_SHORT}; do
for MODULE in mfext-layer-python2_radartools-${BRANCH_SHORT} mfext-layer-python3_radartools-${BRANCH_SHORT} mfext-layer-radartools-${BRANCH_SHORT} mfext-layer-soprano-${BRANCH_SHORT} mfext-layer-elasticsearch-${BRANCH_SHORT}; do
echo "- Searching for ${BRANCH}/${OS}/${MODULE}/..."
# We only keep rpms of the 3 last ci
for N in `find /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci*.rpm" 2>/dev/null |xargs -r -n 1 basename |grep '\.ci[0-9][0-9]*\.' |sed 's/^.*\.\(ci[0-9][0-9]*\)\..*$/\1/g' |sed 's/ci//g' |sort -rn |uniq |awk 'NR>3'`; do
Expand All @@ -80,8 +80,8 @@ for BRANCH in ${BRANCHES}; do
# For each kept ci, we only keep rpms of the 3 last builds
for N in `find /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci*.rpm" 2>/dev/null |xargs -r -n 1 basename |grep '\.ci[0-9][0-9]*\.' |sed 's/^.*\.\(ci[0-9][0-9]*\)\..*$/\1/g' |sed 's/ci//g' |sort -rn |uniq`; do
for M in `find /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS} -type f -name "metwork-${MODULE}-${BRANCH_SHORT}.ci${N}*.rpm" 2>/dev/null |xargs -r -n 1 basename | awk -F "-" '{ print $NF }' | awk -F "." '{ print $1 }' | sort -rn | uniq |awk 'NR>3'`; do
echo " => deleting /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}.gen.x86_64.rpm"
rm -f /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}.gen.x86_64.rpm
echo " => deleting /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}*.x86_64.rpm"
rm -f /private/metwork_addons/continuous_integration/rpms/${BRANCH}/${OS}/metwork-${MODULE}-${BRANCH_SHORT}.ci${N}.*-${M}*.x86_64.rpm
DELETED=1
done
done
Expand Down
5 changes: 5 additions & 0 deletions clean_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

/bin/echo "docker size before clean " `/bin/du -sh /var/lib/docker`
/bin/echo y | /bin/docker system prune
/bin/echo "docker size after clean " `/bin/du -sh /var/lib/docker`

0 comments on commit 7e07fcc

Please sign in to comment.