Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Burak Ikiler committed May 19, 2023
0 parents commit 58214cf
Show file tree
Hide file tree
Showing 174 changed files with 11,595 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2

general:
artifacts:
- coverage/${CIRCLE_PROJECT_REPONAME}_test/index.html

jobs:
build:
docker:
# specify the version you desire here (ruby 2.6.x)
- image: circleci/ruby:2.6-browsers-legacy
steps:
- checkout
test:
docker:
# specify the version you desire here
- image: circleci/ruby:2.6-browsers-legacy
environment:
RAILS_ENV: test
DB_HOST: 127.0.0.1
DRIVER: headless
TZ: /usr/share/zoneinfo/Asia/Tokyo
- image: mysql:5.7
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda --sql-mode=""
environment:
MYSQL_USER: root
MYSQL_ALLOW_EMPTY_PASSWORD: yes

working_directory: ~/repo
steps:
- checkout
- run:
name: ready for redmine
command: |
REDMINE_BRANCH=master sh script/circleci-setup.sh
- run: perl -pi -e "s/gem \"capybara\".*$/gem \"capybara\"/g" Gemfile
- run: bundle install --path vendor/bundle --without postgresql rmagick && bundle update
- run: bundle exec rails g rspec:install
- run: bundle exec rake db:create RAILS_ENV=test
- run: bundle exec rake db:migrate RAILS_ENV=test
- run: bundle exec rake redmine:plugins:migrate RAILS_ENV=test
- run:
command: |
bundle exec rake ${CIRCLE_PROJECT_REPONAME}:test RAILS_ENV=test
- run:
command: |
bundle exec rspec -I plugins/redmine_issue_templates/spec --format documentation plugins/redmine_issue_templates/spec/models/
- run:
command: |
bundle exec rspec -I plugins/redmine_issue_templates/spec --format documentation plugins/redmine_issue_templates/spec/helpers/
- run:
command: |
bundle exec rspec -I plugins/redmine_issue_templates/spec --format documentation plugins/redmine_issue_templates/spec/controllers/
- run:
command: |
bundle exec rspec -I plugins/redmine_issue_templates/spec --format documentation plugins/redmine_issue_templates/spec/requests/
- run:
command: |
bundle exec rspec -I plugins/redmine_issue_templates/spec --format documentation plugins/redmine_issue_templates/spec/features/
- run:
command: |
bundle exec rake redmine:plugins:migrate NAME=${CIRCLE_PROJECT_REPONAME} \
VERSION=0 RAILS_ENV=test
- run:
command: |
mkdir -p /tmp/coverage
cp -r coverage/${CIRCLE_PROJECT_REPONAME}_test /tmp/coverage/
cp -r coverage/${CIRCLE_PROJECT_REPONAME}_spec /tmp/coverage/
- store_artifacts:
path: /tmp/coverage

workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
filters:
branches:
ignore:
- /v0.2.x-support-Redmine3.*/

10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gitattributes export-ignore
.gitignore export-ignore
wercker.yml export-ignore
script/ export-ignore
.rubocop* export-ignore
Gemfile.local export-ignore
.circleci/ export-ignore
docker-compose.yml export-ignore
Dockerfile export-ignore
_config.yml export-ignore
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms
ko_fi: akikopusu

13 changes: 13 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Greetings

on: [issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for contributing to Redmine Issue Templates plugin!'' first issue'
pr-message: 'Thanks you for contributing to Redmine Issue Templates plugin!'' first pr'
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage/
doc/
.yardoc/
Gemfile.lock
Gemfile
.history
.wercker
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: .rubocop_todo.yml
require:
- rubocop-rails
AllCops:
TargetRubyVersion: 2.4
Exclude:
- 'db/**/*'

67 changes: 67 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-06-01 07:37:41 +0900 using RuboCop version 0.40.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
Metrics/AbcSize:
Max: 55

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 200
Exclude:
- 'spec/**/*'
- 'test/**/*'

# "Line is too long"を無効
Layout/LineLength:
Enabled: false

# Offense count: 1
Metrics/CyclomaticComplexity:
Max: 10

# Offense count: 1
Metrics/PerceivedComplexity:
Max: 10

Metrics/BlockLength:
Max: 30
Exclude:
- 'spec/**/*'
- 'test/**/*'

# Avoid methods longer than 10 lines of code
MethodLength:
CountComments: true # count full line comments?
Max: 45

# Aboid Missing top-level module documentation comment.
Documentation:
Enabled: false

EndOfLine:
Enabled: false

Metrics/ModuleLength:
Max: 120

Rails/ApplicationRecord:
Enabled: false

Rails/UniqueValidationWithoutIndex:
Enabled: false

Rails/InverseOf:
Enabled: false

Rails/LexicallyScopedActionFilter:
Enabled: false

Rails/SkipsModelValidations:
Enabled: false
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ruby:2.6
LABEL maintainer="AKIKO TAKANO / (Twitter: @akiko_pusu)" \
description="Image to run Redmine simply with sqlite to try/review plugin."

### get Redmine source
### Replace shell with bash so we can source files ###
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

### install default sys packeges ###

RUN apt-get update
RUN apt-get install -qq -y \
git vim \
sqlite3 default-libmysqlclient-dev
RUN apt-get install -qq -y build-essential libc6-dev

# for e2e test env
RUN sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN apt-get update && apt-get install -y google-chrome-stable
RUN google-chrome --version | perl -pe 's/([^0-9]+)([0-9]+)(\.[0-9]+).+/$2/g' > chrome-version-major
RUN curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_`cat chrome-version-major` > chrome-version
RUN curl -O -L http://chromedriver.storage.googleapis.com/`cat chrome-version`/chromedriver_linux64.zip && rm chrome-version*
RUN unzip chromedriver_linux64.zip && mv chromedriver /usr/local/bin

RUN cd /tmp && svn co http://svn.redmine.org/redmine/trunk redmine
WORKDIR /tmp/redmine

COPY . /tmp/redmine/plugins/redmine_issue_templates/


# add database.yml (for development, development with mysql, test)
RUN echo $'test:\n\
adapter: sqlite3\n\
database: /tmp/data/redmine_test.sqlite3\n\
encoding: utf8mb4\n\
development:\n\
adapter: sqlite3\n\
database: /tmp/data/redmine_development.sqlite3\n\
encoding: utf8mb4\n\
development_mysql:\n\
adapter: mysql2\n\
host: mysql\n\
password: pasword\n\
database: redemine_development\n\
username: root\n'\
>> config/database.yml

RUN gem update bundler
RUN bundle install
RUN bundle exec rake db:migrate
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
13 changes: 13 additions & 0 deletions Gemfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
group :test do
gem 'simplecov-rcov', require: false
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'launchy'
gem 'database_cleaner'
end

# for Debug
group :development, :test do
gem 'pry-rails'
gem 'pry-byebug'
end
38 changes: 38 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
This is a template to report bug related to redmine issue templates plugin.
You can fill in any format, free style in case report features or questions.

## Summary


## Description


## Environment

These informations are greatly helpful to support quickly.
You can get these informations from Redmine's information page.
(E.g. http://example.com/admin/info)

- Redmine version
- Installed plugins
- Ruby version
- OS Platform
- Database (MariaDB, MySQL, PostgreSQL) and its version
- Rails Env


## Visual Proof / Screenshot

When reporting an application error, post the error stack trace that
you should find in the **log file** (eg. log/production.log).

Screen shot would be also helpful.


## Expected Results

## Actual Results

## Workaround

Please let me know if you have any workaround.
Loading

0 comments on commit 58214cf

Please sign in to comment.