Alon Bar-Lev has posted comments on this change.

Change subject: Collect metadata for packaging jobs.
......................................................................


Patch Set 7:

(4 comments)

http://gerrit.ovirt.org/#/c/23985/7/jobs/packaging/gather_jobs_info.sh
File jobs/packaging/gather_jobs_info.sh:

Line 1: #!/bin/sh
Line 2: 
Line 3: DATE=$(date +"%Y%m%d")
quotes, but better initialize in main
Line 4: 
Line 5: die() {
Line 6:         local m="${1}"
Line 7:         echo "FATAL: ${m}"


Line 43: }
Line 44: 
Line 45: get_meta_data() {
Line 46:        local artifacts_dir="${ARTIFACTS_DIR}"
Line 47:        local job_name="$(echo "${JOB_NAME}" | sed -e 's/\//_/g' -e 
's/\=/_/g')"
s/[\/=/_/g ?
Line 48:        local build_number="${BUILD_NUMBER}"
Line 49:        echo -e "JOB_NAME=${job_name}\nDATE=${DATE}" >> 
"${artifacts_dir}/${job_name}-${build_number}.job-metadata"
Line 50: 
Line 51:        find "${artifacts_dir}" -type f -regex 
".*\(\.gz\|\.bz2\|\.lzma\|\.rpm\)$" | cut -d'/' -f2 >> 
"${artifacts_dir}/${job_name}-${build_number}.job-flist"


Line 45: get_meta_data() {
Line 46:        local artifacts_dir="${ARTIFACTS_DIR}"
Line 47:        local job_name="$(echo "${JOB_NAME}" | sed -e 's/\//_/g' -e 
's/\=/_/g')"
Line 48:        local build_number="${BUILD_NUMBER}"
Line 49:        echo -e "JOB_NAME=${job_name}\nDATE=${DATE}" >> 
"${artifacts_dir}/${job_name}-${build_number}.job-metadata"
please avoid echo -e...

 cat > xxxx << __EOF__
 whatever
 __EOF__

but why do you append?

please use shell annotation so you can source it later...

 JOB_NAME="xxx"
 JOB_DATE="xxx"

then when you read metadata you can simply:

 . "${metadata}"
 echo "${JOB_NAME}"
Line 50: 
Line 51:        find "${artifacts_dir}" -type f -regex 
".*\(\.gz\|\.bz2\|\.lzma\|\.rpm\)$" | cut -d'/' -f2 >> 
"${artifacts_dir}/${job_name}-${build_number}.job-flist"
Line 52: }
Line 53: 


Line 47:        local job_name="$(echo "${JOB_NAME}" | sed -e 's/\//_/g' -e 
's/\=/_/g')"
Line 48:        local build_number="${BUILD_NUMBER}"
Line 49:        echo -e "JOB_NAME=${job_name}\nDATE=${DATE}" >> 
"${artifacts_dir}/${job_name}-${build_number}.job-metadata"
Line 50: 
Line 51:        find "${artifacts_dir}" -type f -regex 
".*\(\.gz\|\.bz2\|\.lzma\|\.rpm\)$" | cut -d'/' -f2 >> 
"${artifacts_dir}/${job_name}-${build_number}.job-flist"
why no just put all files in this list?

for relative, try:

 find "${artifacts_dir}" -printf "%P\n"
Line 52: }
Line 53: 
Line 54: main() {
Line 55:        get_opts "${@}"


-- 
To view, visit http://gerrit.ovirt.org/23985
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ica3339549f0afe284ccdfad3cd083f4efccc880b
Gerrit-PatchSet: 7
Gerrit-Project: jenkins
Gerrit-Branch: master
Gerrit-Owner: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to