-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.bash
executable file
·64 lines (52 loc) · 1.1 KB
/
release.bash
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
#!/usr/bin/env bash
version="$1"
function create_release() {
local version="$version"
yarn version --new-version "$version"
}
function create_build() {
rm dist/ -rf
yarn install --frozen-lockfile
yarn build
}
function add_to_gitignore() {
files_to_ignore=(
node_modules/
cypress/
.gitignore
)
for filename in "${files_to_ignore[@]}"; do
echo "$filename" >> .gitignore
done
}
function clean_before_commit() {
files_to_remove=(
.editorconfig
.nowignore
)
rm --recursive --force "${files_to_remove[@]}"
}
function commit_app() {
local version="$version"
cp --recursive dist/* ./
rm dist/ --recursive --force
echo "$version" > .versionrc
git add .
git commit -m "deploy $version"
}
function deploy() {
git push
git push --tags
}
function back_to_work() {
rm .gitignore
git checkout master
}
create_release "$version" \
&& create_build \
&& git checkout gh-pages \
&& add_to_gitignore \
&& clean_before_commit \
&& commit_app "$version"
deploy \
&& back_to_work