4 echo "no .git present. run this from the base dir of the git checkout."
9 [ -z "$version" ] && version
=`git describe --match 'v*' | sed 's/^v//'`
10 outfile
="ceph-$version"
12 echo "version $version"
15 echo "updating submodules..."
16 force
=$
(if git submodule usage
2>&1 |
grep --quiet 'update.*--force'; then echo --force ; fi)
17 if ! git submodule sync ||
! git submodule update
$force --init --recursive; then
18 echo "Error: could not initialize submodule projects"
19 echo " Network connectivity might be required."
28 boost_version_underscore
=$
(echo $boost_version |
sed 's/\./_/g')
29 boost_fname
=boost_
${boost_version_underscore}.
tar.bz2
34 if [ -z $url_base ]; then
35 echo "Error: failed to download boost."
38 url
=$url_base/$boost_fname
39 wget
-c --no-verbose -O $boost_fname $url
40 if [ $?
!= 0 -o ! -e $boost_fname ]; then
41 echo "Download of $url failed"
42 elif [ $
(sha256sum
$boost_fname |
awk '{print $1}') != $boost_sha256 ]; then
43 echo "Error: failed to download boost: SHA256 mismatch."
49 tar xjf
$boost_fname -C src \
50 --exclude="$boost_version_underscore/libs/*/doc" \
51 --exclude="$boost_version_underscore/libs/*/example" \
52 --exclude="$boost_version_underscore/libs/*/examples" \
53 --exclude="$boost_version_underscore/libs/*/meta" \
54 --exclude="$boost_version_underscore/libs/*/test" \
55 --exclude="$boost_version_underscore/tools/boostbook" \
56 --exclude="$boost_version_underscore/tools/quickbook" \
57 --exclude="$boost_version_underscore/tools/auto_index" \
58 --exclude='doc' --exclude='more' --exclude='status'
59 mv src
/boost_
${boost_version_underscore} src
/boost
60 tar cf
${outfile}.boost.
tar ${outfile}/src
/boost
64 _python_autoselect
() {
66 for interpreter
in python2.7 python3
; do
67 type $interpreter > /dev
/null
2>&1 ||
continue
68 python_command
=$interpreter
71 if [ -z "$python_command" ] ; then
72 echo "Could not find a suitable python interpreter! Bailing out."
78 build_dashboard_frontend
() {
82 $CURR_DIR/src
/tools
/setup-virtualenv.sh
--python=$
(_python_autoselect
) $TEMP_DIR
83 $TEMP_DIR/bin
/pip
install nodeenv
84 $TEMP_DIR/bin
/nodeenv
-p --node=10.13.0
85 cd src
/pybind
/mgr
/dashboard
/frontend
87 DEFAULT_LANG
=`jq -r .config.locale package.json`
88 if [ -z "$DASHBOARD_FRONTEND_LANGS" ]; then
89 BUILD_TARGET
=":${DEFAULT_LANG}"
91 if [ "$DASHBOARD_FRONTEND_LANGS" == "ALL" ]; then
94 DASHBOARD_FRONTEND_LANGS_LIST
=`echo "$DASHBOARD_FRONTEND_LANGS" | sed 's/ /,/g'`
95 if [[ $DASHBOARD_FRONTEND_LANGS_LIST != *"${DEFAULT_LANG}"* ]]; then
96 # default language must be always built
97 DASHBOARD_FRONTEND_LANGS_LIST
="${DASHBOARD_FRONTEND_LANGS},${DEFAULT_LANG}"
99 BUILD_TARGET
=":{${DASHBOARD_FRONTEND_LANGS_LIST}}"
102 [ -z "$MAX_DASHBOARD_PARALLEL_BUILDS" ] && MAX_DASHBOARD_PARALLEL_BUILDS
=2
104 .
$TEMP_DIR/bin
/activate
106 echo "Building ceph-dashboard frontend with build${BUILD_TARGET} script";
107 # we need to use "-- --" because so that "--prod" survives accross all
108 # scripts redirections inside package.json
109 npx npm-run-all
--print-label --parallel --max-parallel $MAX_DASHBOARD_PARALLEL_BUILDS "build${BUILD_TARGET} -- -- --prod"
113 tar cf dashboard_frontend.
tar $outfile/src
/pybind
/mgr
/dashboard
/frontend
/dist
116 # clean out old cruft...
121 echo "building tarball..."
122 bin
/git-archive-all.sh
--prefix ceph-
$version/ \
127 # populate files with version strings
128 echo "including src/.git_version, ceph.spec"
130 (git rev-parse HEAD
; git describe
) 2> /dev
/null
> src
/.git_version
132 # if the version has '-' in it, it has a 'release' part,
133 # like vX.Y.Z-N-g<shortsha1>. If it doesn't, it's just
134 # vX.Y.Z. Handle both, and translate - to . for rpm
135 # naming rules (the - separates version and release).
137 if expr index
$version '-' > /dev
/null
; then
138 rpm_version
=`echo $version | cut -d - -f 1-1`
139 rpm_release
=`echo $version | cut -d - -f 2- | sed 's/-/./'`
145 for spec
in ceph.spec.
in alpine
/APKBUILD.
in; do
147 sed "s/@VERSION@/$rpm_version/g" |
148 sed "s/@RPM_RELEASE@/$rpm_release/g" |
149 sed "s/@TARBALL_BASENAME@/ceph-$version/g" > `echo $spec | sed 's/.in$//'`
152 tar cvf
$outfile.version.
tar $outfile/src
/.git_version
$outfile/ceph.spec
$outfile/alpine
/APKBUILD
153 # NOTE: If you change this version number make sure the package is available
154 # at the three URLs referenced below (may involve uploading to download.ceph.com)
156 download_boost
$boost_version 2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adba \
157 https
://dl.bintray.com
/boostorg
/release
/$boost_version/source \
158 https
://downloads.sourceforge.net
/project
/boost
/boost
/$boost_version \
159 https
://download.ceph.com
/qa
161 build_dashboard_frontend
162 tar --concatenate -f $outfile.all.
tar $outfile.version.
tar
163 tar --concatenate -f $outfile.all.
tar $outfile.boost.
tar
164 tar --concatenate -f $outfile.all.
tar $outfile.
tar
165 tar --concatenate -f $outfile.all.
tar dashboard_frontend.
tar
166 mv $outfile.all.
tar $outfile.
tar
168 rm -f $outfile.version.
tar
169 rm -f $outfile.boost.
tar
171 echo "compressing..."
172 bzip2 -9 $outfile.
tar