From 16f32b5e8a016dafd2cd09314a63506916f4fe1d Mon Sep 17 00:00:00 2001 From: EL KARCHI Jad <jad.el-karchi@inria.fr> Date: Fri, 21 Mar 2025 10:41:24 +0100 Subject: [PATCH] remove add, remove, status commands, testing file push, fetch on rlabkey --- .gitlab-ci.yml | 9 +++++---- bash/rlabkey | 55 +------------------------------------------------- 2 files changed, 6 insertions(+), 58 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8047c8a..dd6b164 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,8 @@ stages : variables: PACKAGE_REGISTRY_PROJECT_ID: $CI_PROJECT_ID PACKAGE_REGISTRY_URL: "$CI_API_V4_URL/projects/$PACKAGE_REGISTRY_PROJECT_ID/packages/generic" - LATEST_TAG : git describe --tags | head -n 1 | cut -d'-' -f1 - ARCHIVE_PATH : ../rlabkey-cli_1.0.0.tar.gz + LATEST_TAG : 1.0.0 + ARCHIVE_PATH : ../rlabkey-cli_$LATEST_TAG.tar.gz upload_to_registry: stage: publish @@ -17,8 +17,9 @@ upload_to_registry: - echo "Starting upload & archiving of project files to the GitLab Package Registry..." - echo $LATEST_TAG - rm -rf ./.git/ .git* ./docs - - mkdir -p rlabkey-cli && cp -r ./* ./rlabkey-cli/ - - tar -czvf $ARCHIVE_PATH ./rlabkey-cli/ + - mkdir -p rlabkey-cli_$LATEST_TAG + - mv ./* ./rlabkey-cli_$LATEST_TAG/ + - tar -czvf $ARCHIVE_PATH ./rlabkey-cli_$LATEST_TAG/ - | filename=$(basename "$ARCHIVE_PATH" .tar.gz); base_name=$(echo "$filename" | cut -d'_' -f1) diff --git a/bash/rlabkey b/bash/rlabkey index b42e933..1366585 100644 --- a/bash/rlabkey +++ b/bash/rlabkey @@ -76,8 +76,6 @@ init_config() { mkdir -p "$RLABKEY_DIR/config/" || error "Failed to create config directory." echo "_webdav folder created." mkdir -p "$RLABKEY_DIR/_webdav/" || error "Failed to create Files directory." - echo "target folder created." - mkdir -p "$RLABKEY_DIR/target/" || error "Failed to create Target directory." touch "$CONFIG_FILE" || error "Failed to create config file." echo "Configuration initialized at $CONFIG_FILE" } @@ -181,15 +179,8 @@ case "$1" in word="ASSAY" fi - echo "Uploading available files as $word to project $PROJECT:" - echo - ls $RLABKEY_DIR/target/ - echo - echo -n "Are you sure you want to upload ? (Y/n): " - read -r response - if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then - for file in "$RLABKEY_DIR/target"/*; do + for file in "$DIR"/*; do echo "Uploading $(basename "$file") as $word ..." Rscript $RLABKEY_DIR/R/push.R "$PROJECT" "$file" $(basename "$file") "$ASSAY" "$DATASET" || error "Failed to push file: $file" done @@ -199,20 +190,6 @@ case "$1" in fi fi ;; - status) - shift - # Check for status-specific help - if [[ "$1" == "--help" || "$1" == "-h" ]]; then - show_status_help - exit 0 - fi - echo "Ready to push datasets :" - echo - ls $RLABKEY_DIR/target/ - echo - - Rscript $RLABKEY_DIR/R/status.R || error "Failed to execute status command." - ;; init) # Check for init-specific help @@ -232,36 +209,6 @@ case "$1" in echo "RLabKey CLI - Version $VERSION" ;; - add) - shift - FILE="" - - while [[ $# -gt 0 ]]; do - case "$1" in - --file) - FILE="$2" - shift 2 - ;; - *) - error "Unknown option: $1" - ;; - esac - done - - cp $FILE $RLABKEY_DIR/target/ && echo "$FILE copied to target." - ;; - - remove) - shift - FILE="" - - if [[ -n $1 ]]; then - FILE=$1 - fi - - rm "$RLABKEY_DIR/target/$FILE" && echo "$1 removed from target." - ;; - *) if [[ -z "$1" ]]; then show_help -- GitLab