diff --git a/Gemfile b/Gemfile index 9676da4..3890c2a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,15 +1,10 @@ # frozen_string_literal: true -# -# ATENTION: do not change this lines numbers as this works with bin/pr_reviewer.bash -organization = 'decidim' -branch = 'release/0.23-stable' -# You can make changes after this line. source "https://rubygems.org" ruby RUBY_VERSION -DECIDIM_VERSION = {git: "https://github.com/#{organization}/decidim", branch: branch} +DECIDIM_VERSION = {git: "https://github.com/decidim/decidim", branch: 'release/0.23-stable'} gem "decidim", DECIDIM_VERSION gem "decidim-conferences", DECIDIM_VERSION diff --git a/bin/pr-reviewer b/bin/pr-reviewer deleted file mode 100755 index d40d04a..0000000 --- a/bin/pr-reviewer +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -set -e - -function usage() { - cat << HEREDOC - - Usage: pr-reviewer [--organization ORGANIZATION] [--branch BRANCH] [--short SHORT] [--drop-database] - - GitHub PR Reviewer for demo.decidim.org - - optional arguments: - -h, --help show this help message and exit - -o, --organization ORG pass in a organization string for the PR. Default: decidim - -b, --branch BRANCH pass in a branch string - -s, --short SHORT pass in the organization and branch string on short format (ie organization:branch) - -d, --drop-database drop and recreate the database (slower) - -HEREDOC -} - -organization=decidim -branch=develop -drop_database=0 -clean_up=1 - -while [[ "$#" -gt 0 ]]; do - case $1 in - -h|--help) usage; exit; ;; - -o|--organization) organization="$2"; shift ;; - -b|--branch) branch="$2"; shift ;; - -s|--short) short="$2"; shift ;; - -d|--drop-database) drop_database=1 ;; - -n|--no-clean-up) clean_up=0 ;; - *) echo "Unknown parameter passed: $1"; exit 1 ;; - esac - shift -done - -if [[ -n ${short} ]] ; then - if [[ ${short} =~ ":" ]] ; then - organization=$(echo $short | tr ":" " " | cut -d " " -f1) - else - organization="decidim" - fi - branch=$(echo $short | tr ":" " " | cut -d " " -f2) -fi - -sed -i "4s;.*;organization = '${organization}';" Gemfile -sed -i "5s;.*;branch = '${branch}';" Gemfile - -echo "CHECKING OUT" -docker-compose run --rm app bundle update - -if [[ $drop_database == 1 ]] ; then - echo "DB CLEANING UP" - docker-compose run --rm app bundle exec rails db:drop - docker-compose run --rm app bundle exec rails db:create - docker-compose run --rm app bundle exec rails decidim:upgrade - docker-compose run --rm app bundle exec rails db:migrate - docker-compose run --rm app bundle exec rails db:seed -fi - -echo "STARTING UP" -docker-compose up - -if [[ $clean_up == 1 ]] ; then - echo "CODE CLEANING UP" - now=$(date +"%Y%m%d-%H%M") - git checkout -b review/feature/${branch}-${now} - git add . - git commit -m "Review for feature/${branch}" - git checkout master -fi - -echo "FINISH"