-
Notifications
You must be signed in to change notification settings - Fork 8
/
deployAssets.sh
69 lines (55 loc) · 1.67 KB
/
deployAssets.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
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="mz-mindbody-api"
CURRENTDIR=`pwd`
MAINFILE="mz-mindbody.php" # this should be the name of your main php file in the wordpress plugin
# svn config
SVNPATH="/tmp/$PLUGINSLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk.
SVNURL="http://plugins.svn.wordpress.org/mz-mindbody-api" # Remote SVN repo on wordpress.org, with no trailing slash
SVNUSER="mikeill" # your svn username
# Let's begin...
echo ".........................................."
echo
echo "Preparing to update plugin assets"
echo
echo ".........................................."
echo
echo
echo "Create local copy of SVN repo ..."
svn co $SVNURL $SVNPATH
echo "Clear svn assets so we can overwrite them"
rm -rf $SVNPATH/assets/*
echo "Ignore github specific files and deployment script"
svn propset svn:ignore "
README.md
node_modules
tests
.DS_Store
.gitmodules
assets
package.json
bin/install-wp-tests.sh
phpunit.xml.dist
phpcs.ruleset.xml
phpcs.xml.dist
.git
*.log
*.sh
wpassets
.gitignore" "$SVNPATH/trunk/"
echo -e "Enter a commit message for new assets: \c"
read COMMITMSG
echo "Copy assets to SVN repo "
cp -r wpassets/ $SVNPATH/assets/
echo "Move to temp SVN repo location and add assets"
cd $SVNPATH
# May have to do this manually:
# svn add assets
svn commit --username=$SVNUSER -m "$COMMITMSG"
echo "Return to plugin directory"
cd $CURRENTDIR
echo "Remove temporary directory $SVNPATH"
rm -fr $SVNPATH/
echo "*** Done. ***"