Compare commits

...

18 Commits

Author SHA1 Message Date
0c4a91d7ae build 2025-12-23 22:16:52 +01:00
36cb83694c Update .gitlab-ci.yml file 2025-12-23 22:16:34 +01:00
f97cd105ba build 2025-12-23 22:14:56 +01:00
954d5b2dd7 Update .gitlab-ci.yml file 2025-12-23 22:14:35 +01:00
73a68a0f1b build 2025-12-23 22:12:50 +01:00
4598caca89 Update .gitlab-ci.yml file 2025-12-23 22:12:23 +01:00
4d22e77689 build 2025-12-23 22:10:23 +01:00
c2a1a7d115 build 2025-12-23 22:08:48 +01:00
9a79910428 Update .gitlab-ci.yml file 2025-12-23 22:08:27 +01:00
bc69ff6223 build 2025-12-23 22:06:24 +01:00
4e610eea32 build 2025-12-23 22:00:09 +01:00
4e8c0ab3a0 build 2025-12-23 15:08:18 +01:00
b057dfcce4 build 2025-12-23 15:06:21 +01:00
ab15e7c8ea Update .gitlab-ci.yml file 2025-12-23 15:05:56 +01:00
74269b0368 build 2025-12-23 15:01:24 +01:00
45c97d1791 Update .gitlab-ci.yml file 2025-12-23 14:59:37 +01:00
c341c2332f build 2025-12-23 14:58:01 +01:00
d0f2cfc75f Update .gitlab-ci.yml file 2025-12-23 14:57:46 +01:00
4 changed files with 14 additions and 29 deletions

View File

@@ -1,20 +1,11 @@
stages: # List of stages for jobs, and their order of execution
# - notify_start
- lint
- build
- clean
- notify
variables:
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:
stage: lint
image: r.sectorq.eu/jaydee/builder-portainer:latest
@@ -32,19 +23,18 @@ lint:
build-job: # This job runs in the build stage, which runs first.
stage: build
image: r.sectorq.eu/jaydee/builder-portainer:latest
before_script:
- export PYTHONPATH=$PWD
script:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ls -la
- 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
- pip install uuid
#- pyinstaller --onefile --add-data "port.py:." portainer.py
- rm -rf build dist *.spec
- pyinstaller --onefile --clean portainer.py
#- 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.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:
paths:
- dist/
@@ -60,14 +50,12 @@ clean-job: # This job runs in the build stage, which runs first.
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
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:
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
notify_complete:
notify:
stage: notify # Should be in a later stage than the job that might fail
when: on_success # <-- This is the key keyword
script:
@@ -75,9 +63,7 @@ notify_complete:
- echo "${flow_id}"
- 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
rules:
- if: '$CI_COMMIT_MESSAGE =~ /build/'
notify_failed:
notify2:
stage: notify # Should be in a later stage than the job that might fail
when: on_failure # <-- This is the key keyword
script:
@@ -87,4 +73,3 @@ notify_failed:
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
rules:
- if: '$CI_COMMIT_MESSAGE =~ /build/'

0
__init__.py Normal file
View File

View File

@@ -955,7 +955,7 @@ class PortainerApi:
print(image)
if len(updates) > 0:
if pull:
self.gotify_message(f"Services updated: {", ".join(updates)}")
self.gotify_message(f"Services updated: {', '.join(updates)}")
else:
self.gotify_message(f"Services updates available: {', '.join(updates)}")
print("\033[?25h", end="")

View File

@@ -13,7 +13,7 @@ import json
import argparse
import hvac
from tabulate import tabulate
from portainer_api import PortainerApi
import port
from prompt_toolkit import prompt
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.shortcuts import checkboxlist_dialog
@@ -36,7 +36,7 @@ else:
raise Exception("Failed to authenticate with Vault")
# Specify the mount point of your KV engine
VERSION = "0.1.42"
VERSION = "0.1.50"
defaults = {
"endpoint_id": "vm01",
@@ -425,7 +425,7 @@ if __name__ == "__main__":
os.system("cls" if os.name == "nt" else "clear")
# Example: list endpoints
por = PortainerApi(cur_config["PORTAINER_SITE"], args)
por = port.PortainerApi(cur_config["PORTAINER_SITE"], args)
por.set_defaults(cur_config)
if args.debug:
por._debug = True