From 4a72e8bab62d15592e0c9128974396012db692b3 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 8 May 2024 17:25:31 +0300 Subject: [PATCH 01/85] python project complated --- polybot/app.py | 27 ----- polybot/bot.py | 225 +++++++++++++++++++++++------------ polybot/img_proc.py | 248 +++++++++++++++++++++++++++++---------- polybot/requirements.txt | 5 - requirements.txt | 64 ++++++++++ 5 files changed, 401 insertions(+), 168 deletions(-) delete mode 100644 polybot/app.py delete mode 100644 polybot/requirements.txt create mode 100644 requirements.txt diff --git a/polybot/app.py b/polybot/app.py deleted file mode 100644 index e88600d1..00000000 --- a/polybot/app.py +++ /dev/null @@ -1,27 +0,0 @@ -import flask -from flask import request -import os -from bot import Bot, QuoteBot, ImageProcessingBot - -app = flask.Flask(__name__) - -TELEGRAM_TOKEN = os.environ['TELEGRAM_TOKEN'] -TELEGRAM_APP_URL = os.environ['TELEGRAM_APP_URL'] - - -@app.route('/', methods=['GET']) -def index(): - return 'Ok' - - -@app.route(f'/{TELEGRAM_TOKEN}/', methods=['POST']) -def webhook(): - req = request.get_json() - bot.handle_message(req['message']) - return 'Ok' - - -if __name__ == "__main__": - bot = ImageProcessingBot(TELEGRAM_TOKEN, TELEGRAM_APP_URL) - - app.run(host='0.0.0.0', port=8443) diff --git a/polybot/bot.py b/polybot/bot.py index 7fea847b..7200dba8 100644 --- a/polybot/bot.py +++ b/polybot/bot.py @@ -1,78 +1,153 @@ import telebot -from loguru import logger -import os -import time -from telebot.types import InputFile +import cv2 from polybot.img_proc import Img +from dotenv import load_dotenv +import os - -class Bot: - - def __init__(self, token, telegram_chat_url): - # create a new instance of the TeleBot class. - # all communication with Telegram servers are done using self.telegram_bot_client - self.telegram_bot_client = telebot.TeleBot(token) - - # remove any existing webhooks configured in Telegram servers - self.telegram_bot_client.remove_webhook() - time.sleep(0.5) - - # set the webhook URL - self.telegram_bot_client.set_webhook(url=f'{telegram_chat_url}/{token}/', timeout=60) - - logger.info(f'Telegram Bot information\n\n{self.telegram_bot_client.get_me()}') - - def send_text(self, chat_id, text): - self.telegram_bot_client.send_message(chat_id, text) - - def send_text_with_quote(self, chat_id, text, quoted_msg_id): - self.telegram_bot_client.send_message(chat_id, text, reply_to_message_id=quoted_msg_id) - - def is_current_msg_photo(self, msg): - return 'photo' in msg - - def download_user_photo(self, msg): - """ - Downloads the photos that sent to the Bot to `photos` directory (should be existed) - :return: - """ - if not self.is_current_msg_photo(msg): - raise RuntimeError(f'Message content of type \'photo\' expected') - - file_info = self.telegram_bot_client.get_file(msg['photo'][-1]['file_id']) - data = self.telegram_bot_client.download_file(file_info.file_path) - folder_name = file_info.file_path.split('/')[0] - - if not os.path.exists(folder_name): - os.makedirs(folder_name) - - with open(file_info.file_path, 'wb') as photo: - photo.write(data) - - return file_info.file_path - - def send_photo(self, chat_id, img_path): - if not os.path.exists(img_path): - raise RuntimeError("Image path doesn't exist") - - self.telegram_bot_client.send_photo( - chat_id, - InputFile(img_path) - ) - - def handle_message(self, msg): - """Bot Main message handler""" - logger.info(f'Incoming message: {msg}') - self.send_text(msg['chat']['id'], f'Your original message: {msg["text"]}') - - -class QuoteBot(Bot): - def handle_message(self, msg): - logger.info(f'Incoming message: {msg}') - - if msg["text"] != 'Please don\'t quote me': - self.send_text_with_quote(msg['chat']['id'], msg["text"], quoted_msg_id=msg["message_id"]) - - -class ImageProcessingBot(Bot): - pass +# load environment variables +load_dotenv() +TELEGRAM_TOKEN = os.getenv('TELEGRAM_TOKEN') + +# Check if TELEGRAM_TOKEN is not none +if TELEGRAM_TOKEN is None: + print("Error: TELEGRAM_TOKEN is not set in the .env file.") + exit(1) + +# initialize telegram-bot +bot = telebot.TeleBot(TELEGRAM_TOKEN) + +# Dictionary to store images temporarily +user_images = {} + +# handler for the /start command +@bot.message_handler(commands=['start']) +def handle_start(message): + bot.send_message(message.chat.id, "Hello!\n\n Send me an image then choose a filter , options:\n" + "- Blur: Apply a blur to the image to reduce noise and detail.\n" + "- Rotate: turning the image upside down.\n" + "- Salt and Pepper: Adds random bright and dark pixels to an image.\n" + "- Segment: Divides an image into parts based on color.\n" + "- Grayscale: Converts the image to grayscale.\n" + "- Sharpen: Enhances the edges and details in the image.\n" + "- Emboss: Creates a raised effect by highlighting the edges.\n" + "- Invert Colors: Inverts the colors of the image.\n" + "- Oil Painting: Applies an oil painting-like effect to the image.\n" + "- Cartoonize: Creates a cartoon-like version of the image.\n") + +# handler for receiving photos +@bot.message_handler(content_types=['photo']) +def handle_image(message): + try: + print("Received a photo message") + # get the photo file id + file_id = message.photo[-1].file_id + # get the file object using the file id + file_info = bot.get_file(file_id) + # download the file + downloaded_file = bot.download_file(file_info.file_path) + + # save the file temporarily with a unique name based on the file id + image_path = f"images/{file_id}.jpg" + with open(image_path, 'wb') as new_file: + new_file.write(downloaded_file) + + # check if this is the first img or the second img for concat + if message.chat.id in user_images: + print("User already has an image in memory") + if 'concat_pending' in user_images[message.chat.id]: + print("This is the second image for concatenation") + # this is the second image for concat + second_image_path = image_path + first_image_path = user_images[message.chat.id]['concat_pending'] + del user_images[message.chat.id]['concat_pending'] # remove the pending to free it to next pending + + # load the images + first_image_data = cv2.imread(first_image_path) + second_image_data = cv2.imread(second_image_path) + + # concat the imges + img_processor = Img(first_image_path) + concatenated_image = img_processor.concat(second_image_data) + if concatenated_image is not None: + print("Concatenation successful") + # save and send the concat img + processed_image_path = img_processor.save_image(concatenated_image, suffix='_concatenated') + with open(processed_image_path, 'rb') as photo_file: + bot.send_photo(message.chat.id, photo_file) + else: + print("Error concatenating images.") + bot.reply_to(message, "Error concatenating images.") + + # clear user history + del user_images[message.chat.id] + else: + # this is the first img + print("This is the first image for concatenation") + user_images[message.chat.id]['concat_pending'] = image_path + bot.reply_to(message, "First image saved successfully! Now please send the second image to concatenate with.") + else: + # this is the first img + print("This is the first image received") + user_images[message.chat.id] = {'concat_pending': image_path} + bot.reply_to(message, "First image saved successfully! To apply the concatenation filter, please send another image or choose a filter from the list at the top of the page to apply a filter.") + except Exception as e: + print(f"Error handling image: {e}") + bot.reply_to(message, f"Error handling image: {e}") + +# handler for filter selection +@bot.message_handler(func=lambda message: message.text.lower() in ['blur', 'rotate', 'salt and pepper', 'segment','grayscale','sharpen','emboss','invert colors','oil painting','cartoonize']) +def handle_filter(message): + try: + # Check if the user has previously sent an image + if message.chat.id in user_images: + # Get the image path + if 'concat_pending' in user_images[message.chat.id]: + image_path = user_images[message.chat.id]['concat_pending'] + else: + image_path = user_images[message.chat.id]['first_image'] + + # apply the selected filter + img_processor = Img(image_path) + filter_name = message.text.lower() + + if filter_name == 'blur': + processed_image = img_processor.blur() + elif filter_name == 'rotate': + processed_image = img_processor.rotate() + elif filter_name == 'salt and pepper': + processed_image = img_processor.salt_n_pepper() + elif filter_name == 'segment': + processed_image = img_processor.segment() + elif filter_name == 'grayscale': + processed_image = img_processor.grayscale() + elif filter_name == 'sharpen': + processed_image = img_processor.sharpen() + elif filter_name == 'emboss': + processed_image = img_processor.emboss() + elif filter_name == 'invert colors': + processed_image = img_processor.invert_colors() + elif filter_name == 'oil painting': + processed_image = img_processor.oil_painting() + elif filter_name == 'cartoonize': + processed_image = img_processor.cartoonize() + else: + processed_image = None + + # check if the filter was applied successfully + if processed_image is not None: + # save and send the processed image + processed_image_path = img_processor.save_image(processed_image, suffix=f'_{filter_name.replace(" ", "_")}') + with open(processed_image_path, 'rb') as photo_file: + bot.send_photo(message.chat.id, photo_file) + else: + bot.reply_to(message, f"Error applying {filter_name} filter: Result is None.") + + # remove the image path from the dict + del user_images[message.chat.id] + else: + bot.reply_to(message, "Please send an image first.") + except Exception as e: + bot.reply_to(message, f"Error processing image: {e}") + + +bot.polling() \ No newline at end of file diff --git a/polybot/img_proc.py b/polybot/img_proc.py index 137ca70d..cb7005c5 100644 --- a/polybot/img_proc.py +++ b/polybot/img_proc.py @@ -1,67 +1,193 @@ -from pathlib import Path -from matplotlib.image import imread, imsave - - -def rgb2gray(rgb): - r, g, b = rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2] - gray = 0.2989 * r + 0.5870 * g + 0.1140 * b - return gray - +import os +import cv2 +import numpy as np class Img: - - def __init__(self, path): - """ - Do not change the constructor implementation - """ - self.path = Path(path) - self.data = rgb2gray(imread(path)).tolist() - - def save_img(self): - """ - Do not change the below implementation - """ - new_path = self.path.with_name(self.path.stem + '_filtered' + self.path.suffix) - imsave(new_path, self.data, cmap='gray') - return new_path + def __init__(self, image_path): + self.image_path = image_path + self.image_data = self.load_image() + + def load_image(self): + try: + image = cv2.imread(self.image_path) + if image is not None: + return image + else: + raise FileNotFoundError("Unable to load image.") + except Exception as e: + print(f"Error loading image: {e}") + return None + + def save_image(self, image_data, suffix='_filtered'): + try: + directory = 'images' + if not os.path.exists(directory): + os.makedirs(directory) + + file_path = os.path.join(directory, f"{os.path.basename(self.image_path).split('.')[0]}{suffix}.jpg") + cv2.imwrite(file_path, image_data) + print(f"Image saved successfully: {file_path}") + return file_path + except Exception as e: + print(f"Error saving image: {e}") + return None def blur(self, blur_level=16): - - height = len(self.data) - width = len(self.data[0]) - filter_sum = blur_level ** 2 - - result = [] - for i in range(height - blur_level + 1): - row_result = [] - for j in range(width - blur_level + 1): - sub_matrix = [row[j:j + blur_level] for row in self.data[i:i + blur_level]] - average = sum(sum(sub_row) for sub_row in sub_matrix) // filter_sum - row_result.append(average) - result.append(row_result) - - self.data = result - - def contour(self): - for i, row in enumerate(self.data): - res = [] - for j in range(1, len(row)): - res.append(abs(row[j-1] - row[j])) - - self.data[i] = res + try: + if self.image_data is None: + raise ValueError("No image data available.") + blur_level = max(1, blur_level) + blur_level = blur_level + 1 if blur_level % 2 == 0 else blur_level + blurred_image = cv2.GaussianBlur(self.image_data, (blur_level, blur_level), 0) + return blurred_image + except Exception as e: + print(f"Error applying blur: {e}") + return None def rotate(self): - # TODO remove the `raise` below, and write your implementation - raise NotImplementedError() - - def salt_n_pepper(self): - # TODO remove the `raise` below, and write your implementation - raise NotImplementedError() - - def concat(self, other_img, direction='horizontal'): - # TODO remove the `raise` below, and write your implementation - raise NotImplementedError() - - def segment(self): - # TODO remove the `raise` below, and write your implementation - raise NotImplementedError() + try: + img = cv2.imread(self.image_path) + if img is None: + raise FileNotFoundError("Unable to load image.") + rotated_img = cv2.rotate(img, cv2.ROTATE_180) + return rotated_img + except Exception as e: + print(f"Error rotating image: {e}") + return None + + def salt_n_pepper(self, amount=0.05): + try: + if self.image_data is None: + raise ValueError("No image data available.") + noisy_image = self.image_data.copy() + mask = np.random.choice([0, 1, 2], size=noisy_image.shape[:2], p=[amount / 2, amount / 2, 1 - amount]) + noisy_image[mask == 0] = 0 + noisy_image[mask == 1] = 255 + return noisy_image + except Exception as e: + print(f"Error adding salt and pepper noise: {e}") + return None + + def concat(self, other_image_data, direction='horizontal'): + try: + if self.image_data is None or other_image_data is None: + raise ValueError("Image data is missing.") + + if direction not in ['horizontal', 'vertical']: + raise ValueError("Invalid direction. Please use 'horizontal' or 'vertical'.") + + if direction == 'horizontal': + concatenated_img = np.concatenate((self.image_data, other_image_data), axis=1) + else: + concatenated_img = np.concatenate((self.image_data, other_image_data), axis=0) + + return concatenated_img + except Exception as e: + print(f"Error concatenating images: {e}") + return None + + def segment(self, num_clusters=100): + try: + if self.image_data is None: + raise ValueError("No image data available.") + + image_rgb = cv2.cvtColor(self.image_data, cv2.COLOR_BGR2RGB) + pixels = image_rgb.reshape((-1, 3)) + pixels = np.float32(pixels) + + criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 100, 0.2) + _, labels, centers = cv2.kmeans(pixels, num_clusters, None, criteria, 10, cv2.KMEANS_RANDOM_CENTERS) + + centers = np.uint8(centers) + segmented_image = centers[labels.flatten()] + segmented_image = segmented_image.reshape(image_rgb.shape) + + # Convert segmented image back to BGR format + segmented_image_bgr = cv2.cvtColor(segmented_image, cv2.COLOR_RGB2BGR) + + # Darken the segmented image + segmented_image_bgr = segmented_image_bgr * 0.5 # Reduce brightness by 50% + + return segmented_image_bgr + except Exception as e: + print(f"Error segmenting image: {e}") + return None + + + + def grayscale(self): + try: + if self.image_data is None: + raise ValueError("No image data available.") + gray_image = cv2.cvtColor(self.image_data, cv2.COLOR_BGR2GRAY) + return cv2.cvtColor(gray_image, cv2.COLOR_GRAY2BGR) + except Exception as e: + print(f"Error converting image to grayscale: {e}") + return None + + def sharpen(self): + try: + if self.image_data is None: + raise ValueError("No image data available.") + kernel = np.array([[-1, -1, -1], [-1, 9, -1], [-1, -1, -1]]) + sharpened_image = cv2.filter2D(self.image_data, -1, kernel) + return sharpened_image + except Exception as e: + print(f"Error applying sharpen filter: {e}") + return None + + def emboss(self): + try: + if self.image_data is None: + raise ValueError("No image data available.") + kernel = np.array([[0, -1, -1], [1, 0, -1], [1, 1, 0]]) + embossed_image = cv2.filter2D(self.image_data, -1, kernel) + return embossed_image + except Exception as e: + print(f"Error applying emboss filter: {e}") + return None + + def invert_colors(self): + try: + if self.image_data is None: + raise ValueError("No image data available.") + inverted_image = cv2.bitwise_not(self.image_data) + return inverted_image + except Exception as e: + print(f"Error inverting colors: {e}") + return None + + def oil_painting(self, size=7, dynRatio=0.2): + try: + if self.image_data is None: + raise ValueError("No image data available.") + + # Convert image to grayscale + gray_image = cv2.cvtColor(self.image_data, cv2.COLOR_BGR2GRAY) + + # Apply median blur to create a smoother image + blurred_image = cv2.medianBlur(gray_image, size) + + # Apply adaptive threshold to create a binary image + _, mask = cv2.threshold(blurred_image, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU) + + # Create an output image using bitwise and operation with original image + oil_painting_effect = cv2.bitwise_and(self.image_data, self.image_data, mask=mask) + + return oil_painting_effect + except Exception as e: + print(f"Error applying oil painting effect: {e}") + return None + def cartoonize(self): + try: + if self.image_data is None: + raise ValueError("No image data available.") + gray_image = cv2.cvtColor(self.image_data, cv2.COLOR_BGR2GRAY) + blurred_image = cv2.medianBlur(gray_image, 7) + edges = cv2.adaptiveThreshold(blurred_image, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9) + color = cv2.bilateralFilter(self.image_data, 9, 300, 300) + cartoon_image = cv2.bitwise_and(color, color, mask=edges) + return cartoon_image + except Exception as e: + print(f"Error cartoonizing image: {e}") + return None \ No newline at end of file diff --git a/polybot/requirements.txt b/polybot/requirements.txt deleted file mode 100644 index dbab2768..00000000 --- a/polybot/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pyTelegramBotAPI>=4.12.0 -loguru>=0.7.0 -requests>=2.31.0 -flask>=2.3.2 -matplotlib \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..10d3c570 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,64 @@ +anyio==4.3.0 +asgiref==3.8.1 +astroid==3.1.0 +backports.zoneinfo==0.2.1 +blinker==1.7.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +class-registry==2.1.2 +click==8.1.7 +colorama==0.4.6 +contourpy==1.1.1 +cycler==0.12.1 +dill==0.3.8 +Django==4.2.11 +django-request==1.6.3 +exceptiongroup==1.2.1 +filters==1.3.2 +Flask==3.0.2 +fonttools==4.51.0 +h11==0.14.0 +httpcore==1.0.5 +httpx==0.27.0 +idna==3.6 +img==2.5 +importlib-metadata==7.0.1 +importlib_resources==6.4.0 +isort==5.13.2 +itsdangerous==2.1.2 +Jinja2==3.1.3 +kiwisolver==1.4.5 +loguru==0.7.2 +MarkupSafe==2.1.5 +matplotlib==3.7.5 +mccabe==0.7.0 +numpy==1.24.4 +opencv-python==4.9.0.80 +packaging==24.0 +pillow==10.3.0 +platformdirs==4.2.0 +pylint==3.1.0 +pyparsing==3.1.2 +pyTelegramBotAPI==4.16.1 +python-dateutil==2.9.0.post0 +python-dotenv==1.0.1 +python-telegram-bot==21.1.1 +pytz==2024.1 +regex==2024.4.16 +requests==2.31.0 +rfc3986==1.5.0 +six==1.16.0 +sniffio==1.3.1 +sqlparse==0.5.0 +style==1.1.0 +telebot==0.0.5 +tomli==2.0.1 +tomlkit==0.12.4 +typing_extensions==4.10.0 +tzdata==2024.1 +update==0.0.1 +urllib3==2.2.1 +vboxapi==1.0 +Werkzeug==3.0.1 +win32-setctime==1.1.0 +zipp==3.17.0 From 1ce957d2c4dad878a0e17d7263ec7e13706ffb5c Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 20:05:15 +0300 Subject: [PATCH 02/85] jenkins --- jenkis_try/try.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 jenkis_try/try.py diff --git a/jenkis_try/try.py b/jenkis_try/try.py new file mode 100644 index 00000000..ce013625 --- /dev/null +++ b/jenkis_try/try.py @@ -0,0 +1 @@ +hello From 6ff659214a49b704370b527208a4a9410de20a0a Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 20:11:06 +0300 Subject: [PATCH 03/85] jenkins2 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index ce013625..63fa236c 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -hello +hello22 From 136c8ead589f78b6a59d2a89a7285550404814e8 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 20:39:05 +0300 Subject: [PATCH 04/85] jenkins12 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index 63fa236c..a68cc78b 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -hello22 +hello21312 From 74fb182dc486fe5bc1f5fd2f76e32345f841d6f7 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 20:48:48 +0300 Subject: [PATCH 05/85] jenkins1122 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index a68cc78b..e7f3776d 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -hello21312 +hello1212 From ef4e989caa6849dacc9502265eab5d0b31c90f5f Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 20:53:35 +0300 Subject: [PATCH 06/85] jenkins1111212 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index e7f3776d..3c902c8d 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -hello1212 +hello121211212121 From 9b59e57e1db64631bef42bfc60d7bb3089e652d7 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 21:03:38 +0300 Subject: [PATCH 07/85] jenk --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index 3c902c8d..31fc20fb 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -hello121211212121 +he From ef8a7358effa089da75214d213bf41be588239e9 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 21:05:11 +0300 Subject: [PATCH 08/85] jenk1 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index 31fc20fb..3c86b35c 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -he +he22 From 3dbc758791dc131ebe0d0e414081662469dc9174 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 29 May 2024 21:08:55 +0300 Subject: [PATCH 09/85] jenk211 --- jenkis_try/try.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkis_try/try.py b/jenkis_try/try.py index 3c86b35c..2971aa06 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -he22 +he2112 From 8a45a1ccee8937e9da377eb1833cabb71744f5f9 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 17:51:43 +0300 Subject: [PATCH 10/85] build_dockerfile --- build_Jenkinsfile | 17 +++++++++++++++++ jenkis_try/try.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 build_Jenkinsfile diff --git a/build_Jenkinsfile b/build_Jenkinsfile new file mode 100644 index 00000000..4acd0fa2 --- /dev/null +++ b/build_Jenkinsfile @@ -0,0 +1,17 @@ +pipeline{ + + agent any + stages { + + stage('Build docker image'){ + steps { + sh''' + + ''' + } + + } + +} + +} diff --git a/jenkis_try/try.py b/jenkis_try/try.py index 2971aa06..ca79f4b1 100644 --- a/jenkis_try/try.py +++ b/jenkis_try/try.py @@ -1 +1 @@ -he2112 +he21122 From 7f4cf48fb4f287b151031434e4d91500bc8f3e70 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:17:43 +0300 Subject: [PATCH 11/85] change file --- build.Jenkinsfile | 13 +++++++++++++ build_Jenkinsfile | 17 ----------------- 2 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 build.Jenkinsfile delete mode 100644 build_Jenkinsfile diff --git a/build.Jenkinsfile b/build.Jenkinsfile new file mode 100644 index 00000000..240b9ca6 --- /dev/null +++ b/build.Jenkinsfile @@ -0,0 +1,13 @@ +pipeline { + agent any + stages { + stage('Build docker image') { + steps { + sh ''' + echo "hello world" + ''' + + } + } + } +} \ No newline at end of file diff --git a/build_Jenkinsfile b/build_Jenkinsfile deleted file mode 100644 index 4acd0fa2..00000000 --- a/build_Jenkinsfile +++ /dev/null @@ -1,17 +0,0 @@ -pipeline{ - - agent any - stages { - - stage('Build docker image'){ - steps { - sh''' - - ''' - } - - } - -} - -} From 8312f445360083ef4f2fc784e7abd4e62cea5b7e Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:19:24 +0300 Subject: [PATCH 12/85] change file2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 240b9ca6..f820e7f5 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage('Build docker image') { steps { sh ''' - echo "hello world" + echo "hello world2" ''' } From 28ebfa7e3149142c00194337a81722e2dc108b35 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:20:14 +0300 Subject: [PATCH 13/85] change files --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index f820e7f5..5e980c3e 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage('Build docker image') { steps { sh ''' - echo "hello world2" + echo "hello world tt" ''' } From 374169d43dcc0084369797c8c20267becd70bafe Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:22:45 +0300 Subject: [PATCH 14/85] hh --- hh.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 hh.txt diff --git a/hh.txt b/hh.txt new file mode 100644 index 00000000..0107e44b --- /dev/null +++ b/hh.txt @@ -0,0 +1 @@ +sa \ No newline at end of file From 5b1b24b64aefd5c573725964a72a4e19c8322630 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:31:23 +0300 Subject: [PATCH 15/85] hh2 --- Dockerfile | 8 ++++++++ hh.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..690d924b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.10.12-slim-bullseye +WORKDIR /app +COPY requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD ["python3","polybot/bot.py"] \ No newline at end of file diff --git a/hh.txt b/hh.txt index 0107e44b..0f3410a0 100644 --- a/hh.txt +++ b/hh.txt @@ -1 +1 @@ -sa \ No newline at end of file +sa22 \ No newline at end of file From 90dffb317b81a9198c3053973e0cb188bcd83cea Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:41:19 +0300 Subject: [PATCH 16/85] hh2 --- build.Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 5e980c3e..736c0df1 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -4,7 +4,10 @@ pipeline { stage('Build docker image') { steps { sh ''' - echo "hello world tt" + cd polybot + docker build -t polybot:${BUILD_NUMBER} . + docker push docker push beny14/polybot:${BUILD_NUMBER} + ''' } From c37ff86ee072a3bcc693077227636adbf7e054bf Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:42:23 +0300 Subject: [PATCH 17/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 736c0df1..52e4ee1e 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Build docker image') { steps { - sh ''' + bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . docker push docker push beny14/polybot:${BUILD_NUMBER} From b0622aac75ca1b1982cfc79ba21a18fa24efad83 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:44:38 +0300 Subject: [PATCH 18/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 52e4ee1e..2e621b23 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,7 +6,7 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . - docker push docker push beny14/polybot:${BUILD_NUMBER} + docker push docker push beny14/[polybot:${BUILD_NUMBER}] ''' From 912edfc150e5d8a2052c80244326f290990c62fe Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:45:39 +0300 Subject: [PATCH 19/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 2e621b23..14675f2a 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,7 +6,7 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . - docker push docker push beny14/[polybot:${BUILD_NUMBER}] + docker push beny14/polybot:${BUILD_NUMBER} ''' From 831e21bc8a05f2afb1381391d61256fde0e1839c Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:46:36 +0300 Subject: [PATCH 20/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 14675f2a..af4f048f 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,7 +6,7 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . - docker push beny14/polybot:${BUILD_NUMBER} + docker push beny14/repo1:${BUILD_NUMBER} ''' From ed21a1d80feb94d0ac7fde79b5723b4206139366 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:47:24 +0300 Subject: [PATCH 21/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index af4f048f..deb85819 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,7 +6,7 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . - docker push beny14/repo1:${BUILD_NUMBER} + docker push beny14/repo1:polybot ''' From 5ae9e5e84470edd5a4f5e61b5aaca36fcba69f7b Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:52:58 +0300 Subject: [PATCH 22/85] hh2 --- build.Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index deb85819..a5a30b8b 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,6 +6,14 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . + REM Change directory to where Docker executable is located + cd "C:\Program Files\Docker" + + REM Run Docker with elevated privileges + docker.exe %* + + + docker push beny14/repo1:polybot ''' From 3370b28dfa80d90dc17e422a112b7f93addc48c3 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 18:54:13 +0300 Subject: [PATCH 23/85] hh2 --- build.Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index a5a30b8b..76c693e8 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,10 +6,6 @@ pipeline { bat ''' cd polybot docker build -t polybot:${BUILD_NUMBER} . - REM Change directory to where Docker executable is located - cd "C:\Program Files\Docker" - - REM Run Docker with elevated privileges docker.exe %* From 09cb389503c95e13d1088ead030ad1b805ac7ba9 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:14:17 +0300 Subject: [PATCH 24/85] hh2 --- build.Jenkinsfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 76c693e8..99914d1a 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -3,16 +3,13 @@ pipeline { stages { stage('Build docker image') { steps { - bat ''' - cd polybot - docker build -t polybot:${BUILD_NUMBER} . - docker.exe %* - - - - docker push beny14/repo1:polybot - - ''' + bat ''' + cd polybot + docker build -t beny14/repo1:polybot-${BUILD_NUMBER} . + docker login -u beny14 + docker push beny14/repo1:polybot-${BUILD_NUMBER} + ''' +} } } From 75d4919802e23b3bb3aa1e06bf17746f7be852d0 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:15:04 +0300 Subject: [PATCH 25/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 99914d1a..8838bcd6 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -9,7 +9,7 @@ pipeline { docker login -u beny14 docker push beny14/repo1:polybot-${BUILD_NUMBER} ''' -} + } } From 2688e3d5842e1d1d418aafc3e6b1aa37926c6924 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:28:52 +0300 Subject: [PATCH 26/85] hh2 --- build.Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 8838bcd6..8363586e 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -3,14 +3,19 @@ pipeline { stages { stage('Build docker image') { steps { + withCredentials( + [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] + ) { bat ''' cd polybot - docker build -t beny14/repo1:polybot-${BUILD_NUMBER} . - docker login -u beny14 + docker login -u $USERNAME -p $USERPASS + docker build -t polybot:${BUILD_NUMBER} . + docker push beny14/repo1:polybot-${BUILD_NUMBER} ''' + } } } } From 38fc2349cd956e243dc881f3f0beb56de8e96fba Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:30:58 +0300 Subject: [PATCH 27/85] hh2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 690d924b..bf8362df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.10.12-slim-bullseye -WORKDIR /app +WORKDIR /tt COPY requirements.txt RUN pip install --no-cache-dir -r requirements.txt From 706178ed64bc0442598f3675f2da943a5209ec4a Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:33:11 +0300 Subject: [PATCH 28/85] hh2 --- hh.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hh.txt b/hh.txt index 0f3410a0..5422d91d 100644 --- a/hh.txt +++ b/hh.txt @@ -1 +1 @@ -sa22 \ No newline at end of file +sa22sasa \ No newline at end of file From bef053fdbcedecabd981517b5f6af3733d2b4dde Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:35:18 +0300 Subject: [PATCH 29/85] hh2 --- build.Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 8363586e..6ec8a8b7 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -7,11 +7,12 @@ pipeline { [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] ) { bat ''' - cd polybot - docker login -u $USERNAME -p $USERPASS - docker build -t polybot:${BUILD_NUMBER} . + @echo off + cd polybot + docker login -u %USERNAME% -p %USERPASS% + docker build -t polybot:%BUILD_NUMBER% . - docker push beny14/repo1:polybot-${BUILD_NUMBER} + docker push beny14/repo1:polybot-%BUILD_NUMBER% ''' From 90fa44108c656afc46203ef20432ed87e6f2d393 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:43:21 +0300 Subject: [PATCH 30/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 6ec8a8b7..cedf054b 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -9,7 +9,7 @@ pipeline { bat ''' @echo off cd polybot - docker login -u %USERNAME% -p %USERPASS% + docker login -u %USERNAME% -p %USERPASS% --password-stdin docker build -t polybot:%BUILD_NUMBER% . docker push beny14/repo1:polybot-%BUILD_NUMBER% From a83f9fe2f7e3ab6d1a86031496816614a6a8b54d Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:45:04 +0300 Subject: [PATCH 31/85] hh2 --- polybot/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 polybot/Dockerfile diff --git a/polybot/Dockerfile b/polybot/Dockerfile new file mode 100644 index 00000000..bf8362df --- /dev/null +++ b/polybot/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.10.12-slim-bullseye +WORKDIR /tt +COPY requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD ["python3","polybot/bot.py"] \ No newline at end of file From 6c47977ae3d00e87edba370e5a7fe68c267fbef3 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:47:29 +0300 Subject: [PATCH 32/85] hh2 --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index cedf054b..964fc134 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -12,7 +12,7 @@ pipeline { docker login -u %USERNAME% -p %USERPASS% --password-stdin docker build -t polybot:%BUILD_NUMBER% . - docker push beny14/repo1:polybot-%BUILD_NUMBER% + docker push beny14/repo1:polybot ''' From 6eba20933f2df80937e366221002f610befb9194 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 19:53:12 +0300 Subject: [PATCH 33/85] hh2 --- polybot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index bf8362df..85dbab1c 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.10.12-slim-bullseye WORKDIR /tt -COPY requirements.txt +COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . From 0df2894db10722cbcedde0d5eb9325ffa0f7258a Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:06:07 +0300 Subject: [PATCH 34/85] hh2 --- polybot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 85dbab1c..ec511868 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.10.12-slim-bullseye -WORKDIR /tt +WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt From eee677f306c1654f5e3a8e4a32d73f500d09a90f Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:07:21 +0300 Subject: [PATCH 35/85] hh2 --- polybot/requirements.txt | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 polybot/requirements.txt diff --git a/polybot/requirements.txt b/polybot/requirements.txt new file mode 100644 index 00000000..10d3c570 --- /dev/null +++ b/polybot/requirements.txt @@ -0,0 +1,64 @@ +anyio==4.3.0 +asgiref==3.8.1 +astroid==3.1.0 +backports.zoneinfo==0.2.1 +blinker==1.7.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +class-registry==2.1.2 +click==8.1.7 +colorama==0.4.6 +contourpy==1.1.1 +cycler==0.12.1 +dill==0.3.8 +Django==4.2.11 +django-request==1.6.3 +exceptiongroup==1.2.1 +filters==1.3.2 +Flask==3.0.2 +fonttools==4.51.0 +h11==0.14.0 +httpcore==1.0.5 +httpx==0.27.0 +idna==3.6 +img==2.5 +importlib-metadata==7.0.1 +importlib_resources==6.4.0 +isort==5.13.2 +itsdangerous==2.1.2 +Jinja2==3.1.3 +kiwisolver==1.4.5 +loguru==0.7.2 +MarkupSafe==2.1.5 +matplotlib==3.7.5 +mccabe==0.7.0 +numpy==1.24.4 +opencv-python==4.9.0.80 +packaging==24.0 +pillow==10.3.0 +platformdirs==4.2.0 +pylint==3.1.0 +pyparsing==3.1.2 +pyTelegramBotAPI==4.16.1 +python-dateutil==2.9.0.post0 +python-dotenv==1.0.1 +python-telegram-bot==21.1.1 +pytz==2024.1 +regex==2024.4.16 +requests==2.31.0 +rfc3986==1.5.0 +six==1.16.0 +sniffio==1.3.1 +sqlparse==0.5.0 +style==1.1.0 +telebot==0.0.5 +tomli==2.0.1 +tomlkit==0.12.4 +typing_extensions==4.10.0 +tzdata==2024.1 +update==0.0.1 +urllib3==2.2.1 +vboxapi==1.0 +Werkzeug==3.0.1 +win32-setctime==1.1.0 +zipp==3.17.0 From 2ac64b0e53afc76282ab87a4ce84fe75c8cb9b10 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:22:34 +0300 Subject: [PATCH 36/85] hh2 --- polybot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index ec511868..1603ead7 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.10.12-slim-bullseye WORKDIR /app COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -vvv -r requirements.txt COPY . . From 7f8981584fe3c0bffaa848e94f896d061e705520 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:23:21 +0300 Subject: [PATCH 37/85] hh2 --- polybot/requirements.txt | 2 -- requirements.txt | 2 -- 2 files changed, 4 deletions(-) diff --git a/polybot/requirements.txt b/polybot/requirements.txt index 10d3c570..39eb8aad 100644 --- a/polybot/requirements.txt +++ b/polybot/requirements.txt @@ -1,7 +1,6 @@ anyio==4.3.0 asgiref==3.8.1 astroid==3.1.0 -backports.zoneinfo==0.2.1 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 @@ -60,5 +59,4 @@ update==0.0.1 urllib3==2.2.1 vboxapi==1.0 Werkzeug==3.0.1 -win32-setctime==1.1.0 zipp==3.17.0 diff --git a/requirements.txt b/requirements.txt index 10d3c570..39eb8aad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ anyio==4.3.0 asgiref==3.8.1 astroid==3.1.0 -backports.zoneinfo==0.2.1 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 @@ -60,5 +59,4 @@ update==0.0.1 urllib3==2.2.1 vboxapi==1.0 Werkzeug==3.0.1 -win32-setctime==1.1.0 zipp==3.17.0 From 3cdc84532ced7465a7348afefac668601221f0e0 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:31:57 +0300 Subject: [PATCH 38/85] hh2 --- polybot/Dockerfile | 12 +++++++++--- requirements.txt | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 1603ead7..406ca9b9 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -1,8 +1,14 @@ +# Use the official Python slim image FROM python:3.10.12-slim-bullseye + +# Set the working directory in the container WORKDIR /app + +# Copy the requirements file into the container COPY requirements.txt . -RUN pip install --no-cache-dir -vvv -r requirements.txt -COPY . . +# Install the required Python packages +RUN pip install --no-cache-dir -r requirements.txt -CMD ["python3","polybot/bot.py"] \ No newline at end of file +# Copy the rest of the application code into the container +COPY . . \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 39eb8aad..10d3c570 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ anyio==4.3.0 asgiref==3.8.1 astroid==3.1.0 +backports.zoneinfo==0.2.1 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 @@ -59,4 +60,5 @@ update==0.0.1 urllib3==2.2.1 vboxapi==1.0 Werkzeug==3.0.1 +win32-setctime==1.1.0 zipp==3.17.0 From 6a3943c83841ecddbe0d9bd7539255a3bfb20341 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:34:33 +0300 Subject: [PATCH 39/85] hh2 --- polybot/Dockerfile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 406ca9b9..5b342585 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -7,8 +7,17 @@ WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . -# Install the required Python packages -RUN pip install --no-cache-dir -r requirements.txt +# Update system packages and install any dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +# Install the required Python packages with verbose output +RUN pip install --no-cache-dir --upgrade pip \ + && pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code into the container -COPY . . \ No newline at end of file +COPY . . + +# Specify the command to run the application +CMD ["python3", "polybot/bot.py"] \ No newline at end of file From 6d8fc2b68a2219ad7655d7ba6070a03ae014b114 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Wed, 5 Jun 2024 20:36:54 +0300 Subject: [PATCH 40/85] hh2 --- polybot/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 5b342585..be4d93f4 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -7,9 +7,11 @@ WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . -# Update system packages and install any dependencies +# Update system packages and install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ + gcc \ + libssl-dev \ && rm -rf /var/lib/apt/lists/* # Install the required Python packages with verbose output From e7115306ba431b70bd885b5f6a36c0d5a818cd9f Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:33:29 +0300 Subject: [PATCH 41/85] hh2 --- polybot/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index be4d93f4..794f1b68 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -7,6 +7,8 @@ WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . +RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt + # Update system packages and install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ From c3cda0d031d81bd02970ec19d44d75c718461049 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:39:22 +0300 Subject: [PATCH 42/85] hh2 --- polybot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/bot.py b/polybot/bot.py index 7200dba8..ee5ebd12 100644 --- a/polybot/bot.py +++ b/polybot/bot.py @@ -10,7 +10,7 @@ # Check if TELEGRAM_TOKEN is not none if TELEGRAM_TOKEN is None: - print("Error: TELEGRAM_TOKEN is not set in the .env file.") + print("Error : TELEGRAM_TOKEN is not set in the .env file.") exit(1) # initialize telegram-bot From 0efe3d4e337f791ad16f8a5676a67fd021addc12 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:40:30 +0300 Subject: [PATCH 43/85] hh2 --- polybot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/bot.py b/polybot/bot.py index ee5ebd12..7200dba8 100644 --- a/polybot/bot.py +++ b/polybot/bot.py @@ -10,7 +10,7 @@ # Check if TELEGRAM_TOKEN is not none if TELEGRAM_TOKEN is None: - print("Error : TELEGRAM_TOKEN is not set in the .env file.") + print("Error: TELEGRAM_TOKEN is not set in the .env file.") exit(1) # initialize telegram-bot From 1b7a6776965f317c2d01e37b7ee51293932f7d22 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:41:10 +0300 Subject: [PATCH 44/85] hh2 --- polybot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/bot.py b/polybot/bot.py index 7200dba8..ee5ebd12 100644 --- a/polybot/bot.py +++ b/polybot/bot.py @@ -10,7 +10,7 @@ # Check if TELEGRAM_TOKEN is not none if TELEGRAM_TOKEN is None: - print("Error: TELEGRAM_TOKEN is not set in the .env file.") + print("Error : TELEGRAM_TOKEN is not set in the .env file.") exit(1) # initialize telegram-bot From fd17604545d7b08b456062d6c04fe48aa3204796 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:42:47 +0300 Subject: [PATCH 45/85] hh2 --- polybot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/bot.py b/polybot/bot.py index ee5ebd12..2c8ec796 100644 --- a/polybot/bot.py +++ b/polybot/bot.py @@ -10,7 +10,7 @@ # Check if TELEGRAM_TOKEN is not none if TELEGRAM_TOKEN is None: - print("Error : TELEGRAM_TOKEN is not set in the .env file.") + print("Error : TELEGRAM_TOKEN is not set in the .env file.") exit(1) # initialize telegram-bot From df8dcc8446d1534d11ce74983b5692d8dfe2d570 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:47:48 +0300 Subject: [PATCH 46/85] hh2 --- polybot/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 794f1b68..be4d93f4 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -7,8 +7,6 @@ WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . -RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt - # Update system packages and install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ From 03964a6580429b5bd9fe7cae534ca2922f3bc846 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:55:03 +0300 Subject: [PATCH 47/85] hh2 --- build.Jenkinsfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 964fc134..81f8d169 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,15 +6,13 @@ pipeline { withCredentials( [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] ) { - bat ''' - @echo off - cd polybot - docker login -u %USERNAME% -p %USERPASS% --password-stdin - docker build -t polybot:%BUILD_NUMBER% . - - docker push beny14/repo1:polybot - ''' - + bat ''' + @echo off + cd polybot + echo %USERPASS% | docker login -u %USERNAME% --password-stdin + docker build -t beny14/repo1:%BUILD_NUMBER% . + docker push beny14/repo1:%BUILD_NUMBER% + ''' } } From 318de6374a0a945861581c09b131e29b86697c9d Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 17:58:43 +0300 Subject: [PATCH 48/85] try changes --- polybot/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index be4d93f4..68fa8ab4 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -12,11 +12,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ libssl-dev \ + libpq-dev \ && rm -rf /var/lib/apt/lists/* # Install the required Python packages with verbose output RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir -r requirements.txt + && pip install --no-cache-dir -r requirements.txt --verbose # Copy the rest of the application code into the container COPY . . From e62e5196861071e4c6010cb947aab8d829c2ce1a Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:01:30 +0300 Subject: [PATCH 49/85] try changes --- polybot/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 68fa8ab4..b62b0141 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -12,12 +12,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ libssl-dev \ - libpq-dev \ && rm -rf /var/lib/apt/lists/* # Install the required Python packages with verbose output RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir -r requirements.txt --verbose + && pip install --no-cache-dir -r requirements.txt --verbose || { echo 'pip install failed'; exit 1; } # Copy the rest of the application code into the container COPY . . From be51e57dbb36e7487448d479828c4b7e7f38c277 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:04:16 +0300 Subject: [PATCH 50/85] try changes --- build.Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 81f8d169..bcd6fd3e 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -6,15 +6,14 @@ pipeline { withCredentials( [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] ) { - bat ''' + script { + bat """ @echo off cd polybot echo %USERPASS% | docker login -u %USERNAME% --password-stdin docker build -t beny14/repo1:%BUILD_NUMBER% . docker push beny14/repo1:%BUILD_NUMBER% - ''' - - } + """ } } } From c85ce7809fb56be0b49fb9628ad99063c58823f9 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:08:26 +0300 Subject: [PATCH 51/85] try changes --- build.Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index bcd6fd3e..efd53b24 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -5,7 +5,7 @@ pipeline { steps { withCredentials( [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] - ) { + ) script { bat """ @echo off @@ -17,4 +17,5 @@ pipeline { } } } -} \ No newline at end of file + } + } From 5df136a98ac3090daa9111ba199cca2c745da85b Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:10:02 +0300 Subject: [PATCH 52/85] try changes --- build.Jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index efd53b24..7cf6a256 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -3,9 +3,7 @@ pipeline { stages { stage('Build docker image') { steps { - withCredentials( - [usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')] - ) + withCredentials([usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { script { bat """ @echo off @@ -14,8 +12,9 @@ pipeline { docker build -t beny14/repo1:%BUILD_NUMBER% . docker push beny14/repo1:%BUILD_NUMBER% """ + } + } } } } - } - } +} \ No newline at end of file From e56b4a2cfed1ff251b5bc43c3a833e049afb0399 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:11:43 +0300 Subject: [PATCH 53/85] try changes --- polybot/img_proc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/img_proc.py b/polybot/img_proc.py index cb7005c5..df2f79a0 100644 --- a/polybot/img_proc.py +++ b/polybot/img_proc.py @@ -13,7 +13,7 @@ def load_image(self): if image is not None: return image else: - raise FileNotFoundError("Unable to load image.") + raise FileNotFoundError(" Unable to load image.") except Exception as e: print(f"Error loading image: {e}") return None From 13f65f62b84a2fd33ee8637cd7353d4a342f5eeb Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:16:52 +0300 Subject: [PATCH 54/85] try changes --- polybot/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index b62b0141..5f3d6a82 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -14,9 +14,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libssl-dev \ && rm -rf /var/lib/apt/lists/* -# Install the required Python packages with verbose output -RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir -r requirements.txt --verbose || { echo 'pip install failed'; exit 1; } +# Install the required Python packages +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt --verbose # Copy the rest of the application code into the container COPY . . From 3ba1c5e147733ff8eced2ad8211fcdd33d5bfa09 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:20:20 +0300 Subject: [PATCH 55/85] try changes --- polybot/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 5f3d6a82..6ba978a5 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -16,7 +16,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install the required Python packages RUN pip install --no-cache-dir --upgrade pip -RUN pip install --no-cache-dir -r requirements.txt --verbose + +# Debugging step: Capture and output logs of pip install +RUN pip install --no-cache-dir -r requirements.txt --verbose > pip_install.log 2>&1 || (cat pip_install.log && exit 1) # Copy the rest of the application code into the container COPY . . From 8cbf08b6fe5a105f8d4f9708f96f3c617a5033f6 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:32:39 +0300 Subject: [PATCH 56/85] try changes --- build.Jenkinsfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 7cf6a256..c0cc725a 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -1,20 +1,26 @@ pipeline { agent any + +enviroment{ + IMG_NAME = "polybot:${BUILD_NUMBER}" + stages { stage('Build docker image') { steps { withCredentials([usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { - script { + { bat """ @echo off cd polybot - echo %USERPASS% | docker login -u %USERNAME% --password-stdin - docker build -t beny14/repo1:%BUILD_NUMBER% . - docker push beny14/repo1:%BUILD_NUMBER% + docker login -u %USERNAME% -p $USERPASS% --password-stdin + docker build -t %IMG_NAME% . + docker tag %IMG_NAME% beny14/%IMG_NAME% + docker push beny14/%IMG_NAME% """ - } + } } } } +} } \ No newline at end of file From 32419d88b0c2669a0a0692980f33c05c67e2261e Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:37:14 +0300 Subject: [PATCH 57/85] try changes --- build.Jenkinsfile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index c0cc725a..59b757cf 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -1,26 +1,34 @@ pipeline { agent any -enviroment{ - IMG_NAME = "polybot:${BUILD_NUMBER}" + environment { + IMG_NAME = "polybot:${BUILD_NUMBER}" + } stages { stage('Build docker image') { steps { withCredentials([usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { - { + script { bat """ @echo off cd polybot - docker login -u %USERNAME% -p $USERPASS% --password-stdin + echo Logging in to Docker... + echo %USERPASS% | docker login -u %USERNAME% --password-stdin + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + echo Building Docker image... docker build -t %IMG_NAME% . + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + echo Tagging Docker image... docker tag %IMG_NAME% beny14/%IMG_NAME% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + echo Pushing Docker image... docker push beny14/%IMG_NAME% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% """ - + } } } } } -} } \ No newline at end of file From fccc07613415161798222bb81cbb963bcaa066cc Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:38:01 +0300 Subject: [PATCH 58/85] try changes --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 59b757cf..a41f65ac 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { bat """ @echo off cd polybot - echo Logging in to Docker... + echo Logging in to Docker... echo %USERPASS% | docker login -u %USERNAME% --password-stdin if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% echo Building Docker image... From 670e797f6a3118b7c871838f2da0b795909864cd Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:38:38 +0300 Subject: [PATCH 59/85] try changes --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index a41f65ac..59b757cf 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { bat """ @echo off cd polybot - echo Logging in to Docker... + echo Logging in to Docker... echo %USERPASS% | docker login -u %USERNAME% --password-stdin if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% echo Building Docker image... From 8eb7e51759fcd8a147b9297ba36bd2388085a4b3 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:39:04 +0300 Subject: [PATCH 60/85] try changes --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 59b757cf..a830e107 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { bat """ @echo off cd polybot - echo Logging in to Docker... + echo Logging in to Docker... echo %USERPASS% | docker login -u %USERNAME% --password-stdin if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% echo Building Docker image... From e84b42206225df435a763eeead1c39bf60e1f997 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 18:40:07 +0300 Subject: [PATCH 61/85] try changes --- build.Jenkinsfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index a830e107..38092022 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -10,25 +10,18 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { script { + // Use correct Docker login syntax bat """ @echo off cd polybot - echo Logging in to Docker... - echo %USERPASS% | docker login -u %USERNAME% --password-stdin - if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo Building Docker image... + docker login -u %USERNAME% -p %USERPASS% docker build -t %IMG_NAME% . - if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo Tagging Docker image... docker tag %IMG_NAME% beny14/%IMG_NAME% - if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo Pushing Docker image... docker push beny14/%IMG_NAME% - if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% """ } } } } } -} \ No newline at end of file +} From 397d3a35b4315ee45c6270c54366b8353614b958 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:15:06 +0300 Subject: [PATCH 62/85] try changes --- build.Jenkinsfile | 7 +++++-- deploy.Jenkinsfile | 17 +++++++++++++++++ hh.txt | 1 - polybot/Dockerfile | 8 +------- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 deploy.Jenkinsfile delete mode 100644 hh.txt diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 38092022..7d709e79 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -16,12 +16,15 @@ pipeline { cd polybot docker login -u %USERNAME% -p %USERPASS% docker build -t %IMG_NAME% . - docker tag %IMG_NAME% beny14/%IMG_NAME% - docker push beny14/%IMG_NAME% + docker tag %IMG_NAME% beny14/repo1:%IMG_NAME% + docker push beny14/repo1:%IMG_NAME% """ } } } } +// stage('Trigger Deploy'){ +// steps job: 'ploybotdeploy',wait:false, parameters:[ +// string(name:'beny14/repo1:%IMG_NAME%', value:"beny14/repo1:%IMG_NAME%")]} } } diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile new file mode 100644 index 00000000..9e981de9 --- /dev/null +++ b/deploy.Jenkinsfile @@ -0,0 +1,17 @@ +pipeline { + agent any + + parameters { + string(name: 'IMAGE_URL', defaultValue: '', description: '') + } + + stages { + stage('Deploy') { + steps { + sh ''' + echo "deploying to k8s cluster ..( or any other alternative)" + ''' + } + } + } +} \ No newline at end of file diff --git a/hh.txt b/hh.txt deleted file mode 100644 index 5422d91d..00000000 --- a/hh.txt +++ /dev/null @@ -1 +0,0 @@ -sa22sasa \ No newline at end of file diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 6ba978a5..d9dc56c8 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -7,18 +7,12 @@ WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . -# Update system packages and install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - gcc \ - libssl-dev \ - && rm -rf /var/lib/apt/lists/* # Install the required Python packages RUN pip install --no-cache-dir --upgrade pip # Debugging step: Capture and output logs of pip install -RUN pip install --no-cache-dir -r requirements.txt --verbose > pip_install.log 2>&1 || (cat pip_install.log && exit 1) +RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code into the container COPY . . From 009cec61a7a5519388d9bd6d325aa9d020e54572 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:17:38 +0300 Subject: [PATCH 63/85] try changes --- polybot/requirements.txt | 67 +++------------------------------------- 1 file changed, 5 insertions(+), 62 deletions(-) diff --git a/polybot/requirements.txt b/polybot/requirements.txt index 39eb8aad..9e381578 100644 --- a/polybot/requirements.txt +++ b/polybot/requirements.txt @@ -1,62 +1,5 @@ -anyio==4.3.0 -asgiref==3.8.1 -astroid==3.1.0 -blinker==1.7.0 -certifi==2024.2.2 -charset-normalizer==3.3.2 -class-registry==2.1.2 -click==8.1.7 -colorama==0.4.6 -contourpy==1.1.1 -cycler==0.12.1 -dill==0.3.8 -Django==4.2.11 -django-request==1.6.3 -exceptiongroup==1.2.1 -filters==1.3.2 -Flask==3.0.2 -fonttools==4.51.0 -h11==0.14.0 -httpcore==1.0.5 -httpx==0.27.0 -idna==3.6 -img==2.5 -importlib-metadata==7.0.1 -importlib_resources==6.4.0 -isort==5.13.2 -itsdangerous==2.1.2 -Jinja2==3.1.3 -kiwisolver==1.4.5 -loguru==0.7.2 -MarkupSafe==2.1.5 -matplotlib==3.7.5 -mccabe==0.7.0 -numpy==1.24.4 -opencv-python==4.9.0.80 -packaging==24.0 -pillow==10.3.0 -platformdirs==4.2.0 -pylint==3.1.0 -pyparsing==3.1.2 -pyTelegramBotAPI==4.16.1 -python-dateutil==2.9.0.post0 -python-dotenv==1.0.1 -python-telegram-bot==21.1.1 -pytz==2024.1 -regex==2024.4.16 -requests==2.31.0 -rfc3986==1.5.0 -six==1.16.0 -sniffio==1.3.1 -sqlparse==0.5.0 -style==1.1.0 -telebot==0.0.5 -tomli==2.0.1 -tomlkit==0.12.4 -typing_extensions==4.10.0 -tzdata==2024.1 -update==0.0.1 -urllib3==2.2.1 -vboxapi==1.0 -Werkzeug==3.0.1 -zipp==3.17.0 +pyTelegramBotAPI>=4.12.0 +loguru>=0.7.0 +requests>=2.31.0 +flask>=2.3.2 +matplotlib>=3.7.5 \ No newline at end of file From ed707dd68f92ed4bdb8618a1b4a68ca51e21709a Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:21:29 +0300 Subject: [PATCH 64/85] try changes --- build.Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 7d709e79..473ed835 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -16,8 +16,8 @@ pipeline { cd polybot docker login -u %USERNAME% -p %USERPASS% docker build -t %IMG_NAME% . - docker tag %IMG_NAME% beny14/repo1:%IMG_NAME% - docker push beny14/repo1:%IMG_NAME% + docker tag %IMG_NAME% beny14/%IMG_NAME% + docker push beny14/%IMG_NAME% """ } } From a1e6fcc8edb05c890a6346fb53e6f37f6a952f75 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:43:00 +0300 Subject: [PATCH 65/85] try changes --- Dockerfile | 8 ------ build.Jenkinsfile | 6 ++-- deploy.Jenkinsfile | 2 +- requirements.txt | 69 ++++------------------------------------------ 4 files changed, 9 insertions(+), 76 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index bf8362df..00000000 --- a/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM python:3.10.12-slim-bullseye -WORKDIR /tt -COPY requirements.txt -RUN pip install --no-cache-dir -r requirements.txt - -COPY . . - -CMD ["python3","polybot/bot.py"] \ No newline at end of file diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 473ed835..ade0efb7 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -23,8 +23,8 @@ pipeline { } } } -// stage('Trigger Deploy'){ -// steps job: 'ploybotdeploy',wait:false, parameters:[ -// string(name:'beny14/repo1:%IMG_NAME%', value:"beny14/repo1:%IMG_NAME%")]} + stage('Trigger Deploy'){ + steps job: 'polybotdeploy',wait:false, parameters:[ + string(name:'beny14/%IMG_NAME%', value:"beny14/%IMG_NAME%")]} } } diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile index 9e981de9..16aa6869 100644 --- a/deploy.Jenkinsfile +++ b/deploy.Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any parameters { - string(name: 'IMAGE_URL', defaultValue: '', description: '') + string(name: 'beny14/polybot', defaultValue: 'INAGE_URL', description: 'deploy polybot') } stages { diff --git a/requirements.txt b/requirements.txt index 10d3c570..9e381578 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,64 +1,5 @@ -anyio==4.3.0 -asgiref==3.8.1 -astroid==3.1.0 -backports.zoneinfo==0.2.1 -blinker==1.7.0 -certifi==2024.2.2 -charset-normalizer==3.3.2 -class-registry==2.1.2 -click==8.1.7 -colorama==0.4.6 -contourpy==1.1.1 -cycler==0.12.1 -dill==0.3.8 -Django==4.2.11 -django-request==1.6.3 -exceptiongroup==1.2.1 -filters==1.3.2 -Flask==3.0.2 -fonttools==4.51.0 -h11==0.14.0 -httpcore==1.0.5 -httpx==0.27.0 -idna==3.6 -img==2.5 -importlib-metadata==7.0.1 -importlib_resources==6.4.0 -isort==5.13.2 -itsdangerous==2.1.2 -Jinja2==3.1.3 -kiwisolver==1.4.5 -loguru==0.7.2 -MarkupSafe==2.1.5 -matplotlib==3.7.5 -mccabe==0.7.0 -numpy==1.24.4 -opencv-python==4.9.0.80 -packaging==24.0 -pillow==10.3.0 -platformdirs==4.2.0 -pylint==3.1.0 -pyparsing==3.1.2 -pyTelegramBotAPI==4.16.1 -python-dateutil==2.9.0.post0 -python-dotenv==1.0.1 -python-telegram-bot==21.1.1 -pytz==2024.1 -regex==2024.4.16 -requests==2.31.0 -rfc3986==1.5.0 -six==1.16.0 -sniffio==1.3.1 -sqlparse==0.5.0 -style==1.1.0 -telebot==0.0.5 -tomli==2.0.1 -tomlkit==0.12.4 -typing_extensions==4.10.0 -tzdata==2024.1 -update==0.0.1 -urllib3==2.2.1 -vboxapi==1.0 -Werkzeug==3.0.1 -win32-setctime==1.1.0 -zipp==3.17.0 +pyTelegramBotAPI>=4.12.0 +loguru>=0.7.0 +requests>=2.31.0 +flask>=2.3.2 +matplotlib>=3.7.5 \ No newline at end of file From c5b09973a0232dd1f26794438eb3edd11757cdde Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:50:03 +0300 Subject: [PATCH 66/85] try changes --- build.Jenkinsfile | 20 ++++++++++++-------- deploy.Jenkinsfile | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index ade0efb7..b04c1631 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -14,17 +14,21 @@ pipeline { bat """ @echo off cd polybot - docker login -u %USERNAME% -p %USERPASS% - docker build -t %IMG_NAME% . - docker tag %IMG_NAME% beny14/%IMG_NAME% - docker push beny14/%IMG_NAME% + docker login -u $USERNAME -p $USERPASS + docker build -t $IMG_NAME . + docker tag $IMG_NAME beny14/$IMG_NAME + docker push beny14/$IMG_NAME """ } } } } - stage('Trigger Deploy'){ - steps job: 'polybotdeploy',wait:false, parameters:[ - string(name:'beny14/%IMG_NAME%', value:"beny14/%IMG_NAME%")]} + stage('Trigger Deploy') { + steps { + build job: 'polybotdeploy', wait: false, parameters: [ + string(name: 'IMG_NAME', value: IMG_NAME) + ] + } + } } -} +} \ No newline at end of file diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile index 16aa6869..634aab1a 100644 --- a/deploy.Jenkinsfile +++ b/deploy.Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any parameters { - string(name: 'beny14/polybot', defaultValue: 'INAGE_URL', description: 'deploy polybot') + string(name: 'beny14/polybot:${BUILD_NUMBER}', defaultValue: 'INAGE_URL', description: 'deploy polybot') } stages { From 853ec1ca3174eba46ecc18f4d3b8f60344f60005 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:53:23 +0300 Subject: [PATCH 67/85] try changes --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index b04c1631..7a9f5533 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -26,7 +26,7 @@ pipeline { stage('Trigger Deploy') { steps { build job: 'polybotdeploy', wait: false, parameters: [ - string(name: 'IMG_NAME', value: IMG_NAME) + string(name: 'beny14/$IMG_NAME', value: IMG_NAME) ] } } From 44ca059aa2c60e513d5d5f5878551599d05590d8 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 19:56:04 +0300 Subject: [PATCH 68/85] try changes --- deploy.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile index 634aab1a..54f75863 100644 --- a/deploy.Jenkinsfile +++ b/deploy.Jenkinsfile @@ -8,7 +8,7 @@ pipeline { stages { stage('Deploy') { steps { - sh ''' + bat ''' echo "deploying to k8s cluster ..( or any other alternative)" ''' } From 252177720429f593630de1eab18f1b59d7a77760 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 9 Jun 2024 20:23:42 +0300 Subject: [PATCH 69/85] try changes --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 7a9f5533..8dcae1a0 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -25,7 +25,7 @@ pipeline { } stage('Trigger Deploy') { steps { - build job: 'polybotdeploy', wait: false, parameters: [ + build job: 'deploy_polybot', wait: false, parameters: [ string(name: 'beny14/$IMG_NAME', value: IMG_NAME) ] } From 7fcebd99dceca0dddd923df7492a86c25098b8d3 Mon Sep 17 00:00:00 2001 From: beny1221g <64226437+beny1221g@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:27:10 +0300 Subject: [PATCH 70/85] Update build.Jenkinsfile to work with ubuntu --- build.Jenkinsfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 8dcae1a0..4665cc02 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -11,13 +11,12 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'dockerhub_key', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { script { // Use correct Docker login syntax - bat """ - @echo off + sh """ cd polybot - docker login -u $USERNAME -p $USERPASS - docker build -t $IMG_NAME . - docker tag $IMG_NAME beny14/$IMG_NAME - docker push beny14/$IMG_NAME + docker login -u ${USERNAME} -p ${USERPASS} + docker build -t ${IMG_NAME} . + docker tag ${IMG_NAME} beny14/${IMG_NAME} + docker push beny14/${IMG_NAME} """ } } @@ -31,4 +30,4 @@ pipeline { } } } -} \ No newline at end of file +} From 1735abe4c92491d12e05f9ec8962dc9b3fdcebf4 Mon Sep 17 00:00:00 2001 From: beny1221g <64226437+beny1221g@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:30:11 +0300 Subject: [PATCH 71/85] Update build.Jenkinsfile ubuntu --- build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.Jenkinsfile b/build.Jenkinsfile index 4665cc02..bacbf76b 100644 --- a/build.Jenkinsfile +++ b/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { // Use correct Docker login syntax sh """ cd polybot - docker login -u ${USERNAME} -p ${USERPASS} + echo ${USERPASS} | docker login -u ${USERNAME} --password-stdin docker build -t ${IMG_NAME} . docker tag ${IMG_NAME} beny14/${IMG_NAME} docker push beny14/${IMG_NAME} From e3dcece1ef5dab62dd7438033ef38011285950a1 Mon Sep 17 00:00:00 2001 From: beny1221g <64226437+beny1221g@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:20:28 +0300 Subject: [PATCH 72/85] Update deploy.Jenkinsfile ubuntu update --- deploy.Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile index 54f75863..ada69994 100644 --- a/deploy.Jenkinsfile +++ b/deploy.Jenkinsfile @@ -8,10 +8,10 @@ pipeline { stages { stage('Deploy') { steps { - bat ''' + sh ''' echo "deploying to k8s cluster ..( or any other alternative)" ''' } } } -} \ No newline at end of file +} From 2cf2b9548c0b01677b7583326cf82ccd60e427c6 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 21:44:13 +0300 Subject: [PATCH 73/85] update dirwork --- polybot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index d9dc56c8..738c5011 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.10.12-slim-bullseye # Set the working directory in the container -WORKDIR /app +WORKDIR /var/lib/jenkins/workspace/build_polybot # Copy the requirements file into the container COPY requirements.txt . From 51f20fd254c311c97e2adc472db24fa78c722192 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 22:00:13 +0300 Subject: [PATCH 74/85] update work dir to app --- polybot/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polybot/Dockerfile b/polybot/Dockerfile index 738c5011..a2d749ef 100644 --- a/polybot/Dockerfile +++ b/polybot/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.10.12-slim-bullseye # Set the working directory in the container -WORKDIR /var/lib/jenkins/workspace/build_polybot +WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . @@ -18,4 +18,4 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . # Specify the command to run the application -CMD ["python3", "polybot/bot.py"] \ No newline at end of file +CMD ["python3", "polybot/bot.py"] From 880844091241cc29742a4b9260ed321b90765416 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 22:03:25 +0300 Subject: [PATCH 75/85] as --- polybot/ff.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 polybot/ff.txt diff --git a/polybot/ff.txt b/polybot/ff.txt new file mode 100644 index 00000000..1b9ae7c6 --- /dev/null +++ b/polybot/ff.txt @@ -0,0 +1,2 @@ +asd + From 90333be4f9a25c3c244b1494e40b9cd73d736609 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 22:14:04 +0300 Subject: [PATCH 76/85] sa --- polybot/ff.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 polybot/ff.txt diff --git a/polybot/ff.txt b/polybot/ff.txt deleted file mode 100644 index 1b9ae7c6..00000000 --- a/polybot/ff.txt +++ /dev/null @@ -1,2 +0,0 @@ -asd - From 0d8f71aedb432644fee639dde04e9820f7e5b91b Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 22:16:19 +0300 Subject: [PATCH 77/85] sa --- polybot/ff.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 polybot/ff.txt diff --git a/polybot/ff.txt b/polybot/ff.txt new file mode 100644 index 00000000..dc43f979 --- /dev/null +++ b/polybot/ff.txt @@ -0,0 +1,2 @@ +sa + From 87db54ac9a00d752136a5fce48b4c1f0aaa703ff Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Thu, 13 Jun 2024 22:18:13 +0300 Subject: [PATCH 78/85] as --- polybot/ff.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 polybot/ff.txt diff --git a/polybot/ff.txt b/polybot/ff.txt deleted file mode 100644 index dc43f979..00000000 --- a/polybot/ff.txt +++ /dev/null @@ -1,2 +0,0 @@ -sa - From eb6427fd710d1dc28284004731aa446e388bb847 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sat, 15 Jun 2024 19:12:34 +0300 Subject: [PATCH 79/85] sa --- sd.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 sd.txt diff --git a/sd.txt b/sd.txt new file mode 100644 index 00000000..e539a958 --- /dev/null +++ b/sd.txt @@ -0,0 +1 @@ +as From 50dd9bf09abd0d639216c50d71db21dc8c2c593c Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 19:47:17 +0300 Subject: [PATCH 80/85] add pr-testing.jenkisfile --- pr-testing.Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pr-testing.Jenkinsfile diff --git a/pr-testing.Jenkinsfile b/pr-testing.Jenkinsfile new file mode 100644 index 00000000..15b0a0be --- /dev/null +++ b/pr-testing.Jenkinsfile @@ -0,0 +1,32 @@ + +pipeline { + + + agent any + + stages { + stage('Unittest'){ + steps{ + sh 'echo "testing"' + } + } + stage('Lint') { + steps { + sh ''' + cd polybot + pip install -r requirements.txt + python3 -m plint *.py + ''' + } + } + + stage('Functional test') { + steps { + sh 'echo "testing"' + } + } + + + + } +} From e0dc90d69f62abb2bf6642f63e762d2ac86a5c88 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 19:49:22 +0300 Subject: [PATCH 81/85] add pr-testing.jenkisfile --- pr-testing.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr-testing.Jenkinsfile b/pr-testing.Jenkinsfile index 15b0a0be..fc77e43c 100644 --- a/pr-testing.Jenkinsfile +++ b/pr-testing.Jenkinsfile @@ -22,7 +22,7 @@ pipeline { stage('Functional test') { steps { - sh 'echo "testing"' + sh 'echo "testing "' } } From 4fbb219eaf5df75c384dfe72481b6d329dfabd0f Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 19:57:22 +0300 Subject: [PATCH 82/85] add to req --- polybot/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polybot/requirements.txt b/polybot/requirements.txt index 9e381578..1995fc9e 100644 --- a/polybot/requirements.txt +++ b/polybot/requirements.txt @@ -2,4 +2,5 @@ pyTelegramBotAPI>=4.12.0 loguru>=0.7.0 requests>=2.31.0 flask>=2.3.2 -matplotlib>=3.7.5 \ No newline at end of file +matplotlib>=3.7.5 +pylint>-3.2.3 From 8ae046ee9e65b91bfd8a7b6568ce7e2d24a9499e Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 20:22:45 +0300 Subject: [PATCH 83/85] ad --- hi.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 hi.txt diff --git a/hi.txt b/hi.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/hi.txt @@ -0,0 +1 @@ + From b53f5373f7cff431511ab439f1db0ece76c0b8b0 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 20:28:54 +0300 Subject: [PATCH 84/85] update --- pr-testing.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr-testing.Jenkinsfile b/pr-testing.Jenkinsfile index fc77e43c..10a6b34c 100644 --- a/pr-testing.Jenkinsfile +++ b/pr-testing.Jenkinsfile @@ -15,7 +15,7 @@ pipeline { sh ''' cd polybot pip install -r requirements.txt - python3 -m plint *.py + python -m pylint *.py ''' } } From f10d534d1d14005c4719a50cb484de3ad601da60 Mon Sep 17 00:00:00 2001 From: "BZ\\beny1" Date: Sun, 16 Jun 2024 20:31:26 +0300 Subject: [PATCH 85/85] update --- polybot/requirements.txt | 2 +- pr-testing.Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polybot/requirements.txt b/polybot/requirements.txt index 1995fc9e..b727fa06 100644 --- a/polybot/requirements.txt +++ b/polybot/requirements.txt @@ -3,4 +3,4 @@ loguru>=0.7.0 requests>=2.31.0 flask>=2.3.2 matplotlib>=3.7.5 -pylint>-3.2.3 +pylint>=3.2.3 diff --git a/pr-testing.Jenkinsfile b/pr-testing.Jenkinsfile index 10a6b34c..9c78e48a 100644 --- a/pr-testing.Jenkinsfile +++ b/pr-testing.Jenkinsfile @@ -15,7 +15,7 @@ pipeline { sh ''' cd polybot pip install -r requirements.txt - python -m pylint *.py + python3 -m pylint *.py ''' } }