mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2025-12-14 18:44:53 +01:00
66 lines
2.4 KiB
YAML
66 lines
2.4 KiB
YAML
stages: # List of stages for jobs, and their order of execution
|
|
- lint
|
|
- build
|
|
- clean
|
|
- notify
|
|
|
|
lint:
|
|
stage: lint
|
|
image: python:3.12
|
|
before_script:
|
|
- python3 -m pip install --break-system-packages flake8 black pylint tabulate prompt_toolkit
|
|
- export PATH="$PATH:/home/gitlab-runner/.local/bin"
|
|
# - echo "PATH is now: $PATH"
|
|
script:
|
|
- flake8 .
|
|
- black --check .
|
|
- pylint portainer.py
|
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
|
rules:
|
|
- if: '$CI_COMMIT_MESSAGE =~ /lint/'
|
|
build-job: # This job runs in the build stage, which runs first.
|
|
stage: build
|
|
script:
|
|
- python3 -m venv venv
|
|
- source venv/bin/activate
|
|
- pip install pyinstaller requests tabulate gitpython prompt_toolkit
|
|
- pyinstaller --onefile portainer.py
|
|
- scp dist/portainer jd@morefine.home.lan:/myapps/bin/
|
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
|
artifacts:
|
|
paths:
|
|
- dist/
|
|
expire_in: 1 week
|
|
# - column=":"
|
|
# - echo "${flow_id}"
|
|
# - curl -X POST https://kestra.sectorq.eu/api/v1/executions/webhook/jaydee/ansible-all/${flow_id} -d '{"tag":["proxmox"],"target":["servers"]}' -H "Content-Type${column} application/json"
|
|
rules:
|
|
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
|
clean-job: # This job runs in the build stage, which runs first.
|
|
stage: clean
|
|
script:
|
|
- ls -la /home/gitlab-runner/builds/*
|
|
rules:
|
|
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
|
cleanup_on_failure_job:
|
|
stage: clean # Should be in a later stage than the job that might fail
|
|
when: on_failure # <-- This is the key keyword
|
|
script:
|
|
- ls -la /home/gitlab-runner/builds/*
|
|
|
|
notify:
|
|
stage: notify # Should be in a later stage than the job that might fail
|
|
when: on_success # <-- This is the key keyword
|
|
script:
|
|
- column=":"
|
|
- echo "${flow_id}"
|
|
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl?message=${column}build job completed${column}
|
|
|
|
notify2:
|
|
stage: notify # Should be in a later stage than the job that might fail
|
|
when: on_failure # <-- This is the key keyword
|
|
script:
|
|
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl?message=${column}build job failed${column}
|
|
rules:
|
|
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
|
|