Compare commits

..

No commits in common. "4e8789010858cd77fd5ecc45b9896340f8cfd6de" and "cff7cb02d418f8ede6fa2dff87810178077de312" have entirely different histories.

4 changed files with 12 additions and 36 deletions

View file

@ -1,28 +0,0 @@
set -x -e
echo "" > output.txt
process_output() {
if [ $? -eq 0 ]; then
head -n 5 output_tmp.txt >> output.txt
echo "... [See pipeline output for full details]" >> output.txt
tail -n 5 output_tmp.txt >> output.txt
else
cat output_tmp.txt >> output.txt
fi
}
echo "-- START Port attribution watcher --" | tee -a output.txt
python3 .ci/port_attribution_watcher.py | tee output_tmp.txt
process_output
echo "-- END Port attribution watcher --" | tee -a output.txt
echo "" >> output.txt
echo "-- START Traefik label watcher --" | tee -a output.txt
python3 .ci/traefik_label_watcher.py | tee output_tmp.txt
process_output
echo "-- END Traefik label watcher --" | tee -a output.txt

View file

@ -52,20 +52,25 @@ def main(watchFolder: str):
# Get exposed ports
exposedPorts = getExposedPortsFromDockerComposeFile(dockerComposeFile)
ports[dockerComposeFile] = exposedPorts
if len(exposedPorts) != 0:
if len(exposedPorts) == 0:
print(f"\n📦 {dockerComposeFile}"
f"\n🔗 Exposed ports: {exposedPorts}")
f"\n🔴 No exposed ports found"
f"\n")
else:
print(f"\n📦 {dockerComposeFile}"
f"\n🔗 Exposed ports: {exposedPorts}"
f"\n")
wrong = checkPortUnique(ports)
if wrong:
exit(1)
else:
print("\n✅ All ports are unique")
print("\n\n✅ All ports are unique\n\n")
exit(0)
if __name__ == "__main__":
print("Port Attribution Watcher")
print("Traefik label watcher CI/CD")
# Read folder from env
watchFolder = os.getenv("WATCH_FOLDER")
if watchFolder == None:

View file

@ -85,7 +85,7 @@ def main(watchFolder: str):
if wrong:
exit(1)
else:
print("\n\n✅ All routers are unique")
print("\n\n✅ All routers are unique\n\n")
exit(0)
if __name__ == "__main__":

View file

@ -3,7 +3,8 @@ steps:
image: python:3.12
commands:
- pip3 install -r .ci/requirements.txt
- ./.ci/gen_output.sh
- python3 .ci/port_attribution_watcher.py | tee output.txt
- python3 .ci/traefik_label_watcher.py | tee output.txt
comment:
image: git.gnous.eu/enpls/gitea-comment-plugin:1.1
settings:
@ -13,7 +14,6 @@ steps:
comment_file: output.txt
when:
status: [failure, success]
event: [pull_request]
lint:
image: debian:stable
commands:
@ -31,7 +31,6 @@ steps:
comment_file: output.txt
when:
status: [failure, success]
event: [pull_request]
when:
- event: [push, pull_request]
- evaluate: 'CI_COMMIT_AUTHOR in ["gnous-ci-bot", "mael", "ada"]'