Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
Florian Schwab | aa4a03bdf2 | |
Florian Schwab | 1fd05219ce | |
Florian Schwab | 9501f25ebe | |
Florian Schwab | c658715d28 | |
Florian Schwab | afccfdd379 | |
Florian Schwab | 2fecb87e89 | |
Florian Schwab | 42cd9edc96 | |
Florian Schwab | 92831fe312 | |
Florian Schwab | 663a7cd563 | |
Florian Schwab | cb1e30b515 |
|
@ -1,17 +1,3 @@
|
|||
*.gem
|
||||
*.rbc
|
||||
.bundle
|
||||
.config
|
||||
.yardoc
|
||||
Gemfile.lock
|
||||
InstalledFiles
|
||||
_yardoc
|
||||
coverage
|
||||
doc/
|
||||
lib/bundler/man
|
||||
pkg
|
||||
rdoc
|
||||
spec/reports
|
||||
test/tmp
|
||||
test/version_tmp
|
||||
tmp
|
||||
/.bundle
|
||||
/Gemfile.lock
|
||||
/pkg
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
stages:
|
||||
- build
|
||||
- codequality
|
||||
- security
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image: ruby:2.6
|
||||
script:
|
||||
- gem install bundler --no-document
|
||||
- bundle update
|
||||
artifacts:
|
||||
paths:
|
||||
- Gemfile.lock
|
||||
|
||||
rubocop:
|
||||
stage: codequality
|
||||
image: ruby:2.6
|
||||
script:
|
||||
- gem install rubocop rubocop-performance --no-document
|
||||
- rubocop
|
||||
|
||||
dependency_scanning:
|
||||
stage: security
|
||||
dependencies:
|
||||
- build
|
||||
image: docker:stable
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
|
||||
--volume "$PWD:/code"
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
|
||||
artifacts:
|
||||
paths:
|
||||
- gl-dependency-scanning-report.json
|
|
@ -0,0 +1,12 @@
|
|||
require:
|
||||
- rubocop-performance
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
|
||||
Naming/FileName:
|
||||
Exclude:
|
||||
- 'lib/capistrano-rails-console.rb'
|
||||
|
||||
Metrics/LineLength:
|
||||
Max: 120
|
52
CHANGELOG.md
52
CHANGELOG.md
|
@ -1,62 +1,66 @@
|
|||
# Change Log
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 2.3.0 (2018-05-24)
|
||||
### Feature
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.3.0] - 2018-05-24
|
||||
### Added
|
||||
- remove rails 5.2 deprecation: _Passing the environment's name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -e option instead._
|
||||
- allow to set capistrano role to select server for remote console (#33)
|
||||
- allow to set shell used on server (#31)
|
||||
- [add rails:c alias to rails:console](https://github.com/ydkn/capistrano-rails-console/issues/36)
|
||||
- [add rails:c alias to rails:console](https://gitlab.com/ydkn/capistrano-rails-console/issues/36)
|
||||
|
||||
## 2.2.1 (2017-09-04)
|
||||
### Feature
|
||||
- [add rails:db alias to rails:dbconsole](https://github.com/ydkn/capistrano-rails-console/pull/32)
|
||||
## [2.2.1] - 2017-09-04
|
||||
### Added
|
||||
- [add rails:db alias to rails:dbconsole](https://gitlab.com/ydkn/capistrano-rails-console/merge_requests/32)
|
||||
|
||||
## 2.2.0 (2016-10-25)
|
||||
### Feature
|
||||
## [2.2.0] - 2016-10-25
|
||||
### Added
|
||||
- support for rbenv and chruby
|
||||
|
||||
## 2.1.1 (2016-10-04)
|
||||
### Feature
|
||||
## [2.1.1] - 2016-10-04
|
||||
### Added
|
||||
- use password from database.yml for dbconsole
|
||||
|
||||
## 2.1.0 (2016-09-23)
|
||||
### Feature
|
||||
- add support for `rails dbconsole`
|
||||
## [2.1.0] - 2016-09-23
|
||||
### Fixed
|
||||
- revert unintentional change when the gem is required
|
||||
### Added
|
||||
- add support for `rails dbconsole`
|
||||
|
||||
## 2.0.0 (2016-09-16)
|
||||
## [2.0.0] - 2016-09-16
|
||||
### Changed
|
||||
- switched connection part to _sshkit-interactive_
|
||||
- allow setting rails environment separately from deployment environment
|
||||
- allow setting user to run rails console separately from ssh user
|
||||
|
||||
## 1.0.2 (2015-12-06)
|
||||
## [1.0.2] - 2015-12-06
|
||||
### Fixed
|
||||
- works with sshkit 1.8
|
||||
|
||||
## 1.0.1 (2015-11-12)
|
||||
## [1.0.1] - 2015-11-12
|
||||
### Fixed
|
||||
- setting ssh hostname through `ssh_options`
|
||||
- use login shell
|
||||
|
||||
### Feature
|
||||
### Added
|
||||
- log ssh command before it is being executed
|
||||
|
||||
## 1.0.0 (2015-08-01)
|
||||
## [1.0.0] - 2015-08-01
|
||||
### Fixed
|
||||
- removed dependency on capistrano-rails gem setting propper rails_env
|
||||
- setting ssh port through `ssh_options`
|
||||
- setting ssh user through `ssh_options`
|
||||
- require a minimum version of 3.1.0 for capistrano (sshkit compatibility)
|
||||
|
||||
### Feature
|
||||
### Added
|
||||
- support for ssh keys
|
||||
|
||||
## 0.5.2 (2015-04-02)
|
||||
## [0.5.2] - 2015-04-02
|
||||
### Fixed
|
||||
- removed rails binary check due to different environments in sshkit and the ssh shellout
|
||||
|
||||
## 0.5.1 (2015-04-01)
|
||||
## [0.5.1] - 2015-04-01
|
||||
### Fixed
|
||||
- missing ssh proxy options in console task
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in capistrano-rails-console.gemspec
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
[![Gem Version](https://img.shields.io/gem/v/capistrano-rails-console.svg)](https://rubygems.org/gems/capistrano-rails-console)
|
||||
[![Code Climate](https://img.shields.io/codeclimate/github/ydkn/capistrano-rails-console.svg)](https://codeclimate.com/github/ydkn/capistrano-rails-console)
|
||||
|
||||
|
||||
# Capistrano::Rails::Console
|
||||
|
||||
Remote rails console and dbconsole for capistrano.
|
||||
|
@ -29,7 +25,7 @@ Or install it yourself as:
|
|||
You should ensure there is a `rails` binstub in the `current/bin` directory on the server otherwise
|
||||
this gem won't work (because rails itself won't work).
|
||||
If you experience any problems please verify that manually running `rails console` on the server does work.
|
||||
If it doesn't you are deploying your rails application wrong (check [#18](https://github.com/ydkn/capistrano-rails-console/issues/18) or [#26](https://github.com/ydkn/capistrano-rails-console/issues/26) for details)!
|
||||
If it doesn't you are deploying your rails application wrong (check [#18](https://gitlab.com/ydkn/capistrano-rails-console/issues/18) or [#26](https://gitlab.com/ydkn/capistrano-rails-console/issues/26) for details)!
|
||||
|
||||
Require in `Capfile` to use the default task:
|
||||
|
||||
|
@ -82,7 +78,7 @@ set :console_shell, '/bin/bash' # select shell to be used on server in case you
|
|||
|
||||
## Contributing
|
||||
|
||||
Bug reports and pull requests are welcome on GitHub at https://github.com/ydkn/capistrano-rails-console.
|
||||
Bug reports and pull requests are welcome on GitLab at https://gitlab.com/ydkn/capistrano-rails-console.
|
||||
|
||||
|
||||
## License
|
||||
|
|
4
Rakefile
4
Rakefile
|
@ -1 +1,3 @@
|
|||
require "bundler/gem_tasks"
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'bundler/gem_tasks'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# coding: utf-8
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
# frozen_string_literal: true
|
||||
|
||||
lib = File.expand_path('lib', __dir__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require 'capistrano/rails/console/version'
|
||||
|
||||
|
@ -8,12 +9,12 @@ Gem::Specification.new do |spec|
|
|||
spec.version = Capistrano::Rails::Console::VERSION
|
||||
spec.authors = ['Florian Schwab']
|
||||
spec.email = ['me@ydkn.de']
|
||||
spec.description = %q{Remote rails console for capistrano}
|
||||
spec.summary = %q{Remote rails console for capistrano}
|
||||
spec.homepage = 'https://github.com/ydkn/capistrano-rails-console'
|
||||
spec.description = 'Remote rails console for capistrano'
|
||||
spec.summary = 'Remote rails console for capistrano'
|
||||
spec.homepage = 'https://gitlab.com/ydkn/capistrano-rails-console'
|
||||
spec.license = 'MIT'
|
||||
|
||||
spec.files = `git ls-files`.split($/)
|
||||
spec.files = `git ls-files`.split("\n")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ['lib']
|
||||
|
@ -23,4 +24,6 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.add_development_dependency 'bundler'
|
||||
spec.add_development_dependency 'rake'
|
||||
spec.add_development_dependency 'rubocop'
|
||||
spec.add_development_dependency 'rubocop-performance'
|
||||
end
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
# frozen_string_literal: true
|
|
@ -1,4 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'sshkit/interactive'
|
||||
require 'capistrano/rails/console/version'
|
||||
|
||||
load File.expand_path('../console/tasks.cap', __FILE__)
|
||||
load File.expand_path('console/tasks.cap', __dir__)
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
namespace :load do
|
||||
task :defaults do
|
||||
# Add rails to RVM, Rbenv and Chruby bins
|
||||
%i{rvm_map_bins rbenv_map_bins chruby_map_bins}.each do |bins_var|
|
||||
bins = fetch(bins_var, [])
|
||||
set bins_var, bins.push('rails') unless bins.include?('rails')
|
||||
%i[rvm_map_bins rbenv_map_bins chruby_map_bins].each do |bins_var|
|
||||
bins = fetch(bins_var, [])
|
||||
set bins_var, bins.push('rails') unless bins.include?('rails')
|
||||
end
|
||||
|
||||
# Default values
|
||||
|
@ -17,7 +19,7 @@ end
|
|||
namespace :rails do
|
||||
desc 'Interact with a remote rails console'
|
||||
task :console do
|
||||
args = []
|
||||
args = []
|
||||
args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s')
|
||||
|
||||
run_interactively primary(fetch(:console_role)), shell: fetch(:console_shell) do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Capistrano
|
||||
module Capistrano
|
||||
# Rails
|
||||
|
|
Loading…
Reference in New Issue