mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-01-29 04:49: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
|
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
|
||||||
@@ -32,19 +23,18 @@ 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
|
|
||||||
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
|
- pip install uuid
|
||||||
- pyinstaller --onefile --clean --hidden-import=portainer_api portainer.py
|
#- pyinstaller --onefile --add-data "port.py:." portainer.py
|
||||||
- strings dist/portainer | grep portainer_api || true
|
- rm -rf build dist *.spec
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.80.222:/myapps/bin/ || true
|
- 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.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/
|
||||||
@@ -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
|
- 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:
|
||||||
@@ -75,9 +63,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:
|
||||||
@@ -86,5 +72,4 @@ notify_failed:
|
|||||||
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl --data-raw 'message=portainer build job failed'
|
- curl -XPOST http://192.168.77.101:8123/api/webhook/voice-notifications-tC_8YKxMJIAaQRV5riKuC7Zl --data-raw 'message=portainer build job 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/'
|
||||||
|
|
||||||
0
__init__.py
Normal file
0
__init__.py
Normal file
@@ -955,7 +955,7 @@ class PortainerApi:
|
|||||||
print(image)
|
print(image)
|
||||||
if len(updates) > 0:
|
if len(updates) > 0:
|
||||||
if pull:
|
if pull:
|
||||||
self.gotify_message(f"Services updated: {", ".join(updates)}")
|
self.gotify_message(f"Services updated: {', '.join(updates)}")
|
||||||
else:
|
else:
|
||||||
self.gotify_message(f"Services updates available: {', '.join(updates)}")
|
self.gotify_message(f"Services updates available: {', '.join(updates)}")
|
||||||
print("\033[?25h", end="")
|
print("\033[?25h", end="")
|
||||||
@@ -13,7 +13,7 @@ import json
|
|||||||
import argparse
|
import argparse
|
||||||
import hvac
|
import hvac
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
from portainer_api import PortainerApi
|
import port
|
||||||
from prompt_toolkit import prompt
|
from prompt_toolkit import prompt
|
||||||
from prompt_toolkit.completion import WordCompleter
|
from prompt_toolkit.completion import WordCompleter
|
||||||
from prompt_toolkit.shortcuts import checkboxlist_dialog
|
from prompt_toolkit.shortcuts import checkboxlist_dialog
|
||||||
@@ -36,7 +36,7 @@ else:
|
|||||||
raise Exception("Failed to authenticate with Vault")
|
raise Exception("Failed to authenticate with Vault")
|
||||||
# Specify the mount point of your KV engine
|
# Specify the mount point of your KV engine
|
||||||
|
|
||||||
VERSION = "0.1.42"
|
VERSION = "0.1.50"
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
"endpoint_id": "vm01",
|
"endpoint_id": "vm01",
|
||||||
@@ -425,7 +425,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
os.system("cls" if os.name == "nt" else "clear")
|
os.system("cls" if os.name == "nt" else "clear")
|
||||||
# Example: list endpoints
|
# Example: list endpoints
|
||||||
por = PortainerApi(cur_config["PORTAINER_SITE"], args)
|
por = port.PortainerApi(cur_config["PORTAINER_SITE"], args)
|
||||||
por.set_defaults(cur_config)
|
por.set_defaults(cur_config)
|
||||||
if args.debug:
|
if args.debug:
|
||||||
por._debug = True
|
por._debug = True
|
||||||
|
|||||||
Reference in New Issue
Block a user