@@ -4,12 +4,12 @@ _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
5
5
# Easier to add a path to a script than source a file of functions.
6
6
export PATH=" $_dir " /bin:$PATH
7
- . ` dirname " $0 " ` /functions
7
+ . " $( dirname " $0 " ) " /functions
8
8
. detect-environment
9
9
. compile-options
10
10
. version
11
11
12
- mkdir -p $BASEDIR /output/tarballs
12
+ mkdir -p " $BASEDIR " /output/tarballs
13
13
14
14
# the first part of the script is not really critical
15
15
set +e
@@ -33,105 +33,105 @@ for repo_spec in cfengine/buildscripts cfengine/core cfengine/masterfiles cfengi
33
33
34
34
# Convert to uppercase, swap hyphens with underscore and append '_REV'
35
35
# E.g. 'mission-portal' -> 'MISSION_PORTAL_REV'
36
- rev_param_name=" $( echo $repo | tr ' [:lower:]-' ' [:upper:]_' ) _REV"
36
+ rev_param_name=" $( echo " $repo " | tr ' [:lower:]-' ' [:upper:]_' ) _REV"
37
37
38
38
# Try to dereference the result from above and skip the rest of the loop
39
39
# unless the variable is defined.
40
- revision=" $( echo $ {! rev_param_name}) " || continue # dereference
40
+ revision=" ${! rev_param_name} " || continue
41
41
42
42
# remove "origin/" (if any)
43
43
revision=" ${revision## origin/ } "
44
44
45
45
# Check to see if the resolved variable starts with 'pull/'
46
46
if expr " $revision " : " pull/" > /dev/null; then
47
47
# Extract the revision number. E.g. 'pull/1755' -> '1755'
48
- pr_nr=" $( echo $revision | cut -d/ -f2) "
48
+ pr_nr=" $( echo " $revision " | cut -d/ -f2) "
49
49
50
- get-github-pull-request-info " $repo_spec " " $pr_nr " >> $BASEDIR /output/PRs
50
+ get-github-pull-request-info " $repo_spec " " $pr_nr " >> " $BASEDIR " /output/PRs
51
51
fi
52
52
done
53
53
54
54
# now script failures should fail the script
55
55
set -e
56
56
57
57
# Build tarball from core repository
58
- cd $BASEDIR /core
58
+ cd " $BASEDIR " /core
59
59
rm cfengine-3.* .tar.gz || true
60
- git rev-parse HEAD > $BASEDIR /output/core-commitID
60
+ git rev-parse HEAD > " $BASEDIR " /output/core-commitID
61
61
# Configure in order to run "make dist", deleted later.
62
62
./configure -C
63
63
make dist
64
- mv cfengine-3.* .tar.gz $BASEDIR /output/tarballs/
64
+ mv cfengine-3.* .tar.gz " $BASEDIR " /output/tarballs/
65
65
make distclean
66
66
67
67
# Build tarballs from masterfiles repository
68
- cd $BASEDIR /masterfiles
68
+ cd " $BASEDIR " /masterfiles
69
69
rm cfengine-masterfiles* .tar.gz || true
70
- git rev-parse HEAD > $BASEDIR /output/masterfiles-commitID
70
+ git rev-parse HEAD > " $BASEDIR " /output/masterfiles-commitID
71
71
# Configure in order to run "make dist", deleted later.
72
72
./configure
73
73
make dist # source tarball
74
74
make tar-package # package tarball (containing all files as if they were
75
75
# installed under "prefix".)
76
- mv cfengine-masterfiles* .tar.gz $BASEDIR /output/tarballs/
76
+ mv cfengine-masterfiles* .tar.gz " $BASEDIR " /output/tarballs/
77
77
make distclean
78
78
79
79
# Compute a checksum list that can be used to verify the integrity of the
80
80
# tarballs
81
- cd $BASEDIR /output/tarballs
82
- sha256sum * .tar.gz > sha256sums.txt
81
+ cd " $BASEDIR " /output/tarballs
82
+ sha256sum -- * .tar.gz > sha256sums.txt
83
83
# Add the BSD (16-bit) checksum of the checksum list to it's filename. This way
84
84
# you can verify the integrity of the checksum list itself.
85
- CKSUM=` sum sha256sums.txt | cut -d ' ' -f 1`
86
- mv sha256sums.txt sha256sums.$CKSUM .txt
85
+ CKSUM=$( sum sha256sums.txt | cut -d ' ' -f 1)
86
+ mv sha256sums.txt sha256sums." $CKSUM " .txt
87
87
88
88
# Install javascript dependencies
89
89
(
90
- if test -f " $BASEDIR /mission-portal/public/scripts/package.json" ; then
91
- cd $BASEDIR /mission-portal/public/scripts
90
+ if test -f " $BASEDIR " /mission-portal/public/scripts/package.json; then
91
+ cd " $BASEDIR " /mission-portal/public/scripts
92
92
# display node & npm versions
93
93
npm --version
94
94
node --version
95
95
# install dependencies from npmjs
96
- npm ci --prefix $BASEDIR /mission-portal/public/scripts/
96
+ npm ci --prefix " $BASEDIR " /mission-portal/public/scripts/
97
97
# build react components
98
- npm run build --prefix $BASEDIR /mission-portal/public/scripts/
98
+ npm run build --prefix " $BASEDIR " /mission-portal/public/scripts/
99
99
# remove the packages specified in devDependencies
100
- npm prune --omit=dev --prefix $BASEDIR /mission-portal/public/scripts/
100
+ npm prune --omit=dev --prefix " $BASEDIR " /mission-portal/public/scripts/
101
101
102
102
fi
103
103
)
104
104
105
105
# Install PHP dependencies from the mission-portal repository
106
106
(
107
- if test -f " $BASEDIR /mission-portal/composer.json" ; then
108
- cd $BASEDIR /mission-portal
107
+ if test -f " $BASEDIR " /mission-portal/composer.json; then
108
+ cd " $BASEDIR " /mission-portal
109
109
# install PHP dependencies from composer
110
110
php /usr/bin/composer.phar install --no-dev
111
111
fi
112
112
)
113
113
114
114
# Install PHP dependencies from the nova repository
115
115
(
116
- if test -f " $BASEDIR /nova/api/http/composer.json" ; then
117
- cd $BASEDIR /nova/api/http
116
+ if test -f " $BASEDIR " /nova/api/http/composer.json; then
117
+ cd " $BASEDIR " /nova/api/http
118
118
# install PHP dependencies from composer
119
119
php /usr/bin/composer.phar install --no-dev --ignore-platform-reqs
120
120
fi
121
121
)
122
122
123
123
# Compile Mission Portal styles
124
124
(
125
- if test -f " $BASEDIR /mission-portal/public/themes/default/bootstrap/cfengine_theme.less" ; then
126
- cd $BASEDIR /mission-portal/public/themes/default/bootstrap
125
+ if test -f " $BASEDIR " /mission-portal/public/themes/default/bootstrap/cfengine_theme.less; then
126
+ cd " $BASEDIR " /mission-portal/public/themes/default/bootstrap
127
127
npx -p less lessc --compress ./cfengine_theme.less ./compiled/css/cfengine.less.css
128
128
fi
129
129
)
130
130
131
131
# Install LDAP API dependencies
132
132
(
133
- if test -f " $BASEDIR /mission-portal/ldap/composer.json" ; then
134
- cd $BASEDIR /mission-portal/ldap
133
+ if test -f " $BASEDIR " /mission-portal/ldap/composer.json; then
134
+ cd " $BASEDIR " /mission-portal/ldap
135
135
# install PHP dependencies from composer
136
136
php /usr/bin/composer.phar install --no-dev
137
137
fi
0 commit comments