On Wed, Dec 16, 2020 at 07:56:34PM +0800, Li Ping wrote:
On Wed, Dec 16, 2020 at 03:37:09PM +0800, Wei Jihui wrote:
the key of upload results is changed from access_key to job id
Signed-off-by: Wei Jihui weijihuiall@163.com
lib/job-init.sh | 2 +- lib/upload.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/job-init.sh b/lib/job-init.sh index 40534af3..dc4a65d9 100755 --- a/lib/job-init.sh +++ b/lib/job-init.sh @@ -55,7 +55,7 @@ setup_result_service()
supports_raw_upload && result_service=raw_upload && return
- is_docker || [ -n "$access_key" ] || {
- is_docker || [ -n "$id" ] || { if [ "$os_mount" = 'nfs' ] || [ -z "$os_mount" ]; then supports_netfs 'nfs' && result_service=$RESULT_SERVER:/result && return elif [ "$os_mount" = 'cifs' ] || [ -z "$os_mount" ]; then
diff --git a/lib/upload.sh b/lib/upload.sh index a5daceda..0115e350 100755 --- a/lib/upload.sh +++ b/lib/upload.sh @@ -78,9 +78,9 @@ upload_one_curl() ( cd $(dirname "$1") dir=$(basename "$1")
if [ -n "$access_key" ]; then
find "$dir" -type d -exec curl -sSf -X MKCOL "$http_url/{}" --cookie "ACCESSKEY=$access_key" \;
find "$dir" -type f -size +0 -exec curl -sSf -T '{}' "$http_url/{}" --cookie "ACCESSKEY=$access_key" \;
if [ -n "$id" ]; then
find "$dir" -type d -exec curl -sSf -X MKCOL "$http_url/{}" --cookie "JOBID=$id" \;
find "$dir" -type f -size +0 -exec curl -sSf -T '{}' "$http_url/{}" --cookie "JOBID=$id" \;
users can upload files or folders regardless of whether the job id exists. what is the function of determing whether the job id exist?
Get the id from the env var, when we run a job lkp will export all the job yaml as the env var.
Thanks, Xueliang
Thanks, Ping
else find "$dir" -type d -exec curl -sSf -X MKCOL "$http_url/{}" \; find "$dir" -type f -size +0 -exec curl -sSf -T '{}' "$http_url/{}" \;
@@ -88,8 +88,8 @@ upload_one_curl() ) else [ -s "$src" ] || return
if [ -n "$$access_key" ]; then
curl -sSf -T "$src" $http_url/ --cookie "ACCESSKEY=$access_key"
if [ -n "$id" ]; then
else curl -sSf -T "$src" $http_url/ ficurl -sSf -T "$src" $http_url/ --cookie "JOBID=$id"
@@ -111,8 +111,8 @@ upload_files_curl() for dir in $(echo $target_directory | tr '/' ' ') do job_result_root=$job_result_root/$dir/
if [ -n "$$access_key" ]; then
curl -sSf -X MKCOL "$http_host$job_result_root" --cookie "ACCESSKEY=$access_key" >/dev/null
if [ -n "$id" ]; then
curl -sSf -X MKCOL "$http_host$job_result_root" --cookie "JOBID=$id" >/dev/null else curl -sSf -X MKCOL "$http_host$job_result_root" >/dev/null fi
@@ -178,12 +178,12 @@ upload_files() upload_files_copy "$@" return }
if has_cmd rsync && has_rsync_server && [ -z "$access_key" ]; then
fiif has_cmd rsync && has_rsync_server && [ -z "$id" ]; then upload_files_rsync "$@" return
if has_cmd lftp && [ -z "$access_key" ]; then
fiif has_cmd lftp && [ -z "$id" ]; then upload_files_lftp "$@" return
-- 2.23.0