Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/commands/install_plugin.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
description: Install Redmine plugin << parameters.redmine_plugin_repository >>

parameters:
redmine_plugin_repository:
description: repository of Redmine plugin
type: string
branch:
description: branch of Redmine plugin
type: string
default: master
default: ''
checkout-circle-branch:
description: "checkout $CIRCLE_BRANCH (default: true)"
type: boolean
default: true

steps:
- run:
name: Install plugin << parameters.redmine_plugin_repository >>
working_directory: plugins
command: |
git clone --depth 1 --branch << parameters.branch >> << parameters.redmine_plugin_repository >>
branch="<< parameters.branch >>"
if [ -z "$branch" ]; then
branch='master'
<<# parameters.checkout-circle-branch >>
if [ -n "$(git ls-remote -h << parameters.redmine_plugin_repository >> $CIRCLE_BRANCH)" ]; then
branch=$CIRCLE_BRANCH
fi
<</ parameters.checkout-circle-branch >>
fi
git clone --depth 1 --branch $branch << parameters.redmine_plugin_repository >>