Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails-api-with-engine-template
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
rails-api-with-engine-template
Commits
4d35f130
Commit
4d35f130
authored
Feb 17, 2022
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新部署脚本
parent
154a6596
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
5 deletions
+30
-5
.env
src/.env
+1
-0
Rakefile
src/Rakefile
+13
-0
database.yml
src/config/database.yml
+1
-0
deploy.rb
src/config/deploy.rb
+3
-1
template.rb
template.rb
+12
-4
No files found.
src/.env
View file @
4d35f130
...
...
@@ -6,6 +6,7 @@ DATABASE_HOST = localhost
DATABASE_USERNAME = postgres
DATABASE_PASSWORD =
DATABASE_NAME = app_name_to_replace
DATABASE_PORT = 5432
S3_ACCESS_KEY_ID = n7Xqqp1Fweznus_J0o14DJjuDuuZ-UJYa5lVMnSl
S3_SECRET_ACCESS_KEY = M-M8qDXRjz4wPz0khw9-QSco6yLzaeqNaouaDFP1
...
...
src/Rakefile
View file @
4d35f130
...
...
@@ -17,3 +17,16 @@ task :annotate do
sh
'annotate -i'
sh
'annotate -i --with-comment'
end
task
:bundle
do
sh
"bundle config set --local without 'development test'"
sh
'bundle install'
end
task
:start
do
sh
'RAILS_ENV=production bundle exec puma -C config/puma.rb'
end
task
:bin
do
sh
'rake app:update:bin'
end
src/config/database.yml
View file @
4d35f130
...
...
@@ -11,6 +11,7 @@ default: &default
username
:
<%= ENV["DATABASE_USERNAME"] %>
password
:
<%= ENV["DATABASE_PASSWORD"] %>
host
:
<%= ENV["DATABASE_HOST"] %>
port
:
<%= ENV["DATABASE_PORT"] %>
development
:
<<
:
*default
...
...
src/config/deploy.rb
View file @
4d35f130
...
...
@@ -29,7 +29,7 @@ set :forward_agent, true # SSH forward_agent.
# run `mina -d` to see all folders and files already included in `shared_dirs` and `shared_files`
# set :shared_dirs, fetch(:shared_dirs, []).push('public/assets')
# set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml')
set
:shared_dirs
,
fetch
(
:shared_dirs
,
[]).
push
(
'tmp/pids'
,
'tmp/sockets'
)
set
:shared_dirs
,
fetch
(
:shared_dirs
,
[]).
push
(
'tmp/pids'
,
'tmp/sockets'
,
'public'
)
set
:shared_files
,
fetch
(
:shared_files
,
[]).
push
(
'.env.production.local'
)
# sidekiq
...
...
@@ -66,7 +66,9 @@ task :deploy do
# instance of your project.
invoke
:'git:clone'
invoke
:'deploy:link_shared_paths'
command
%{bundle config set without 'development test'}
invoke
:'bundle:install'
command
'rake app:update:bin'
# invoke :'rails:db_create'
command
%{bundle exec rails db:migrate RAILS_ENV=production}
# invoke :'rails[db:migrate]'
...
...
template.rb
View file @
4d35f130
...
...
@@ -17,6 +17,11 @@ inject_into_file 'Gemfile', before: "gem 'pg" do <<-COMMENT
COMMENT
end
inject_into_file
'Gemfile'
,
before:
"gemspec"
do
<<-
COMMENT
git_source(:tallty) { |repo| "git@git.tallty.com:
#{
repo
}
.git" }
COMMENT
end
gsub_file
'app/controllers/application_controller.rb'
,
'respond_to :html'
,
'respond_to :json'
# A Ruby static code analyzer, based on the community Ruby style guide. http://rubocop.readthedocs.io
...
...
@@ -25,9 +30,10 @@ gem 'rubocop', require: false
gem
'rubocop-rails'
gem
'rubocop-performance'
gem
'simple_controller'
,
git:
'https://git.tallty.com/open-source/simple_controller.git'
gem
'acts_as_pasting'
,
git:
'http://git.tallty.com/open-source/acts_as_pasting.git'
gem
'tallty_import_export'
,
git:
'https://git.tallty.com/open-source/tallty_import_export.git'
gem
'simple_controller'
,
tallty:
'open-source/simple_controller'
gem
'acts_as_pasting'
,
tallty:
'open-source/acts_as_pasting'
gem
'tallty_import_export'
,
tallty:
'open-source/tallty_import_export'
gem
'pry-byebug'
# deploy
...
...
@@ -42,7 +48,7 @@ gem_group :development, :test do
gem
'rspec-rails'
gem
'shoulda-matchers'
gem
'factory_bot_rails'
gem
'rspec-rails-swagger'
,
git:
"https://git.tallty.com/open-source/rspec-rails-swagger.git"
gem
'rspec-rails-swagger'
,
tallty:
'open-source/rails-rails-swagger'
gem
'simplecov'
,
require:
false
gem
'annotate'
gem
"pry-rails"
...
...
@@ -65,6 +71,7 @@ dump.rdb
# Ignore local files
*.local
.DS_Store
/bin/*
COMMENT
end
...
...
@@ -143,6 +150,7 @@ after_bundle do
# run 'mkdir .pids'
# run 'touch .pids/.keep'
run
'bundle exec rake app:update:bin'
run
'bundle binstubs rspec-core'
run
'bundle binstubs bundler --force'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment