https://github.com/swagdevops/mina-setup_ssh
https://github.com/swagdevops/mina-setup_ssh
mina provisioning ssh ssh-keys
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/swagdevops/mina-setup_ssh
- Owner: SwagDevOps
- License: gpl-3.0
- Created: 2018-09-23T15:25:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-19T16:48:20.000Z (over 6 years ago)
- Last Synced: 2024-12-26T05:42:30.503Z (4 months ago)
- Topics: mina, provisioning, ssh, ssh-keys
- Language: Ruby
- Size: 92.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mina Setup SSH
``mina-setup_ssh`` provides SSH provisioning for [``mina``][mina-deploy].
## Requirements
``rsync`` is required (by default) to copy SSH keys during ``setup`` task.
## Configuration
The following configuration variables are available:
| Key | Type |
| --------------------------- | ----------------------- |
| ``setup_ssh_keys`` | ``Array`` or ``Hash`` |
| ``setup_ssh_sync_command `` | ``Array`` or ``String`` |
| ``setup_ssh_load_command`` | ``Array`` or ``String`` |Depends on the following settings:
* ``user``
* ``domain``When ``setup_ssh_keys`` is a ``Hash``, keys are used to name
files received by the server. When an ``Array`` file naming is symetric.## Executable dependencies
| Executable | |
| ----------- | ----------------------------------------------- |
| ``rsync`` | required (as default) both on client and server |
| ``ssh-add`` | required on server |
| ``ssh`` | required on client (OpenSSH) |## Sample ``Minafile``
```ruby
# frozen_string_literal: truerequire 'mina/rails'
require 'mina/git'
require 'mina/setup_ssh/tasks'set :application_name, 'foobar'
set :domain, '172.17.0.2'
set :user, 'root'
set :deploy_to, '/var/www/foobar.com'
set :repository, 'ssh://[email protected]:/var/git/foobar.git'
set :branch, 'master'
set :forward_agent, trueset :setup_ssh_keys, {
git: '~/.ssh/git_rsa'
}task :remote_environment do
invoke :'setup:ssh:load'
endtask :setup do
invoke :'setup:ssh:sync'
endtask :deploy do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'on :launch do
in_path(fetch(:current_path)) do
command %{mkdir -p tmp/}
command %{touch tmp/restart.txt}
end
end
end
end
```[mina-deploy]: https://github.com/mina-deploy