-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·114 lines (91 loc) · 2.71 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# enable error reporting to the console, just in case
set -e
# only proceed script when started not by pull request (PR)
if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then
echo "this is PR, exiting"
exit 0
fi
# ignore tags
if [ ! -z $TRAVIS_TAG ]; then
echo "this is a tag, exiting"
exit 0
fi
wet_v="v4.0.14"
wet_base="https://github.com/wet-boew/"
repos="wet-boew theme-gcwu-fegc theme-gc-intranet GCWeb"
#repos="wet-boew"
#repos="theme-gcwu-fegc"
#repos="theme-gc-intranet GCWeb"
#repos="GCWeb"
ramp_dep="https://${GH_TOKEN}@github.com/RAMP-PCAR/ramp-wet-dep"
ramp_folder="ramp_dep"
ramp_branch="dep"
git clone -b $ramp_branch $ramp_dep $ramp_folder
for r in $repos; do
# clone wet repo
git clone $wet_base$r $r
# build wet
cd $r
git checkout $wet_v
# update magnific-popup dependency version
if [ "$r" == "wet-boew" ]; then
sed -i 's/"magnific-popup": "1.0.0",/"magnific-popup": "0.9.9",/g' bower.json
fi
npm install
echo $r
# do some stuff if it's core wet repo
if [ "$r" == "wet-boew" ]; then
#grunt init
#grunt
#grunt dist
# this avoids building all the demo pages
grunt checkDependencies
grunt test
grunt build
grunt minify
grunt i18n_csv:assemble
# create a symlink to wet-boew core
bower link
elif [ "$r" == "GCWeb" ]; then
# link prebuild wet-boew core
bower link wet-boew
# this avoids building all the demo pages
grunt build
grunt assets-dist #copy wet core assets
grunt assemble:ajax #generate canada.ca mega menu
grunt assemble:ajax_min #generate minified canada.ca mega menu
grunt htmlmin #minify it
# grunt htmllint #lint it
else
# link prebuild wet-boew core
bower link wet-boew
# this avoids building all the demo pages
grunt build
grunt assets-dist #copy wet core assets
fi
# remove garbage
##rm -rf node_modules
##rm -rf lib
rm -rf .git
#rm bower.json
#rm package.json
# making folder to store archive in
cd ..
#mkdir -p $ramp_folder/$r
mkdir -p $ramp_folder/$wet_v
# remove previous file with the same version number if exists
rm -f $ramp_folder/$wet_v/$r.zip
# zipping
zip -r $ramp_folder/$wet_v/$r.zip $r -x "$r/node_modules/*" -x "$r/lib/*" "$r/bower.json" -x "$r/package.json"
ls
# remove original wet repo
#rm -rf $r
done
cd $ramp_folder
# add new files
git add -A .
git commit -a -m "chore(release): WET dependencies $wet_v"
# push them into the repo
#git push $ramp_dep
git push --quiet $ramp_dep > /dev/null 2>&1