Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
clients
Cesium-grp
Cesium
Commits
4099b166
Commit
4099b166
authored
8 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
New install.sh script
parent
2cc1bd63
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
install.sh
+95
-0
95 additions, 0 deletions
install.sh
release.sh
+5
-8
5 additions, 8 deletions
release.sh
with
100 additions
and
8 deletions
install.sh
0 → 100755
+
95
−
0
View file @
4099b166
#!/bin/bash
{
# this ensures the entire script is downloaded #
is_installed
()
{
type
"
$1
"
>
/dev/null 2>&1
}
if
[
"_
$1
"
!=
"_"
]
;
then
CESIUM_DIR
=
"
$1
"
fi
if
[
-z
"
$CESIUM_DIR
"
]
;
then
DIRNAME
=
`
pwd
`
CESIUM_DIR
=
"
$DIRNAME
/cesium"
fi
latest_version
()
{
echo
"0.2.5"
}
api_release_url
()
{
echo
"https://api.github.com/repos/duniter/cesium/releases/tags/v
$(
latest_version
)
"
}
download
()
{
if
is_installed
"curl"
;
then
curl
-qkL
$*
elif
is_installed
"wget"
;
then
# Emulate curl with wget
ARGS
=
$(
echo
"
$*
"
|
command sed
-e
's/--progress-bar /--progress=bar /'
\
-e
's/-L //'
\
-e
's/-I /--server-response /'
\
-e
's/-s /-q /'
\
-e
's/-o /-O /'
\
-e
's/-C - /-c /'
)
wget
$ARGS
fi
}
install_from_github
()
{
local
RELEASE
=
`
curl
-XGET
-i
$(
api_release_url
)
`
local
CESIUM_URL
=
`
echo
"
$RELEASE
"
|
grep
-P
"
\"
browser_download_url
\"
:
\"
[^
\"
]+"
|
grep
-oP
"https://[a-zA-Z0-9/.-]+-web.zip"
`
local
CESIUM_ARCHIVE
=
$CESIUM_DIR
/cesium.zip
if
[
-d
"
$CESIUM_DIR
"
]
;
then
if
[
-f
"
$CESIUM_ARCHIVE
"
]
;
then
echo
"WARNING: Deleting existing file:
$CESIUM_ARCHIVE
"
rm
$CESIUM_ARCHIVE
fi
else
mkdir
-p
"
$CESIUM_DIR
"
fi
echo
"=> Downloading Cesium from
$CESIUM_URL
"
echo
" to
$CESIUM_ARCHIVE
"
download
"
$CESIUM_URL
"
-o
"
$CESIUM_ARCHIVE
"
||
{
echo
>
&2
"Failed to download '
$CESIUM_URL
'"
return
4
}
echo
"=> Unarchive to
$CESIUM_DIR
"
unzip
$CESIUM_ARCHIVE
-d
$CESIUM_DIR
rm
$CESIUM_ARCHIVE
echo
echo
"Cesium successfully installed at
$CESIUM_DIR
"
}
do_install
()
{
if
!
is_installed
"curl"
;
then
echo
"=> curl is not available. You will likely need to install 'curl' package."
exit
1
fi
if
!
is_installed
"unzip"
;
then
echo
"=> unzip is not available. You will likely need to install 'unzip' package."
exit
1
fi
install_from_github
}
#
# Unsets the various functions defined
# during the execution of the install script
#
reset
()
{
unset
-f
reset is_installed latest_version
\
download install_from_github do_install
}
[
"_
$CESIUM_ENV
"
=
"_testing"
]
||
do_install
$1
}
# this ensures the entire script is downloaded #
This diff is collapsed.
Click to expand it.
release.sh
+
5
−
8
View file @
4099b166
...
@@ -24,6 +24,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
...
@@ -24,6 +24,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
sed
-i
"s/version
\"
:
\"
$current
/version
\"
:
\"
$2
/g"
package.json
sed
-i
"s/version
\"
:
\"
$current
/version
\"
:
\"
$2
/g"
package.json
sed
-i
"s/ version=
\"
.*
\"
/ version=
\"
$2
\"
/g"
config.xml
sed
-i
"s/ version=
\"
.*
\"
/ version=
\"
$2
\"
/g"
config.xml
sed
-i
"s/ android-versionCode=
\"
.*
\"
/ android-versionCode=
\"
$3
\"
/g"
config.xml
sed
-i
"s/ android-versionCode=
\"
.*
\"
/ android-versionCode=
\"
$3
\"
/g"
config.xml
# Bump the install.sh
sed
-i
"s/echo
\"
v
$current
\"
/echo
\"
v
$2
\"
/g"
install.sh
;;
;;
*
)
*
)
echo
"No task given"
echo
"No task given"
...
@@ -35,7 +38,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
...
@@ -35,7 +38,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
# Commit
# Commit
git reset HEAD
git reset HEAD
git add package.json config.xml
git add package.json config.xml
install.sh
git commit
-m
"v
$2
"
git commit
-m
"v
$2
"
git tag
"v
$2
"
git tag
"v
$2
"
git push
git push
...
@@ -46,13 +49,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
...
@@ -46,13 +49,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
gulp build:web
--release
gulp build:web
--release
echo
"**********************************"
echo
"**********************************"
echo
"* Build release
$2
succeed !"
echo
"* Build release
$2
sucees !"
echo
"* "
echo
"* "
echo
"* Now please deploy files to github using:"
echo
"* "
echo
"* > ./github.sh pre|rel user:pwd"
echo
"* "
echo
"**********************************"
echo
"**********************************"
else
else
echo
"Wrong version format"
echo
"Wrong version format"
...
...
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