Skip to content

Commit 83a0329

Browse files
committed
bootstrap-tarballs: decreased verboseness
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 287b447 commit 83a0329

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

build-scripts/bootstrap-tarballs

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -x
1+
#!/bin/bash
22

33
_dir=$(readlink -e "$(dirname "$0")")
44
# refactored a few functions into single file scripts for easier development/debugging, see ENT-12741 and ENT-12595
@@ -59,22 +59,30 @@ cd "$BASEDIR"/core
5959
rm -f cfengine-3.*.tar.gz
6060
git rev-parse HEAD > "$BASEDIR"/output/core-commitID
6161
# Configure in order to run "make dist", deleted later.
62-
./configure -C
63-
make dist
62+
echo "$(basename "$0"): Debug: Running configure on core repository..."
63+
run_and_print_on_failure ./configure -C
64+
echo "$(basename "$0"): Debug: Running make dist on core repository..."
65+
run_and_print_on_failure make dist
6466
mv cfengine-3.*.tar.gz "$BASEDIR"/output/tarballs/
65-
make distclean
67+
echo "$(basename "$0"): Debug: Running make distclean on core repository..."
68+
run_and_print_on_failure make distclean
6669

6770
# Build tarballs from masterfiles repository
6871
cd "$BASEDIR"/masterfiles
6972
rm -f cfengine-masterfiles*.tar.gz
7073
git rev-parse HEAD > "$BASEDIR"/output/masterfiles-commitID
7174
# Configure in order to run "make dist", deleted later.
72-
./configure
73-
make dist # source tarball
74-
make tar-package # package tarball (containing all files as if they were
75-
# installed under "prefix".)
75+
echo "$(basename "$0"): Debug: Running configure on masterfiles repository..."
76+
run_and_print_on_failure ./configure
77+
echo "$(basename "$0"): Debug: Running make dist on masterfiles repository..."
78+
run_and_print_on_failure make dist # source tarball
79+
echo "$(basename "$0"): Debug: Running make tar-package on masterfiles repository..."
80+
run_and_print_on_failure make tar-package # package tarball (containing all
81+
# files as if they were installed
82+
# under "prefix".)
7683
mv cfengine-masterfiles*.tar.gz "$BASEDIR"/output/tarballs/
77-
make distclean
84+
echo "$(basename "$0"): Debug: Running make distclean on masterfiles repository..."
85+
run_and_print_on_failure make distclean
7886

7987
# Compute a checksum list that can be used to verify the integrity of the
8088
# tarballs
@@ -85,53 +93,53 @@ sha256sum -- *.tar.gz > sha256sums.txt
8593
CKSUM=$(sum sha256sums.txt | cut -d ' ' -f 1)
8694
mv sha256sums.txt sha256sums."$CKSUM".txt
8795

88-
# Install javascript dependencies
96+
echo "$(basename "$0"): Debug: Installing javascript dependencies..."
8997
(
9098
if test -f "$BASEDIR"/mission-portal/public/scripts/package.json; then
9199
cd "$BASEDIR"/mission-portal/public/scripts
92100
# display node & npm versions
93101
npm --version
94102
node --version
95103
# install dependencies from npmjs
96-
npm ci --prefix "$BASEDIR"/mission-portal/public/scripts/
104+
run_and_print_on_failure npm ci --prefix "$BASEDIR"/mission-portal/public/scripts/
97105
# build react components
98-
npm run build --prefix "$BASEDIR"/mission-portal/public/scripts/
106+
run_and_print_on_failure npm run build --prefix "$BASEDIR"/mission-portal/public/scripts/
99107
# remove the packages specified in devDependencies
100-
npm prune --omit=dev --prefix "$BASEDIR"/mission-portal/public/scripts/
108+
run_and_print_on_failure npm prune --omit=dev --prefix "$BASEDIR"/mission-portal/public/scripts/
101109
fi
102110
)
103111

104-
# Install PHP dependencies from the mission-portal repository
112+
echo "$(basename "$0"): Debug: Installing PHP dependencies from mission-portal repository..."
105113
(
106114
if test -f "$BASEDIR"/mission-portal/composer.json; then
107115
cd "$BASEDIR"/mission-portal
108116
# install PHP dependencies from composer
109-
php /usr/bin/composer.phar install --no-dev
117+
run_and_print_on_failure php /usr/bin/composer.phar install --no-dev
110118
fi
111119
)
112120

113-
# Install PHP dependencies from the nova repository
121+
echo "$(basename "$0"): Debug: Installing PHP dependencies from nova repository..."
114122
(
115123
if test -f "$BASEDIR"/nova/api/http/composer.json; then
116124
cd "$BASEDIR"/nova/api/http
117125
# install PHP dependencies from composer
118-
php /usr/bin/composer.phar install --no-dev --ignore-platform-reqs
126+
run_and_print_on_failure php /usr/bin/composer.phar install --no-dev --ignore-platform-reqs
119127
fi
120128
)
121129

122-
# Compile Mission Portal styles
130+
echo "$(basename "$0"): Debug: Compiling Mission Portal styles..."
123131
(
124132
if test -f "$BASEDIR"/mission-portal/public/themes/default/bootstrap/cfengine_theme.less; then
125133
cd "$BASEDIR"/mission-portal/public/themes/default/bootstrap
126-
npx -p less lessc --compress ./cfengine_theme.less ./compiled/css/cfengine.less.css
134+
run_and_print_on_failure npx -p less lessc --compress ./cfengine_theme.less ./compiled/css/cfengine.less.css
127135
fi
128136
)
129137

130-
# Install LDAP API dependencies
138+
echo "$(basename "$0"): Debug: Installing LDAP API dependencies..."
131139
(
132140
if test -f "$BASEDIR"/mission-portal/ldap/composer.json; then
133141
cd "$BASEDIR"/mission-portal/ldap
134142
# install PHP dependencies from composer
135-
php /usr/bin/composer.phar install --no-dev
143+
run_and_print_on_failure php /usr/bin/composer.phar install --no-dev
136144
fi
137145
)

0 commit comments

Comments
 (0)