Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Geant DevOps
Acme Downloader
Commits
c386b15f
Unverified
Commit
c386b15f
authored
3 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
testing git tags
parent
0a7975f6
No related branches found
No related tags found
No related merge requests found
Pipeline
#29419
passed
3 years ago
Stage: upload_linux_binary
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci-psnc.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci-psnc.yml
build.sh
+13
-2
13 additions, 2 deletions
build.sh
with
14 additions
and
3 deletions
.gitlab-ci-psnc.yml
+
1
−
1
View file @
c386b15f
...
...
@@ -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
This diff is collapsed.
Click to expand it.
build.sh
+
13
−
2
View file @
c386b15f
...
...
@@ -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
"
\n
You need to supply OS and Architecture
\n
"
usage
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment