28 lines
852 B
Bash
28 lines
852 B
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
# Define the base URL and the token
|
||
|
|
TOKEN="glpat-7dM-zghnyabwY6cJyuhw"
|
||
|
|
PROJECT_ID="47"
|
||
|
|
PACKAGE_NAME="filemanager"
|
||
|
|
OUTPUT_FILE="$PACKAGE_NAME.tar.gz"
|
||
|
|
VERSION=$1
|
||
|
|
|
||
|
|
# Construct the URL
|
||
|
|
URL="https://gitlab.luranasoft.com/api/v4/projects/$PROJECT_ID/packages/generic/filemanager/$VERSION/$PACKAGE_NAME-$VERSION.tar.gz"
|
||
|
|
|
||
|
|
# Download the file using curl
|
||
|
|
echo "Download $OUTPUT_FILE from $URL"
|
||
|
|
curl --header "PRIVATE-TOKEN: $TOKEN" "$URL" --output "$OUTPUT_FILE"
|
||
|
|
|
||
|
|
ls -lhs $OUTPUT_FILE
|
||
|
|
|
||
|
|
# Check if the download was successful
|
||
|
|
if [ $? -eq 0 ]; then
|
||
|
|
echo "Download completed successfully."
|
||
|
|
|
||
|
|
mkdir -p workflow/public_html/fileManager
|
||
|
|
tar -xzf filemanager.tar.gz -C workflow/public_html/fileManager
|
||
|
|
ls -lhs workflow/public_html/fileManager
|
||
|
|
else
|
||
|
|
echo "Failed to download $OUTPUT_FILE. Please check the version number and try again."
|
||
|
|
fi
|