Skip to content

Commit f0ccbb3

Browse files
committed
Cleaned up circleci deploy script.
1 parent a17cb94 commit f0ccbb3

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

.circleci/deploy.sh

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@ if [[ -z "$CIRCLE_TAG" ]]; then
2727
exit 1
2828
fi
2929

30-
VERSION="$CIRCLE_TAG"
31-
SVN_DIR="/tmp/svn/${CIRCLE_PROJECT_REPONAME}"
30+
SVN_DIR="/tmp/artifacts"
31+
PROJECT_DIR=$(pwd)
3232

33-
echo "Preparing for version $VERSION release..."
34-
35-
if [[ ! -d "$SVN_DIR" ]]; then
36-
mkdir -p "$SVN_DIR"
37-
echo "SVN directory $SVN_DIR created."
38-
fi
33+
echo "Preparing for version $CIRCLE_TAG release..."
3934

4035
# Checkout just trunk and assets for efficiency.
4136
# Tagging will be handled on the SVN level.
@@ -47,15 +42,13 @@ svn update --set-depth infinity trunk
4742

4843
echo "Copying files..."
4944

50-
if [[ -f "$CIRCLE_WORKING_DIRECTORY/.distignore" ]]; then
51-
# Copy from current branch to /trunk, excluding assets.
52-
# The --delete flag will delete anything in destination that no longer exists in source.
53-
rsync -rc --exclude-from="$CIRCLE_WORKING_DIRECTORY/.distignore" "$CIRCLE_WORKING_DIRECTORY/" trunk/ --delete --delete-excluded
45+
if [[ -f "$PROJECT_DIR/.distignore" ]]; then
46+
rsync -rc --exclude-from="$PROJECT_DIR/.distignore" "$PROJECT_DIR/" trunk/ --delete --delete-excluded
5447
fi
5548

56-
# Copy assets to /assets as this was skipped in the previous step.
57-
if [[ -d "$CIRCLE_WORKING_DIRECTORY/assets/" ]]; then
58-
rsync -rc "$CIRCLE_WORKING_DIRECTORY/assets/" assets/ --delete
49+
# Copy assets to /assets.
50+
if [[ -d "$PROJECT_DIR/assets/" ]]; then
51+
rsync -rc "$PROJECT_DIR/assets/" assets/ --delete
5952
fi
6053

6154
# Add everything and commit to SVN.
@@ -67,13 +60,13 @@ svn add . --force > /dev/null
6760
# SVN delete all deleted files and suppress stdout.
6861
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %@ > /dev/null
6962

70-
# Copy tag locally from trunk.
63+
# Copy trunk into the current tag directory.
7164
echo "Copying tag..."
72-
svn cp "trunk" "tags/$VERSION"
65+
svn cp "trunk" "tags/$CIRCLE_TAG"
7366

7467
svn status
7568

7669
echo "Committing files..."
77-
svn commit -m "Release version $VERSION." --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
70+
svn commit -m "Release version $CIRCLE_TAG." --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
7871

79-
echo "Plugin release $VERSION deployed to $SVN_URL"
72+
echo "Plugin version $CIRCLE_TAG deployed."

0 commit comments

Comments
 (0)