2019-03-08

GitHub download file from Private Repository

#!/bin/bash
#/opt/script/github-download-file.sh
#LastUpdate: #14:53 2019.03.08
#######################################
#__________GitHub_Global_Variable:BEGIN
TOKEN=""
USER_NAME=""
REPO_NAME=""
BRANCHE_NAME="master"

FILE_NAME="openssl-1.1.0h-portable-OPT-20180716-1.7z"
FILE_URL="https://raw.githubusercontent.com/$USER_NAME/$REPO_NAME/$BRANCHE_NAME/$FILE_NAME"
#__________GitHub_Global_Variable:END


#__________Deploy:BEGIN
cd /opt/setup;
curl -H "Authorization: token $TOKEN" $FILE_URL -o $FILE_NAME
#UNCOMPRESS $FILE_NAME
#__________Deploy:END


#THE-END


#REF:
#1/ Download a file:
#curl -H "Authorization: token $TOKEN" $FILE_URL -o $FILE_NAME

#2/ Download a directory:
#wget --no-parent -r h t t p://domain.abc/DIRECTORY

#3/ h ttps://stackoverflow.com/questions/11783280/downloading-all-the-files-in-a-directory-with-curl
If you're not bound to curl, you might want to use wget in recursive mode but restricting it to one level of recursion, try the following:
wget --no-verbose --no-parent --recursive --level=1\ --no-directories --user=login --password=pass ftp://ftp.myftpsite.com/
--no-parent : Do not ever ascend to the parent directory when retrieving recursively. 
--level=depth : Specify recursion maximum depth level depth. The default maximum depth is five layers. 
--no-directories : Do not create a hierarchy of directories when retrieving recursively.
#

3 comments:

  1. The first phase the preparation should, theoretically, be uninfluenced by the intended intensity and duration of the sound which is subsequently produced. In fact, however, so quickly are the three phases accomplished that the pianist rarely has capacity to think, in performance, of each phase separately. Hack APP Data APK

    ReplyDelete
  2. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. Car with driver in Marseille

    ReplyDelete
  3. Who has access to it, what law protects it from unintended use and what projects may branch out of it. automatic github contributions

    ReplyDelete