Throw some pixy dust on your test environment devon - copyright 2018 (c) Paul Brodner
This project structure is automatically generated by devon
Checkout the guidelines bellow for a basic usage: how to use this generate project, how to configure it, hot to add new scripts according to your needs.
The structure of this project if defined as:
├── Gemfile # contains the ruby gemfiles
├── LICENSE # license
├── README.md # this readme file
├── Rakefile # devon rake commands, here you can define your own commands too if you like
├── config.ru # used for starting up Sinatra server
├── configs # contains all Configuration files
│ ├── simple
│ │ └── sample.txt.erb
│ └── simple.rb # one configuration that will execute a shell script
├── connections # contains all Connextion settings
│ ├── env.yml
│ ├── env.yml.example
│ ├── vagrant # vagrant folder for spinning up one virtual machine for testing purposes
│ │ └── Vagrantfile
│ └── vagrant.rb
└── scripts
└── connect.rb # one simple script that will run a shell script if connection is succesfull
Open one terminal and navigate to the root folder of this project, then type:
$ rake -T
This command will show you all available devon
commands that you can run.
Example (from devon v2.0.0):
rake configs:list # List available configurations
rake configs:new # Create a new Configuration
rake conn:list # List available connections
rake db:init # Initi/Reinitialize db
rake scripts:list # List available scripts
rake scripts:new # Create a new script
rake scripts:run # Run script (in bash: rake scripts:run CMD=1,2,3 INTERACTIVE=TRUE)
rake scripts:run_all[script,connection,config] # Run script (in bash: rake scripts:run CMD=1,2,3 INTERACTIVE=TRUE)
rake server:up # Start Sinatra Server
$ rake scripts:list
The command will display all files available in scripts
folder:
[
[0] "scripts/connect.rb"
]
If multiple scripts are created inside scripts
folder, each one of them is displayed with a particular ID (0-> n)
$ rake conn:list
The command result will display all files available in connections
folder:
[
[0] "connections/vagrant.rb {127.0.0.1}"
]
If multiple scripts are created inside connections
folder, each one of them is displayed with a particular ID (0-> n).
Notice that the IP of the target machine is also displayed (taken automatically from env.yml), for better identification.
$ rake scripts:run
One interactive shell is executed.
a) First it will list all available scripts (as we saw above) and ask you to choose a script file to execute from that list.
Let's check the existing one 0
when Choose a file from scripts to use:
text is displayed and press ENTER.
Hint: for the file available at location
0
you can also press ENTER directly, no need to type0
then ENTER.
b) The interactive task will then display all available connections as we saw in previous paragraph. Type 0
and press ENTER again.
Hint: for the file available at location
0
you can also press ENTER directly, no need to type0
then ENTER.
Next a list of available configurations is displayed (i.e. what configuration should this tool use in combination with your script).
In our case, we just execute a shell script (see scripts/connect.rb) listing all files based on choosen configuration (see connections/vagrant.rb), so "No config" can be choosen.
If you have access to a remote machine via SSH, please change the
connection/env.yml
file, setting up the correct IP address and connection credentials, or spin up a local Virtual Machine using the guideline bellow.
If you want run a particular script in non-interactive way, you can use the
scripts:run_all
task:
$ rake scripts:run_all['scripts/connect.rb','connections/vagrant.rb','']