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
167423b7
Unverified
Commit
167423b7
authored
4 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
rename scripts
parent
ffda86e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build-binary-for-linux-64.sh
+6
-6
6 additions, 6 deletions
build-binary-for-linux-64.sh
build-binary-for-win-64.sh
+25
-23
25 additions, 23 deletions
build-binary-for-win-64.sh
with
31 additions
and
29 deletions
build.sh
→
build
-binary-for-linux-64
.sh
+
6
−
6
View file @
167423b7
...
...
@@ -11,11 +11,11 @@ export BIN_NAME PATH GOPATH PROG_VERSION BUILDTIME
REPO_DIR
=
$(
dirname
$0
)
if
[
"
$REPO_DIR
"
=
'.'
]
;
then
REPO_DIR
=
`
pwd
`
REPO_DIR
=
$(
pwd
)
fi
ln
-sf
"
$REPO_DIR
"
"
${
GOPATH
}
/src/"
REPO_NAME
=
$(
basename
"
$REPO_DIR
"
)
cd
$REPO_NAME
cd
"
${
GOPATH
}
/src/
$REPO_NAME
"
#LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
#PROG_VERSION=$(echo $LATEST_TAG | sed -e 's/^v//')
...
...
@@ -29,9 +29,6 @@ run_upx() {
upx
--brute
${
GOPATH
}
/bin/
${
BIN_NAME
}
}
rm
-rf
${
GOPATH
}
/src/github.com/maxadamo/
${
BIN_NAME
}
${
GOPATH
}
/src/gitlab.geant.net/devops/
${
BIN_NAME
}
#go get -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" gitlab.geant.net/devops/${BIN_NAME}
go get
-ldflags
"-s -w -X main.appVersion=
${
PROG_VERSION
}
-X main.buildTime=
${
BUILDTIME
}
"
.
if
[
$?
-gt
0
]
;
then
echo
-e
"
\n
there was an error while compiling the code
\n
"
...
...
@@ -40,6 +37,7 @@ fi
echo
""
while
true
;
do
echo
-e
"
\n
UPX degrades performances but in the case of acme-downloader it is not noticeable
\n
"
read
-p
"Do you wish to run upx against
${
BIN_NAME
}
? (y/n) "
yn
case
$yn
in
[
Yy]
*
)
...
...
@@ -48,7 +46,9 @@ while true; do
break
;;
[
Nn]
*
)
break
;;
*
)
echo
"Please answer yes or no."
;;
*
)
echo
"Please answer Y|y or N|n."
;;
esac
done
...
...
This diff is collapsed.
Click to expand it.
build-
w
in
dows-amd
64.sh
→
build-
b
in
ary-for-win-
64.sh
+
25
−
23
View file @
167423b7
...
...
@@ -17,35 +17,37 @@ ln -sf "$REPO_DIR" "${GOPATH}/src/"
REPO_NAME
=
$(
basename
"
$REPO_DIR
"
)
cd
"
${
GOPATH
}
/src/
$REPO_NAME
"
run_upx
()
{
if
!
which upx &>/dev/null
;
then
echo
"please download upx here https://github.com/upx/upx/releases"
echo
"and store the executable within your
\$
PATH"
exit
fi
upx
--brute
${
GOPATH
}
/bin/
${
BIN_NAME
}
}
# env GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.appVersion=${PROG_VERSION} -X main.buildTime=${BUILDTIME}" .
env
GOOS
=
windows
GOARCH
=
amd64 go get
-ldflags
"-s -w -X main.appVersion=
${
PROG_VERSION
}
-X main.buildTime=
${
BUILDTIME
}
"
.
if
[
$?
-gt
0
]
;
then
echo
-e
"
\n
there was an error while compiling the code
\n
"
exit
fi
echo
""
#run_upx() {
# if ! which upx &>/dev/null; then
# echo "please download upx here https://github.com/upx/upx/releases"
# echo "and store the executable within your \$PATH"
# exit
# fi
# upx --brute ${GOPATH}/bin/${BIN_NAME}
#}
#while true; do
# read -p "Do you wish to run upx against ${BIN_NAME}? (y/n) " yn
# case $yn in
# [Yy]*)
# echo ""
# run_upx
# break
# ;;
# [Nn]*) break ;;
# *) echo "Please answer yes or no." ;;
# esac
#done
while
true
;
do
echo
-e
"
\n
UPX degrades performances but in the case of acme-downloader it is not noticeable
\n
"
read
-p
"Do you wish to run upx against
${
BIN_NAME
}
? (y/n) "
yn
case
$yn
in
[
Yy]
*
)
echo
""
run_upx
break
;;
[
Nn]
*
)
break
;;
*
)
echo
"Please answer Y|y or N|n."
;;
esac
done
#echo -e "\nthe binary was compiled and it is avilable as:\n - ${GOPATH}/bin/${BIN_NAME}\n"
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