Gatling v1.0.0 Gatling.Utilities
Used by Gatling to generate the %Gatling.Env{}
Summary
Functions
Find an open port
Path to the git repo for given project
Location of the release after it’s been generated. Located inside the build_dir
Module defined in the project under ./upgrade.exs or ./deploy.exs
Directory to running applications
Path to deployed project
Read the projects ./domains file to be used when configuring nginx
Default system path to linux init.d scripts
Path to project’s init.d script
Path to the projects git post-update hook
Template used when loading a new project for the git post-update hook
List of all available mix tasks that can be run by the given project
Default system path to nginx sites-available
Default system path to nginx
Default system path to nginx sites-enabled
Template used to configure nginx
Path to Distillery’s config.exs file which is generated when calling mix release.init
List all releases found in ~/
Template used for the init.d script
Path to put the “upgrade” releases
Path to put the “upgrade” release’s .tar file
Find the version number of the project being deployed
Types
project :: binary
Functions
Specs
build_dir(project) :: binary
Path to the git repo for given project
This the build steps heppen here:
- Install dependencies
- Compile
- Generate release
~/<project>/
Specs
built_release_path(project) :: binary
Location of the release after it’s been generated. Located inside the build_dir
~/<project>/rel/<project>/releases/<version>/<project>.tar.gz
Specs
callback_module(project, [{:task, :upgrade | :deploy}]) :: module
Module defined in the project under ./upgrade.exs or ./deploy.exs
Specs
deploy_dir(project) :: binary
Directory to running applications
~/deployments/
Specs
deploy_path(project) :: binary
Path to deployed project
~/deployments/<project>
Read the projects ./domains file to be used when configuring nginx
Specs
etc_path(project) :: binary
Path to project’s init.d script
/etc/init.d/<project>
Specs
git_hook_template(domains: list, port: integer) :: binary
Template used when loading a new project for the git post-update hook
#!/bin/sh
unset GIT_DIR
exec sudo mix gatling.receive <%=@project%>
Specs
mix_tasks(project) :: [binary]
List of all available mix tasks that can be run by the given project
Specs
nginx_available_path(project) :: binary
Default system path to nginx sites-available
/etc/nginx/sites-available/
Specs
nginx_enabled_path(project) :: binary
Default system path to nginx sites-enabled
/etc/nginx/sites-enabeld
Specs
nginx_template(domains: list, port: integer) :: binary
Template used to configure nginx
server {
listen 80;
server_name <%= @domains %>;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:<%=@port%>;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Specs
release_config_path(project) :: binary
Path to Distillery’s config.exs file which is generated when calling mix release.init
~/<project>/rel/config/exs
Specs
script_template(project_name: project, port: integer) :: binary
Template used for the init.d script.
If/when the server starts, this will boot your project
#!/bin/sh
### BEGIN INIT INFO
# Provides: <%= @project_name %>
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Plug Application: <%= @project_name %>
### END INIT INFO
export MIX_ENV=prod
export PORT=<%= @port %>
export HOME=<%= System.user_home %>/deployments/<%= @project_name %>
<%= System.user_home %>/deployments/<%=@project_name%>/bin/<%=@project_name%> "$1" "$2"
Specs
upgrade_dir(project) :: binary
Path to put the “upgrade” releases
~/deployments/<project>/releases/<version>
Specs
upgrade_path(project) :: binary
Path to put the “upgrade” release’s .tar file
~/deployments/<project>/releases/<version>/<project>.tar.gx
Specs
version(project) :: binary
Find the version number of the project being deployed