mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-01-29 04:49:44 +01:00
Update .gitlab-ci.yml file
This commit is contained in:
@@ -1,20 +1,11 @@
|
|||||||
|
|
||||||
stages: # List of stages for jobs, and their order of execution
|
stages: # List of stages for jobs, and their order of execution
|
||||||
# - notify_start
|
|
||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
- clean
|
- clean
|
||||||
- notify
|
- notify
|
||||||
variables:
|
variables:
|
||||||
GIT_SSH_COMMAND: "ssh -i /home/gitlab-runner/.ssh/id_rsa -o IdentitiesOnly=yes"
|
GIT_SSH_COMMAND: "ssh -i /home/gitlab-runner/.ssh/id_rsa -o IdentitiesOnly=yes"
|
||||||
# notify_start:
|
|
||||||
# stage: notify_start # Should be in a later stage than the job that might fail
|
|
||||||
# script:
|
|
||||||
# - column=':'
|
|
||||||
# - echo "${flow_id}"
|
|
||||||
# - curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl --data-raw 'message=portainer build job started'
|
|
||||||
# - rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
|
||||||
# rules:
|
|
||||||
# - if: '$CI_COMMIT_MESSAGE =~ /build/'
|
|
||||||
lint:
|
lint:
|
||||||
stage: lint
|
stage: lint
|
||||||
image: r.sectorq.eu/jaydee/builder-portainer:latest
|
image: r.sectorq.eu/jaydee/builder-portainer:latest
|
||||||
@@ -31,22 +22,16 @@ lint:
|
|||||||
- if: '$CI_COMMIT_MESSAGE =~ /lint/'
|
- if: '$CI_COMMIT_MESSAGE =~ /lint/'
|
||||||
build-job: # This job runs in the build stage, which runs first.
|
build-job: # This job runs in the build stage, which runs first.
|
||||||
stage: build
|
stage: build
|
||||||
# image: r.sectorq.eu/jaydee/builder-portainer:latest
|
image: r.sectorq.eu/jaydee/builder-portainer:latest
|
||||||
before_script:
|
|
||||||
- export PYTHONPATH=$PWD
|
|
||||||
- python3 -m pip install --break-system-packages flake8 black pylint tabulate prompt_toolkit hvac pyinstaller
|
|
||||||
script:
|
script:
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- ls -la
|
- pyinstaller --onefile portainer.py
|
||||||
- python3 -m pip install --break-system-packages flake8 black pylint tabulate prompt_toolkit hvac pyinstaller
|
#- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.80.222:/myapps/bin/ || true
|
||||||
- pyinstaller --onefile --clean --hidden-import=portainer_api portainer.py
|
|
||||||
- strings dist/portainer | grep portainer_api || true
|
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.80.222:/myapps/bin/ || true
|
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.12:/myapps/bin/ || true
|
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.12:/myapps/bin/ || true
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.101:/myapps/bin/ || true
|
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.101:/myapps/bin/ || true
|
||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.*
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- dist/
|
- dist/
|
||||||
@@ -62,14 +47,12 @@ clean-job: # This job runs in the build stage, which runs first.
|
|||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
rules:
|
rules:
|
||||||
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
||||||
|
|
||||||
cleanup_on_failure_job:
|
cleanup_on_failure_job:
|
||||||
stage: clean # Should be in a later stage than the job that might fail
|
stage: clean # Should be in a later stage than the job that might fail
|
||||||
when: on_failure # <-- This is the key keyword
|
when: on_failure # <-- This is the key keyword
|
||||||
script:
|
script:
|
||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
|
notify:
|
||||||
notify_complete:
|
|
||||||
stage: notify # Should be in a later stage than the job that might fail
|
stage: notify # Should be in a later stage than the job that might fail
|
||||||
when: on_success # <-- This is the key keyword
|
when: on_success # <-- This is the key keyword
|
||||||
script:
|
script:
|
||||||
@@ -77,9 +60,7 @@ notify_complete:
|
|||||||
- echo "${flow_id}"
|
- echo "${flow_id}"
|
||||||
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl --data-raw 'message=portainer build job completed'
|
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl --data-raw 'message=portainer build job completed'
|
||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
rules:
|
notify2:
|
||||||
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
|
||||||
notify_failed:
|
|
||||||
stage: notify # Should be in a later stage than the job that might fail
|
stage: notify # Should be in a later stage than the job that might fail
|
||||||
when: on_failure # <-- This is the key keyword
|
when: on_failure # <-- This is the key keyword
|
||||||
script:
|
script:
|
||||||
@@ -89,4 +70,3 @@ notify_failed:
|
|||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
rules:
|
rules:
|
||||||
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
- if: '$CI_COMMIT_MESSAGE =~ /build/'
|
||||||
|
|
||||||
Reference in New Issue
Block a user