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
18f1a113
Commit
18f1a113
authored
6 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Fix release script
parent
ae8484e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#3085
passed
6 years ago
Stage: github-sync
Stage: build
Stage: publish
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
github.sh
+6
-5
6 additions, 5 deletions
github.sh
release.sh
+48
-44
48 additions, 44 deletions
release.sh
with
54 additions
and
49 deletions
github.sh
+
6
−
5
View file @
18f1a113
...
...
@@ -5,7 +5,7 @@ branch=`git rev-parse --abbrev-ref HEAD`
if
[[
!
"
$branch
"
=
"master"
]]
;
then
echo
">> This script must be run under
\`
master
\`
branch"
exit
exit
-1
fi
...
...
@@ -25,7 +25,7 @@ else
echo
"Unable to find github authentifcation token file: "
echo
" - You can create such a token at https://github.com/settings/tokens > 'Generate a new token'."
echo
" - Then copy the token and paste it in the file '~/.config/duniter/.github' using a valid token."
exit
exit
-1
fi
case
"
$1
"
in
...
...
@@ -46,7 +46,7 @@ case "$1" in
else
prerelease
=
"false"
fi
description
=
`
echo
$2
`
description
=
"
$2
"
result
=
`
curl
-s
-H
''
"
$GITHUT_AUTH
"
''
"
$REPO_URL
/releases/tags/v
$current
"
`
release_url
=
`
echo
"
$result
"
|
grep
-P
"
\"
url
\"
:
\"
[^
\"
]+"
|
grep
-oP
"https://[A-Za-z0-9/.-]+/releases/
\d
+"
`
...
...
@@ -56,7 +56,7 @@ case "$1" in
if
[[
"_
$result
"
!=
"_"
]]
;
then
error_message
=
`
echo
"
$result
"
|
grep
-P
"
\"
message
\"
:
\"
[^
\"
]+"
|
grep
-oP
":
\"
[^
\"
]+
\"
"
`
echo
"Delete existing release failed with error
$error_message
"
exit
exit
-1
fi
else
echo
"Release not exists yet on github."
...
...
@@ -84,11 +84,12 @@ case "$1" in
echo
"With:"
echo
" - pre: use for pre-release"
echo
" - rel: for full release"
exit
exit
-1
fi
;;
*
)
echo
"No task given"
exit
-1
;;
esac
...
...
This diff is collapsed.
Click to expand it.
release.sh
+
48
−
44
View file @
18f1a113
...
...
@@ -5,7 +5,7 @@ branch=`git rev-parse --abbrev-ref HEAD`
if
[[
!
"
$branch
"
=
"master"
]]
;
then
echo
">> This script must be run under
\`
master
\`
branch"
exit
exit
-1
fi
DIRNAME
=
`
pwd
`
...
...
@@ -37,6 +37,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
;;
*
)
echo
"No task given"
exit
-1
;;
esac
...
...
@@ -49,6 +50,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
if
[
-d
"
$NVM_DIR
"
]
;
then
.
$NVM_DIR
/nvm.sh
nvm use 5
if
[
$?
-ne
0
]
;
then
exit
-1
fi
else
echo
"nvm (Node version manager) not found (directory
$NVM_DIR
not found). Please install, and retry"
exit
-1
...
...
@@ -66,8 +70,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
echo
"- Building Android artifact..."
echo
"----------------------------------"
ionic build android
--release
#ionic build firefoxos --release
if
[
$?
-ne
0
]
;
then
exit
-1
fi
echo
"----------------------------------"
echo
"- Building web artifact..."
...
...
@@ -76,29 +81,42 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
# Update config file
gulp config
--env
default
gulp build:web
--release
cd
$DIRNAME
if
[
$?
-ne
0
]
;
then
exit
-1
fi
echo
"----------------------------------"
echo
"- Executing git push, with tag: v
$2
"
echo
"----------------------------------"
# Commit
cd
$DIRNAME
git reset HEAD
git add package.json config.xml install.sh www/js/config.js www/manifest.json
git commit
-m
"v
$2
"
git tag
"v
$2
"
git push
if
[
$?
-ne
0
]
;
then
exit
-1
fi
# Pause (wait propagation to from git.duniter.org to github)
echo
" Waiting 30s, for propagation to github..."
sleep
30s
if
[[
"_
$4
"
!=
"_"
]]
;
then
description
=
"
$4
"
if
[[
"_
$description
"
==
"_"
]]
;
then
description
=
"Release v
$1
"
fi
echo
"**********************************"
echo
"* Uploading artifacts to Github..."
echo
"**********************************"
./github.sh
$1
''
"
$4
"
''
./github.sh
$1
''
"
$description
"
''
if
[
$?
-ne
0
]
;
then
exit
-1
fi
echo
"----------------------------------"
echo
"- Building desktop versions..."
...
...
@@ -117,6 +135,9 @@ cesium-desktop-v$2-linux-x64.tar.gz"
export
EXPECTED_ASSETS
./release.sh
$2
if
[
$?
-ne
0
]
;
then
exit
-1
fi
# back to nodejs version 5
cd
$DIRNAME
...
...
@@ -125,23 +146,6 @@ cesium-desktop-v$2-linux-x64.tar.gz"
echo
"**********************************"
echo
"* Build release succeed !"
echo
"**********************************"
else
echo
"**********************************"
echo
"* Build release succeed !"
echo
"**********************************"
echo
" WARN - missing arguments 'release_description'"
echo
echo
" Binaries files NOT sending to github repository"
echo
" Please run:"
echo
" > ./github.sh pre|rel 'release_description'"
echo
echo
" Desktop artifact are NOT build"
echo
" Please run:"
echo
" > platforms/desktop/release.sh <version>"
echo
fi
else
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