forked from ungleich-public/cdist
		
	Add build-helper param for existing archive for sign-git-tag target.
This commit is contained in:
		
					parent
					
						
							
								9286850098
							
						
					
				
			
			
				commit
				
					
						317622678a
					
				
			
		
					 2 changed files with 36 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -176,21 +176,27 @@ eof
 | 
			
		|||
    ;;
 | 
			
		||||
 | 
			
		||||
    sign-git-tag)
 | 
			
		||||
        if [ $# -lt 3 ]
 | 
			
		||||
        if [ $# -lt 2 ]
 | 
			
		||||
        then
 | 
			
		||||
            printf "usage: $0 sign-git-tag TAG AUTHTOKEN\n"
 | 
			
		||||
            printf "usage: $0 sign-git-tag TAG TOKEN [ARCHIVE]\n"
 | 
			
		||||
            printf "    if ARCHIVE is not specified then it is created\n"
 | 
			
		||||
            exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        tag="$2"
 | 
			
		||||
        tag="$1"
 | 
			
		||||
        if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
 | 
			
		||||
        then
 | 
			
		||||
            printf "Tag \"${tag}\" not found.\n"
 | 
			
		||||
            exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        token="$3"
 | 
			
		||||
        token="$2"
 | 
			
		||||
        if [ $# -ge 2 ]
 | 
			
		||||
        then
 | 
			
		||||
            archivename="$3"
 | 
			
		||||
        else
 | 
			
		||||
            archivename="cdist-${tag}.tar.gz"
 | 
			
		||||
            git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
 | 
			
		||||
                || exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        gpg --armor --detach-sign "${archivename}" || exit 1
 | 
			
		||||
 | 
			
		||||
        # make github release
 | 
			
		||||
| 
						 | 
				
			
			@ -217,7 +223,11 @@ eof
 | 
			
		|||
            || exit 1
 | 
			
		||||
 | 
			
		||||
        # remove generated files (archive and asc)
 | 
			
		||||
        rm -f "${archivename}" "${archivename}.asc"
 | 
			
		||||
        if [ $# -ge 2]
 | 
			
		||||
        then
 | 
			
		||||
            rm -f "${archivename}"
 | 
			
		||||
        fi
 | 
			
		||||
        rm -f "${archivename}.asc"
 | 
			
		||||
    ;;
 | 
			
		||||
 | 
			
		||||
    release)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -211,21 +211,27 @@ eof
 | 
			
		|||
    ;;
 | 
			
		||||
 | 
			
		||||
    sign-git-tag)
 | 
			
		||||
        if [ $# -lt 3 ]
 | 
			
		||||
        if [ $# -lt 2 ]
 | 
			
		||||
        then
 | 
			
		||||
            printf "usage: $0 sign-git-tag TAG TOKEN\n"
 | 
			
		||||
            printf "usage: $0 sign-git-tag TAG TOKEN [ARCHIVE]\n"
 | 
			
		||||
            printf "    if ARCHIVE is not specified then it is created\n"
 | 
			
		||||
            exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        tag="$2"
 | 
			
		||||
        tag="$1"
 | 
			
		||||
        if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1
 | 
			
		||||
        then
 | 
			
		||||
            printf "Tag \"${tag}\" not found.\n"
 | 
			
		||||
            exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        token="$3"
 | 
			
		||||
        token="$2"
 | 
			
		||||
        if [ $# -ge 2 ]
 | 
			
		||||
        then
 | 
			
		||||
            archivename="$3"
 | 
			
		||||
        else
 | 
			
		||||
            archivename="cdist-${tag}.tar.gz"
 | 
			
		||||
            git archive --prefix="cdist-${tag}" -o "${archivename}" "${tag}" \
 | 
			
		||||
                || exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        gpg --armor --detach-sign "${archivename}" || exit 1
 | 
			
		||||
 | 
			
		||||
        # make github release
 | 
			
		||||
| 
						 | 
				
			
			@ -252,7 +258,11 @@ eof
 | 
			
		|||
            || exit 1
 | 
			
		||||
 | 
			
		||||
        # remove generated files (archive and asc)
 | 
			
		||||
        rm -f "${archivename}" "${archivename}.asc"
 | 
			
		||||
        if [ $# -ge 2]
 | 
			
		||||
        then
 | 
			
		||||
            rm -f "${archivename}"
 | 
			
		||||
        fi
 | 
			
		||||
        rm -f "${archivename}.asc"
 | 
			
		||||
    ;;
 | 
			
		||||
 | 
			
		||||
    release)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue