Skip to content
Snippets Groups Projects
Unverified Commit c386b15f authored by Massimiliano Adamo's avatar Massimiliano Adamo
Browse files

testing git tags

parent 0a7975f6
No related branches found
No related tags found
No related merge requests found
Pipeline #29419 passed
......@@ -20,7 +20,7 @@ upload_linux_binary:
only:
- tags
script:
- ./build.sh --os=linux --arch=amd64 --upx
- ./build.sh --os=linux --arch=amd64 --version=$CI_COMMIT_TAG --upx
- 'curl --header "JOB-TOKEN: $PROJECT_ACCESS_TOKEN" --upload-file $CI_PROJECT_NAME "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}"'
tags:
- visnu_shell
......@@ -11,7 +11,7 @@ unset GOBIN
BIN_NAME=acme-downloader
PATH=$PATH:$(go env GOPATH)/bin
GOPATH=$(go env GOPATH)
PROG_VERSION="1.0"
#PROG_VERSION="1.0"
BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
REPO_DIR=$(dirname $0)
if [ "$REPO_DIR" = '.' ]; then
......@@ -30,6 +30,7 @@ usage() {
echo " --arch=ARCH (Compile binary for this Architecture)"
echo " --upx (Enable UPX compression)"
echo " --no-upx (Disable UPX compression)"
echo " --version (Version number. If not used it will be the latest tag)"
echo ""
echo " Below is a list of supported OS/Arch combinations:"
echo "OS ARCH"
......@@ -37,7 +38,7 @@ usage() {
exit
}
OPTS=$(getopt -o "h" --longoptions "help,os:,arch:,upx,no-upx" -- "$@")
OPTS=$(getopt -o "h" --longoptions "help,os:,arch:,upx,no-upx:,version:" -- "$@")
eval set -- "$OPTS"
while true; do
......@@ -59,6 +60,10 @@ while true; do
--no-upx)
NOUPX='NOUPX'
;;
--version)
shift
VERSION="$1"
;;
--)
shift
break
......@@ -67,6 +72,12 @@ while true; do
shift
done
if [ -z $VERSION ]; then
PROG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
else
PROG_VERSION=$(echo $PROG_VERSION | tr -f v)
fi
if [ -z $OS ] || [ -z $ARCH ]; then
echo -e "\nYou need to supply OS and Architecture\n"
usage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment