Skip to content

Commit

Permalink
Deploy task
Browse files Browse the repository at this point in the history
Added deploy task to story
Added deploy task to task
Separated prep and deploy in task
  • Loading branch information
brandon-reeves committed Oct 14, 2015
1 parent 31d715a commit 3964d77
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 12 deletions.
40 changes: 40 additions & 0 deletions git-flow-agile-story
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ usage() {
git flow story [list]
git flow story start
git flow story prep
git flow story deploy
git flow story finish
git flow story publish
git flow story track
Expand Down Expand Up @@ -291,6 +292,7 @@ no-ff! Never fast-forward during the merge
# git_do fetch -q "$ORIGIN" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'."

# Pull remote branch in
git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."
git_do pull
if [ $? -ne 0 ]; then
# Oops.. we have a merge conflict!
Expand Down Expand Up @@ -386,6 +388,43 @@ no-ff! Never fast-forward during the merge
echo
}


cmd_deploy() {
OPTIONS_SPEC="\
git flow story deploy [-h]

Deploy story branch <name> to the org specified in build.properties and run all local and Apex tests.

This will perform the following operations and build failures may occur.
- Install npm dependencies
- Run Jasmine tests
- Deploy to org and run all tests

- If this fails, you can fix the issues and safely re-run this task

--
h,help! Show this help
"
# Parse arguments
parse_args "$@"

gitflow_expand_nameprefix_arg_or_current

# Sanity checks
require_clean_working_tree
require_branch "$BRANCH"

git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."

cd $(git rev-parse --show-toplevel)

npm install

grunt jasmine

ant deployNcinoCI
}

cmd_finish() {
OPTIONS_SPEC="\
git flow story finish [-h] [-F] [-r] [-p] [-k] [-D] [-S] [--no-ff] <name|nameprefix>
Expand Down Expand Up @@ -505,6 +544,7 @@ no-ff! Never fast-forward during the merge
git_fetch_branch "$ORIGIN" "$BASE_BRANCH"
fi

git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."
git_do push "$ORIGIN" "$BRANCH" || die "Could not push the $BRANCH to $ORIGIN."

# Check if the local branches have all the commits from the remote branches
Expand Down
52 changes: 40 additions & 12 deletions git-flow-agile-task
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ usage() {
git flow task [list]
git flow task start
git flow task prep
git flow task deploy
git flow task finish
git flow task publish
git flow task track
Expand Down Expand Up @@ -256,13 +257,10 @@ Requirements for a successful prep:
- The Story branch must exist remotely
- Both the Story and Task branches must have clean working tree (no unstaged changes)

This will perform the following operations and merge conflicts and build failures may occur.
This will perform the following operations and merge conflicts may occur.
- Update both the Story and Task branch from remote tracking branches
- Update tracking information if not present
- Merge story branch into task branch
- Install npm dependencies
- Run Jasmine tests
- Deploy to org and run all tests

- If this fails, you can fix the issues and safely re-run this task

Expand Down Expand Up @@ -310,6 +308,7 @@ no-ff! Never fast-forward during the merge
# git_do fetch -q "$ORIGIN" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'."

# Pull remote branch in
git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."
git_do pull
if [ $? -ne 0 ]; then
# Oops.. we have a merge conflict!
Expand Down Expand Up @@ -388,14 +387,6 @@ no-ff! Never fast-forward during the merge
exit 1
fi

cd $(git rev-parse --show-toplevel)

npm install

grunt jasmine

ant deployNcinoCI

# Configure remote tracking
run_post_hook "$NAME" "$ORIGIN" "$BRANCH"

Expand All @@ -413,6 +404,42 @@ no-ff! Never fast-forward during the merge
echo
}

cmd_deploy() {
OPTIONS_SPEC="\
git flow task deploy [-h]

Deploy task branch <name> to the org specified in build.properties and run all local and Apex tests.

This will perform the following operations and build failures may occur.
- Install npm dependencies
- Run Jasmine tests
- Deploy to org and run all tests

- If this fails, you can fix the issues and safely re-run this task

--
h,help! Show this help
"
# Parse arguments
parse_args "$@"

gitflow_expand_nameprefix_arg_or_current

# Sanity checks
require_clean_working_tree
require_branch "$BRANCH"

git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."

cd $(git rev-parse --show-toplevel)

npm install

grunt jasmine

ant deployNcinoCI
}

cmd_finish() {
OPTIONS_SPEC="\
git flow task finish [-h] [-F] [-r] [-p] [-k] [-D] [-S] [--no-ff] <name|nameprefix>
Expand Down Expand Up @@ -540,6 +567,7 @@ no-ff! Never fast-forward during the merge
git_fetch_branch "$ORIGIN" "$BASE_BRANCH"
fi

git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."
git_do push "$ORIGIN" "$BRANCH" || die "Could not push the $BRANCH to $ORIGIN."

# Check if the local branches have all the commits from the remote branches
Expand Down
8 changes: 8 additions & 0 deletions gitflow-common
Original file line number Diff line number Diff line change
Expand Up @@ -744,3 +744,11 @@ goto_jira_ticket() {
jira_url="https://ncinodev.atlassian.net/browse/$path"
open $jira_url
}

goto_salesforce_deploy_status() {
local sf_username
local sf_password
local sf_url


}

0 comments on commit 3964d77

Please sign in to comment.