forked from jig21nesh/postfacto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·132 lines (107 loc) · 2.91 KB
/
package.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
#
# Postfacto, a free, open-source and self-hosted retro tool aimed at helping
# remote teams.
#
# Copyright (C) 2016 - Present Pivotal Software, Inc.
#
# This program is free software: you can redistribute it and/or modify
#
# it under the terms of the GNU Affero General Public License as
#
# published by the Free Software Foundation, either version 3 of the
#
# License, or (at your option) any later version.
#
#
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#
# GNU Affero General Public License for more details.
#
#
#
# You should have received a copy of the GNU Affero General Public License
#
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
set -euo pipefail
rm -rf package.zip
for DIR in package tmp
do
if [[ -d $DIR ]]; then
rm -rf $DIR
fi
done
# BUILD FRONT-END
if [[ ! $* =~ '--skip-build' ]]; then
pushd web
npm run build
cp ../humans.txt build
popd
fi
# CREATE APP
mkdir tmp
cp -r api/. tmp
rm -rf tmp/.gitignore
rm -rf tmp/.bundle
rm -rf tmp/client/*
rm -rf tmp/db/*.sqlite3
rm -rf tmp/log/*.log
rm -rf tmp/spec
rm -rf tmp/tmp/*
cp -r web/build/. tmp/client
# BUILD PACKAGES
mkdir -p package/assets
cp -r tmp/. package/assets
rm -rf tmp
# TKG
cp -r deployment/tkg package
cp -r deployment/helm/postfacto-*.tgz package/tkg
cp -r deployment/deploy-tkg.sh package/tkg/deploy.sh
cp -r deployment/upgrade-tkg.sh package/tkg/upgrade.sh
cp -r deployment/mixpanel.sh package/tkg/mixpanel.sh
chmod u+x package/tkg/*.sh
# TAS
cp -r deployment/tas package
cp -r deployment/deploy-tas.sh package/tas/deploy.sh
cp -r deployment/upgrade-tas.sh package/tas/upgrade.sh
cp -r deployment/mixpanel.sh package/tas/mixpanel.sh
chmod u+x package/tas/*.sh
# PWS
cp -r deployment/pws package
cp -r deployment/deploy-cf.sh package/pws/deploy.sh
cp -r deployment/migrate-cf.sh package/pws/migrate.sh
cp -r deployment/upgrade-cf.sh package/pws/upgrade.sh
cp -r deployment/mixpanel.sh package/pws/mixpanel.sh
chmod u+x package/pws/*.sh
# CF
cp -r deployment/cf package
cp -r deployment/deploy-cf.sh package/cf/deploy.sh
cp -r deployment/migrate-cf.sh package/cf/migrate.sh
cp -r deployment/upgrade-cf.sh package/cf/upgrade.sh
cp -r deployment/mixpanel.sh package/cf/mixpanel.sh
chmod u+x package/cf/*.sh
# Heroku
cp -r deployment/heroku package
cp -r deployment/deploy-heroku.sh package/heroku/deploy.sh
cp -r deployment/migrate-heroku.sh package/heroku/migrate.sh
cp -r deployment/upgrade-heroku.sh package/heroku/upgrade.sh
cp -r deployment/mixpanel.sh package/heroku/mixpanel.sh
chmod u+x package/heroku/*.sh
# Smoke tests
cp -r deployment/smoke-test.sh package
chmod u+x package/smoke-test.sh
# Persist version
if [ $# -gt 0 ]; then
echo $1 > package/VERSION
fi
# Docs
cp deployment/README.md package
# Zip
zip -r package.zip package
rm -r package