Skip to content

Commit 47db438

Browse files
authored
Merge pull request #12 from icyleaf/develop
Rewrite ruby version
2 parents dafe0af + 64b0884 commit 47db438

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1979
-3419
lines changed

.dockerignore

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
# crystal
2-
main.cr
1+
# ruby
32
bin
4-
config
5-
data
6-
docs
7-
examples
83
logs
9-
repositories
104
spec
11-
Makefile
12-
README.md
13-
CHANGELOGS.md
14-
LICENSE
15-
.*env
5+
repositories
6+
config/hpr.yml
7+
Guardfile
8+
.rspec
9+
.rubocop.yml
1610

1711
# git
1812
.git

.gitignore

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
# crystal
2-
/lib/
3-
/bin/
1+
repositories/
2+
logs/
43

5-
# hpr
6-
/config/hpr.json
7-
/logs/
8-
/repositories/
9-
/data/
10-
11-
# ide
12-
/.vscode/
13-
14-
# docker
15-
docker-compose*.yml
4+
config/hpr.yml

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

.rubocop.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Metrics/LineLength:
2+
Max: 120
3+
4+
Metrics/MethodLength:
5+
Max: 20
6+
7+
Metrics/ClassLength:
8+
Max: 160
9+
10+
Style/AsciiComments:
11+
Enabled: false
12+
13+
Style/GlobalVars:
14+
Enabled: false
15+
16+
Style/RescueStandardError:
17+
Enabled: false
18+
19+
Lint/AssignmentInCondition:
20+
Enabled: false
21+
22+
Lint/HandleExceptions:
23+
Enabled: false

CHANGELOGS.md

Lines changed: 0 additions & 131 deletions
This file was deleted.

Dockerfile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1-
FROM icyleafcn/crystal:0.26.1 as builder
1+
FROM ruby:2.6-alpine
2+
LABEL maintainer="icyleaf <[email protected]>"
23

3-
ADD . /app
4-
WORKDIR /app
4+
ENV S6_OVERLAY_VERSION=1.22.1.0
55

66
RUN set -ex && \
7-
apk add --update --no-cache build-base openssl-dev yaml-dev && \
8-
shards build --production && \
9-
for f in `ls bin`; do ldd bin/$f | tr -s '[:blank:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%'; done
7+
apk add --update --no-cache curl && \
8+
curl -sSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz | tar xfz - -C / && \
9+
apk del --no-cache curl && \
10+
apk add --no-cache build-base sqlite-dev openssh-client openssh-keygen git bash redis
1011

11-
FROM icyleafcn/s6-overlay
12+
WORKDIR /app
1213

13-
COPY --from=builder /app/deps /
14-
COPY --from=builder /app/bin/ /bin/
15-
COPY --from=builder /app/docker/root /
14+
COPY Gemfile* /app/
1615

17-
WORKDIR /app
16+
RUN bundle install --binstubs --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3 --without development test
1817

19-
RUN apk add --update --no-cache openssh-client openssh-keygen git bash redis
18+
ENV HPR_ENV=production \
19+
HPR_RUNNING=docker
2020

21-
VOLUME ["/app", "/data"]
21+
COPY . /app
22+
COPY docker/root /
23+
24+
VOLUME /app
2225

2326
EXPOSE 8848 6379
27+
28+
ENTRYPOINT [ "/init" ]

Dockerfile.ubuntu

Lines changed: 0 additions & 28 deletions
This file was deleted.

Gemfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
# source 'https://rubygems.org'
4+
source 'https://gems.ruby-china.com'
5+
6+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7+
8+
# Web Services
9+
gem 'puma', '~> 4.0.1'
10+
gem 'sidekiq', '~> 5.2.7'
11+
gem 'sinatra', '~> 2.0.5'
12+
gem 'sinatra-contrib', '~> 2.0.5'
13+
14+
# Database
15+
gem 'activerecord', '~> 5.2.3'
16+
gem 'sqlite3', '~> 1.4.1'
17+
18+
# Tools
19+
gem 'chronic_duration', '~> 0.10.6'
20+
gem 'commander', '~> 4.4.7'
21+
gem 'git', '~> 1.5.0'
22+
gem 'gitlab', '~> 4.12.0'
23+
gem 'rake'
24+
gem 'sentry-raven'
25+
gem 'settingslogic', '~> 2.0.9'
26+
27+
group :development, :test do
28+
# Test
29+
gem 'rack-test'
30+
gem 'rspec'
31+
gem 'rubocop'
32+
33+
# Debug
34+
gem 'awesome_print'
35+
36+
gem 'guard'
37+
gem 'guard-puma'
38+
gem 'guard-sidekiq'
39+
end

0 commit comments

Comments
 (0)