Añade plugin Redmine Git Hosting 4.0.2
This commit is contained in:
parent
472cb1ea76
commit
bdd66d941f
494 changed files with 36768 additions and 0 deletions
39
plugins/redmine_git_hosting/contrib/travis/common.sh
Normal file
39
plugins/redmine_git_hosting/contrib/travis/common.sh
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
function log_header() {
|
||||
echo "######################"
|
||||
echo $1
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
||||
function log_title() {
|
||||
echo "#### $1"
|
||||
}
|
||||
|
||||
|
||||
function log_ok() {
|
||||
echo "Done !"
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
||||
function git_clone() {
|
||||
plugin_name=$1
|
||||
plugin_url=$2
|
||||
|
||||
IFS='#' read url treeish <<< "$plugin_url"
|
||||
|
||||
log_title "INSTALL ${plugin_name} PLUGIN"
|
||||
|
||||
if [[ "$treeish" == "" ]] ; then
|
||||
git clone "${url}" "redmine/plugins/${plugin_name}"
|
||||
else
|
||||
git clone "${url}" "redmine/plugins/${plugin_name}"
|
||||
pushd "redmine/plugins/${plugin_name}" > /dev/null
|
||||
git checkout -q "$treeish"
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
log_ok
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
## MySQL configuration example
|
||||
## Data come from environment variables so the test suite can be run
|
||||
## on Travis or Jenkins (see https://github.com/codevise/jenkins-mysql-job-databases-plugin)
|
||||
production:
|
||||
adapter: mysql2
|
||||
database: <%= ENV['MYSQL_DATABASE'] %>
|
||||
host: <%= ENV['MYSQL_HOST'] %>
|
||||
port: <%= ENV['MYSQL_PORT'] %>
|
||||
username: <%= ENV['MYSQL_USER'] %>
|
||||
password: <%= ENV['MYSQL_PASSWORD'] %>
|
||||
encoding: utf8
|
||||
|
||||
development:
|
||||
adapter: mysql2
|
||||
database: <%= ENV['MYSQL_DATABASE'] %>
|
||||
host: <%= ENV['MYSQL_HOST'] %>
|
||||
port: <%= ENV['MYSQL_PORT'] %>
|
||||
username: <%= ENV['MYSQL_USER'] %>
|
||||
password: <%= ENV['MYSQL_PASSWORD'] %>
|
||||
encoding: utf8
|
||||
|
||||
test:
|
||||
adapter: mysql2
|
||||
database: <%= ENV['MYSQL_DATABASE'] %>
|
||||
host: <%= ENV['MYSQL_HOST'] %>
|
||||
port: <%= ENV['MYSQL_PORT'] %>
|
||||
username: <%= ENV['MYSQL_USER'] %>
|
||||
password: <%= ENV['MYSQL_PASSWORD'] %>
|
||||
encoding: utf8
|
|
@ -0,0 +1,20 @@
|
|||
## PostgreSQL configuration example
|
||||
## Data come from environment variables so the test suite can be run
|
||||
## on Travis or Jenkins (see https://github.com/lmlima/jenkins-postgresql-job-databases-plugin)
|
||||
production:
|
||||
adapter: postgresql
|
||||
database: <%= ENV['POSTGRES_DATABASE'] %>
|
||||
username: <%= ENV['POSTGRES_USER'] %>
|
||||
encoding: utf8
|
||||
|
||||
development:
|
||||
adapter: postgresql
|
||||
database: <%= ENV['POSTGRES_DATABASE'] %>
|
||||
username: <%= ENV['POSTGRES_USER'] %>
|
||||
encoding: utf8
|
||||
|
||||
test:
|
||||
adapter: postgresql
|
||||
database: <%= ENV['POSTGRES_DATABASE'] %>
|
||||
username: <%= ENV['POSTGRES_USER'] %>
|
||||
encoding: utf8
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
REDMINE_INSTALLER_DIR=$(dirname "$(readlink -f "$0")")
|
||||
source "$REDMINE_INSTALLER_DIR/common.sh"
|
||||
source "$REDMINE_INSTALLER_DIR/plugin.sh"
|
||||
source "$REDMINE_INSTALLER_DIR/redmine.sh"
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
echo ""
|
||||
echo "######################"
|
||||
echo "REDMINE INSTALLATION SCRIPT"
|
||||
echo ""
|
||||
echo "REDMINE_VERSION : ${REDMINE_VERSION}"
|
||||
echo "REDMINE_URL : ${REDMINE_URL}"
|
||||
echo "CURRENT_DIR : ${CURRENT_DIR}"
|
||||
echo "GITHUB_SOURCE : ${GITHUB_SOURCE}"
|
||||
echo "PLUGIN_PATH : ${PLUGIN_PATH}"
|
||||
echo ""
|
||||
|
||||
install_redmine
|
||||
install_plugin
|
||||
finish_install
|
87
plugins/redmine_git_hosting/contrib/travis/plugin.sh
Normal file
87
plugins/redmine_git_hosting/contrib/travis/plugin.sh
Normal file
|
@ -0,0 +1,87 @@
|
|||
#!/bin/bash
|
||||
|
||||
GITHUB_USER=${GITHUB_USER:-jbox-web}
|
||||
GITHUB_PROJECT=${GITHUB_PROJECT:-redmine_git_hosting}
|
||||
|
||||
GITHUB_SOURCE="${GITHUB_USER}/${GITHUB_PROJECT}"
|
||||
PLUGIN_PATH=${PLUGIN_PATH:-$GITHUB_SOURCE}
|
||||
PLUGIN_NAME=${PLUGIN_NAME:-$GITHUB_PROJECT}
|
||||
PLUGIN_DIR="redmine/plugins/${PLUGIN_NAME}"
|
||||
CONTRIB_DATA_DIR="${PLUGIN_DIR}/contrib/travis/data"
|
||||
|
||||
function install_plugin() {
|
||||
install_plugin_libs
|
||||
move_plugin
|
||||
install_database
|
||||
install_rspec
|
||||
install_plugin_dependencies
|
||||
}
|
||||
|
||||
|
||||
## PRIVATE
|
||||
|
||||
function install_plugin_libs() {
|
||||
log_title "INSTALL ADDITIONAL PACKAGES"
|
||||
sudo apt-get install -qq libicu-dev libssh2-1 libssh2-1-dev cmake
|
||||
log_ok
|
||||
}
|
||||
|
||||
function move_plugin() {
|
||||
log_title "MOVE PLUGIN"
|
||||
# Move GITHUB_USER/GITHUB_PROJECT to redmine/plugins dir
|
||||
mv "${PLUGIN_PATH}" "${REDMINE_NAME}/plugins"
|
||||
# Remove parent dir (GITHUB_USER)
|
||||
rmdir $(dirname ${PLUGIN_PATH})
|
||||
log_ok
|
||||
|
||||
log_title "CREATE SYMLINK"
|
||||
ln -s "${REDMINE_NAME}" "redmine"
|
||||
log_ok
|
||||
}
|
||||
|
||||
function install_database() {
|
||||
log_title "INSTALL DATABASE FILE"
|
||||
if [ "$DATABASE_ADAPTER" == "mysql" ] ; then
|
||||
echo "Type : mysql"
|
||||
cp "${CONTRIB_DATA_DIR}/db_files/database_mysql.yml" "redmine/config/database.yml"
|
||||
else
|
||||
echo "Type : postgres"
|
||||
cp "${CONTRIB_DATA_DIR}/db_files/database_postgres.yml" "redmine/config/database.yml"
|
||||
fi
|
||||
|
||||
log_ok
|
||||
}
|
||||
|
||||
function install_rspec() {
|
||||
log_title "INSTALL RSPEC FILE"
|
||||
mkdir "redmine/spec"
|
||||
cp "${PLUGIN_DIR}/spec/root_spec_helper.rb" "redmine/spec/spec_helper.rb"
|
||||
log_ok
|
||||
}
|
||||
|
||||
function install_plugin_dependencies() {
|
||||
git_clone 'additionals' 'https://github.com/AlphaNodes/additionals.git'
|
||||
git_clone 'redmine_sidekiq' 'https://github.com/ogom/redmine_sidekiq.git'
|
||||
install_ssh_key
|
||||
install_gitolite
|
||||
}
|
||||
|
||||
function install_ssh_key() {
|
||||
log_title "INSTALL ADMIN SSH KEY"
|
||||
ssh-keygen -N '' -f "${PLUGIN_DIR}/ssh_keys/redmine_gitolite_admin_id_rsa"
|
||||
log_ok
|
||||
}
|
||||
|
||||
function install_gitolite() {
|
||||
log_title "INSTALL GITOLITE V3"
|
||||
|
||||
sudo useradd --create-home git
|
||||
sudo -n -u git -i git clone https://github.com/sitaramc/gitolite.git
|
||||
sudo -n -u git -i mkdir bin
|
||||
sudo -n -u git -i gitolite/install -to /home/git/bin
|
||||
sudo cp "${PLUGIN_DIR}/ssh_keys/redmine_gitolite_admin_id_rsa.pub" /home/git/
|
||||
sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub
|
||||
sudo -n -u git -i gitolite setup -pk redmine_gitolite_admin_id_rsa.pub
|
||||
|
||||
log_ok
|
||||
}
|
75
plugins/redmine_git_hosting/contrib/travis/redmine.sh
Normal file
75
plugins/redmine_git_hosting/contrib/travis/redmine.sh
Normal file
|
@ -0,0 +1,75 @@
|
|||
#!/bin/bash
|
||||
|
||||
REDMINE_PACKAGE_URL="http://www.redmine.org/releases"
|
||||
REDMINE_SVN_URL="https://svn.redmine.org/redmine/branches"
|
||||
REDMINE_GIT_URL="https://github.com/redmine/redmine.git"
|
||||
|
||||
REDMINE_NAME="redmine-${REDMINE_VERSION}"
|
||||
REDMINE_PACKAGE="${REDMINE_NAME}.tar.gz"
|
||||
REDMINE_URL="${REDMINE_PACKAGE_URL}/${REDMINE_PACKAGE}"
|
||||
|
||||
USE_SVN=${USE_SVN:-false}
|
||||
|
||||
version=(${REDMINE_VERSION//./ })
|
||||
major=${version[0]}
|
||||
minor=${version[1]}
|
||||
patch=${version[2]}
|
||||
|
||||
|
||||
function install_redmine() {
|
||||
install_redmine_libs
|
||||
|
||||
if [ $USE_SVN == 'true' ] ; then
|
||||
# install_redmine_from_svn
|
||||
install_redmine_from_git
|
||||
else
|
||||
install_redmine_from_package
|
||||
fi
|
||||
}
|
||||
|
||||
function finish_install() {
|
||||
log_header "CURRENT DIRECTORY LISTING"
|
||||
ls -l "${CURRENT_DIR}"
|
||||
echo ""
|
||||
|
||||
log_header "REDMINE PLUGIN DIRECTORY LISTING"
|
||||
ls -l "${REDMINE_NAME}/plugins"
|
||||
echo ""
|
||||
}
|
||||
|
||||
## PRIVATE
|
||||
|
||||
|
||||
function install_redmine_libs() {
|
||||
log_title "INSTALL REDMINE LIBS"
|
||||
sudo apt-get install -qq subversion
|
||||
log_ok
|
||||
}
|
||||
|
||||
|
||||
function install_redmine_from_package() {
|
||||
log_title "GET TARBALL"
|
||||
wget "${REDMINE_URL}"
|
||||
log_ok
|
||||
|
||||
log_title "EXTRACT IT"
|
||||
tar xf "${REDMINE_PACKAGE}"
|
||||
log_ok
|
||||
}
|
||||
|
||||
|
||||
function install_redmine_from_svn() {
|
||||
log_title "GET SOURCES FROM SVN"
|
||||
svn co --non-interactive --trust-server-cert "${REDMINE_SVN_URL}/${REDMINE_VERSION}" "${REDMINE_NAME}"
|
||||
log_ok
|
||||
}
|
||||
|
||||
|
||||
function install_redmine_from_git() {
|
||||
log_title "GET SOURCES FROM GIT"
|
||||
git clone "${REDMINE_GIT_URL}" "${REDMINE_NAME}"
|
||||
pushd "${REDMINE_NAME}"
|
||||
git checkout "${REDMINE_VERSION}"
|
||||
popd
|
||||
log_ok
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue