1
- #! /bin/bash -x
1
+ #! /bin/bash
2
2
3
3
_dir=$( readlink -e " $( dirname " $0 " ) " )
4
4
# 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
59
59
rm -f cfengine-3.* .tar.gz
60
60
git rev-parse HEAD > " $BASEDIR " /output/core-commitID
61
61
# 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
64
66
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
66
69
67
70
# Build tarballs from masterfiles repository
68
71
cd " $BASEDIR " /masterfiles
69
72
rm -f cfengine-masterfiles* .tar.gz
70
73
git rev-parse HEAD > " $BASEDIR " /output/masterfiles-commitID
71
74
# 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".)
76
83
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
78
86
79
87
# Compute a checksum list that can be used to verify the integrity of the
80
88
# tarballs
@@ -85,53 +93,53 @@ sha256sum -- *.tar.gz > sha256sums.txt
85
93
CKSUM=$( sum sha256sums.txt | cut -d ' ' -f 1)
86
94
mv sha256sums.txt sha256sums." $CKSUM " .txt
87
95
88
- # Install javascript dependencies
96
+ echo " $( basename " $0 " ) : Debug: Installing javascript dependencies... "
89
97
(
90
98
if test -f " $BASEDIR " /mission-portal/public/scripts/package.json; then
91
99
cd " $BASEDIR " /mission-portal/public/scripts
92
100
# display node & npm versions
93
101
npm --version
94
102
node --version
95
103
# 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/
97
105
# 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/
99
107
# 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/
101
109
fi
102
110
)
103
111
104
- # Install PHP dependencies from the mission-portal repository
112
+ echo " $( basename " $0 " ) : Debug: Installing PHP dependencies from mission-portal repository... "
105
113
(
106
114
if test -f " $BASEDIR " /mission-portal/composer.json; then
107
115
cd " $BASEDIR " /mission-portal
108
116
# 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
110
118
fi
111
119
)
112
120
113
- # Install PHP dependencies from the nova repository
121
+ echo " $( basename " $0 " ) : Debug: Installing PHP dependencies from nova repository... "
114
122
(
115
123
if test -f " $BASEDIR " /nova/api/http/composer.json; then
116
124
cd " $BASEDIR " /nova/api/http
117
125
# 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
119
127
fi
120
128
)
121
129
122
- # Compile Mission Portal styles
130
+ echo " $( basename " $0 " ) : Debug: Compiling Mission Portal styles... "
123
131
(
124
132
if test -f " $BASEDIR " /mission-portal/public/themes/default/bootstrap/cfengine_theme.less; then
125
133
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
127
135
fi
128
136
)
129
137
130
- # Install LDAP API dependencies
138
+ echo " $( basename " $0 " ) : Debug: Installing LDAP API dependencies... "
131
139
(
132
140
if test -f " $BASEDIR " /mission-portal/ldap/composer.json; then
133
141
cd " $BASEDIR " /mission-portal/ldap
134
142
# 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
136
144
fi
137
145
)
0 commit comments