Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prod_build_cellframe-node
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
cellframe
prod_build_cellframe-node
Commits
fb93cb79
Commit
fb93cb79
authored
9 months ago
by
Dmitry Puzyrkov
Browse files
Options
Downloads
Patches
Plain Diff
...
parent
4cf81fe5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pack.sh
+34
-27
34 additions, 27 deletions
pack.sh
with
34 additions
and
27 deletions
pack.sh
+
34
−
27
View file @
fb93cb79
#!/bin/bash
set
-e
#!/bin/bash -e
SOURCE
=
${
BASH_SOURCE
[0]
}
while
[
-L
"
$SOURCE
"
]
;
do
# resolve $SOURCE until the file is no longer a symlink
TARGET
=
$(
readlink
"
$SOURCE
"
)
if
[[
$TARGET
==
/
*
]]
;
then
echo
"SOURCE '
$SOURCE
' is an absolute symlink to '
$TARGET
'"
SOURCE
=
$TARGET
else
DIR
=
$(
dirname
"
$SOURCE
"
)
echo
"SOURCE '
$SOURCE
' is a relative symlink to '
$TARGET
' (relative to '
$DIR
')"
SOURCE
=
$DIR
/
$TARGET
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
echo
"SOURCE is '
$SOURCE
'"
RDIR
=
$(
dirname
"
$SOURCE
"
)
DIR
=
$(
cd
-P
"
$(
dirname
"
$SOURCE
"
)
"
>
/dev/null 2>&1
&&
pwd
)
HERE
=
"
$DIR
"
set
-e
if
[
${
0
:0:1
}
=
"/"
]
;
then
HERE
=
`
dirname
$0
`
else
CMD
=
`
pwd
`
/
$0
HERE
=
`
dirname
${
CMD
}
`
fi
export
SOURCES
=
${
HERE
}
/../
...
...
@@ -30,9 +20,9 @@ containsElement () {
Help
()
{
echo
"cellframe-
node
pack"
echo
"Usage: pack.sh [--target
linux | windows | android] [release | debug
]"
echo
"--sign PATH should provide a path to file with env variables
ANDROID_KEYSTORE_PATH, ANDROID_KEYSTORE_ALIAS, ANDROID_KEYSTORE_PASS for apk signing
"
echo
"cellframe-
dashboard
pack"
echo
"Usage: pack.sh [--target
${
TARGETS
}
] [
${
BUILD_TYPES
}
] [OPTIONS
]"
echo
"--sign PATH should provide a path to file with env variables"
}
POSITIONAL_ARGS
=()
...
...
@@ -49,6 +39,11 @@ while [[ $# -gt 0 ]]; do
shift
# past argument
shift
# past value
;;
-s
|
--sign
)
SIGNCONFIG
=
"
$2
"
shift
# past argument
shift
# past value
;;
*
)
POSITIONAL_ARGS+
=(
"
$1
"
)
# save positional arg
shift
# past argument
...
...
@@ -60,13 +55,11 @@ set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
#all base logic from here
BUILD_TYPE
=
"
${
1
:-
release
}
"
BUILD_OPTIONS
=
"
${
@
:2
}
"
BUILD_TARGET
=
"
${
TARGET
:-
linux
}
"
#validate input params
.
${
HERE
}
/validate.sh
VALIDATE_TARGET
$TARGET
...
...
@@ -77,15 +70,29 @@ BUILD_DIR=${PWD}/build_${BUILD_TARGET}_${BUILD_TYPE}/build
OUT_DIR
=
${
PWD
}
/build_
${
BUILD_TARGET
}
_
${
BUILD_TYPE
}
/
#we care only about dist dir, i think
[
!
-d
${
DIST_DIR
}
]
&&
{
echo
"No build found:
$BRAND
$BUILD_TARGET
"
&&
exit
255
;
}
[
!
-d
${
DIST_DIR
}
]
&&
{
echo
"No build found:
$BUILD_TARGET
"
&&
exit
255
;
}
if
[
-z
"
$SIGNCONFIG
"
]
then
echo
"No SIGNCONFIG provided. Packages will NOT be signed"
else
if
[
-f
"
$SIGNCONFIG
"
]
then
echo
"Using sign-config from [
${
SIGNCONFIG
}
]"
source
$SIGNCONFIG
else
echo
"[
${
SIGNCONFIG
}
] sign config not found"
exit
255
fi
fi
echo
"Pack [
${
BUILD_TYPE
}
] binaries for [
$BUILD_TARGET
] from [
${
DIST_DIR
}
] to [
${
OUT_DIR
}
]"
.
${
HERE
}
/packaging/
${
BUILD_TARGET
}
.sh
PACK
${
DIST_DIR
}
${
BUILD_DIR
}
${
OUT_DIR
}
PACK
${
DIST_DIR
}
${
BUILD_DIR
}
${
OUT_DIR
}
${
BUILD_TYPE
}
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