mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-01-29 12:59:44 +01:00
Compare commits
18 Commits
c22287f53b
...
0c4a91d7ae
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c4a91d7ae | |||
| 36cb83694c | |||
| f97cd105ba | |||
| 954d5b2dd7 | |||
| 73a68a0f1b | |||
| 4598caca89 | |||
| 4d22e77689 | |||
| c2a1a7d115 | |||
| 9a79910428 | |||
| bc69ff6223 | |||
| 4e610eea32 | |||
| 4e8c0ab3a0 | |||
| b057dfcce4 | |||
| ab15e7c8ea | |||
| 74269b0368 | |||
| 45c97d1791 | |||
| c341c2332f | |||
| d0f2cfc75f |
@@ -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
0
__init__.py
Normal 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="")
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user