-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwpengine.sh
More file actions
40 lines (36 loc) · 786 Bytes
/
wpengine.sh
File metadata and controls
40 lines (36 loc) · 786 Bytes
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
environment=$1
theme="sage"
if [ "$environment" == "staging" ]
then
git checkout develop
elif [ "$environment" == "production" ]
then
git checkout master
else
echo "Invalid environment."
exit
fi
exists=`git show-ref refs/heads/wpengine`
if [ -n "$exists" ]
then
git branch -D wpengine
fi
git checkout -b wpengine
cp -r web/app wp-content
rm "wp-content/themes/${theme}/.gitignore"
rm .gitignore
echo "/*\n!wp-content/" >> .gitignore
git ls-files | xargs git rm --cached
git add .
git commit -am "Setting up WPEngine build."
if [ "$environment" == "staging" ]
then
git push staging wpengine:master
git checkout develop
elif [ "$environment" == "production" ]
then
git push production wpengine:master
git checkout master
fi
git branch -D wpengine
rm -rf wp-content/