-
Notifications
You must be signed in to change notification settings - Fork 164
/
deploy.sh
61 lines (47 loc) · 1.66 KB
/
deploy.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
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
# VOLUMIO THEME
# clear and re-create the dist directory
rm -rf dist || exit 0;
mkdir dist;
# Build Volumio UI
echo "Building Volumio UI"
gulp build --theme="volumio" --env="production"
# Fallback to 127.0.0.1 (for Ui on non-networked systems)
echo "Writing local-config.json"
echo '{"localhost": "http://127.0.0.1:3000"}' > dist/app/local-config.json
# go to the dist directory and create a *new* Git repo
echo "Initializing Git Repo"
cd dist
git init
# inside this git repo we'll pretend to be a new user
echo "Writing Git Config"
git config user.name "Volumio"
git config user.email "info@volumio.org"
# Deploy
echo "Deploying to Dist Branch"
git add .
git commit -m "Deploy to Dist Branch"
# Force push from the current repo's master branch to the dist branch for deployment
echo "Pushing to Dist Branch"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:dist > /dev/null 2>&1
cd ..
# VOLUMIO3 THEME
# clear and re-create the dist directory
rm -rf dist || exit 0;
mkdir dist;
# Build Volumio UI
gulp build --theme="volumio3" --env="production"
# Fallback to 127.0.0.1 (for Ui on non-networked systems)
echo '{"localhost": "http://127.0.0.1:3000"}' > dist/app/local-config.json
# go to the dist directory and create a *new* Git repo
cd dist
git init
# inside this git repo we'll pretend to be a new user
git config user.name "Volumio"
git config user.email "info@volumio.org"
# Deploy
git add .
git commit -m "Deploy to Dist3 Branch"
# Force push from the current repo's master branch to the dist branch for deployment
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:dist3 > /dev/null 2>&1