Command line interface, Lamp-io platform
$ composer global require lamp-io/lio
composer require lamp-io/lio
lio command [options] [arguments]
Tokens can be generated at https://www.lamp.io/tokens
How lio can handle tokens
-
Store token in a environment variable
export LAMP_IO_TOKEN={TOKEN_VALUE}
-
Store token in a file
Call auth command, it will ask you to prompt token
lio auth
Token will be stored in $HOME/.config/lamp.io/token
[-j][--json]
(bool) Output as a raw json[-h][--help]
(bool) Display this help message[-q][--quiet]
(bool) Do not output any message[-V][--version]
(bool) Display this application version[--ansi]
(bool) Force ANSI output[--no-ansi]
(bool) Disable ANSI output[-n][--no-interaction]
(bool) Do not ask any interactive question[-v|vv|vvv][--verbose]
(bool) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
Set auth token.
Get your token at https://www.lamp.io/ on settings page
Options:
[-u][--update_token]
(bool) Update existing token[-t][--token]
(string) Set/Update auth token, in noninteractive mode
-
apps:new <organization_id> [-d][--description] [--httpd_conf] [--max_replicas] [-m][--memory] [--min_replicas] [--php_ini] [-r][--replicas] [--vcpu] [--github_webhook_secret] [--webhook_run_command] [--hostname] [--hostname_certificate_valid] [--public] [--delete_protection]
Creates a new app
Api reference https://www.lamp.io/api#/apps/appsCreate
Arguments:
[<organization_id>]
(string) The ID of the organization this app belongs to
Options:
[-d][--description]
(string) A description[--httpd_conf]
(string) Path to your httpd.conf[--max_replicas]
(int) The maximum number of auto-scaled replicas[-m][--memory]
(string) The amount of memory available (example: 1Gi) (default: 128Mi)[--min_replicas]
(int) The minimum number of auto-scaled replicas (default: 1)[--php_ini]
(string) Path to your php.ini[-r][--replicas]
(int) The number current number replicas available. 0 stops app (default: 1)[--vcpu]
(float) The number of virtual cpu cores available (maximum: 4, minimum: 0.25)[--github_webhook_secret]
(string) Github web-hook secret token[--webhook_run_command]
(string) Github web-hook command[--hostname]
(string) The hostname for the app[--hostname_certificate_valid]
(bool) Is hostname certificate valid[--public]
(bool) Public for read-only[--delete_protection]
(bool) When enabled the app can not be deleted
-
apps:update <app_id> <organization_id> [-d][--description] [--httpd_conf] [--max_replicas] [-m][--memory] [--min_replicas] [--php_ini] [-r][--replicas] [--vcpu] [--vcpu] [--github_webhook_secret] [--webhook_run_command] [--hostname] [--hostname_certificate_valid] [--public] [--delete_protection]
Update app
Api reference https://www.lamp.io/api#/apps/appsCreate
Arguments:
<app_id>
(string) The ID of the app[<organization_id>]
(string) The ID of the organization this app belongs to
Options:
[--httpd_conf]
(string) Path to your httpd.conf[--max_replicas]
(int) The maximum number of auto-scaled replicas[-m][--memory]
(string) The amount of memory available (example: 1Gi) (default: 128Mi)[--min_replicas]
(int) The minimum number of auto-scaled replicas (default: 1)[--php_ini]
(string) Path to your php.ini[-r][--replicas]
(int) The number current number replicas available. 0 stops app (default: 1)[--vcpu]
(float) The number of virtual cpu cores available (maximum: 4, minimum: 0.25)[--github_webhook_secret]
(string) Github web-hook secret token[--webhook_run_command]
(string) Github web-hook command[--hostname]
(string) The hostname for the app[--hostname_certificate_valid]
(bool) Is hostname certificate valid[--public]
(bool) Public for read-only[--delete_protection]
(bool) When enabled the app can not be deleted
-
Delete an app
Api reference https://www.lamp.io/api#/apps/appsDestroy
Arguments:
<app_id>
(string) The ID of the app
Options:
[--yes][-y]
(bool) Skip confirm delete question
-
Returns the apps for an organization
Api reference https://www.lamp.io/api#/apps/appsList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return your app
Api reference https://www.lamp.io/api#/apps/appsShow
Arguments:
<app_id>
(string) The ID of the app
-
Enable/disable app
Api reference https://www.lamp.io/api#/apps/appsUpdate
Arguments:
<app_id>
(string) The ID of the app
Options:
[--enable]
(bool) Enable your stopped app[--disable]
(bool) Disable your running app
-
autodeploys:new <github_repository> [--organization_id][-o] [--create_app_on_pr][-c] [--delete_app_on_branch_delete][-d]
Create an autodeploy for an organization
Api reference https://www.lamp.io/api#/autodeploys/autoDeploysCreate
Arguments:
<github_repository>
(string) The repository this autodeploy uses
Options:
[-o][--organization_id]
(string) One organization_id. If omitted defaults to user's default organization[-c][--create_app_on_pr]
(bool) Create lamp.io app when a PR is created[-d][--delete_app_on_branch_delete]
(bool) Delete lamp.io app when branch is deleted
-
autodeploys:update <autodeploy_id> [--github_repository][-g] [--organization_id][-o] [--create_app_on_pr][-c]
Update an autodeploy
Api reference https://www.lamp.io/api#/autodeploys/autoDeploysUpdate
Arguments:
<autodeploy_id>
(string) The ID of the autodeploy
Options:
[-g][--github_repository]
(string) The repository this autodeploy uses[-c][--create_app_on_pr]
(bool) Create lamp.io app when a PR is created[-d][--delete_app_on_branch_delete]
(bool) Delete lamp.io app when branch is deleted
-
Delete an autodeploy
Api reference https://www.lamp.io/api#/autodeploys/autoDeploysDelete
Arguments:
<autodeploy_id>
(string) The ID of the autodeploy
-
Return autodeploys
Api reference https://www.lamp.io/api#/autodeploys/autoDeploysList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Returns an autodeploy
Api reference https://www.lamp.io/api#/autodeploys/autoDeploysShow
Arguments:
<autodeploy_id>
(string) The ID of the autodeploy
-
Create an autodeployBranch for an organization
Api reference https://www.lamp.io/api#/autodeploys_branch/autoDeploysBranchCreate
Arguments:
<app_id>
(string) The ID of the app this branch deploys to<autodeploy_id>
(string) The ID of the autodeploy<branch>
(string) Branch name
Options:
[-o][--organization_id]
(string) One organization_id. If omitted defaults to user's default organization
-
Update an autodeploys_branch
Api reference https://www.lamp.io/api#/autodeploys_branch/autoDeploysBranchUpdate
Arguments:
<autodeploy_branch_id>
(string) The ID of the autodeployBranch
Options:
[-a][--app_id]
(string) The ID of the app to deploy against[-b][--branch]
(string) Branch name
-
Delete an autodeploys_branch
Api reference https://www.lamp.io/api#/autodeploys_branch/autoDeploysBranchDelete
Arguments:
<autodeploy_branch_id>
(string) The ID of the autodeployBranch
-
Return autodeploys_branch
Api reference https://www.lamp.io/api#/autodeploys_branch/autoDeploysBranchList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return an autodeploy_branch
Api reference https://www.lamp.io/api#/autodeploys_branch/autoDeploysBranchShow
Arguments:
<autodeploy_branch_id>
(string) The ID of the autodeployBranch
-
Back up files in app
Api reference https://www.lamp.io/api#/app_backups/appBackupsCreate
Arguments:
<app_id>
(string) The ID of the app
-
Download an app backup
Api reference https://www.lamp.io/api#/app_backups/appBackupsShow
Arguments:
<app_backup_id>
(string) The ID of the app backup[<dir>]
(string) Local path for downloaded file. (default: current working directory)
-
Delete an app backup
Api reference https://www.lamp.io/api#/app_backups/appBackupsShow
Arguments:
<app_backup_id>
(string) The ID of the app backup
Options:
[--yes][-y]
(bool) Skip confirm delete question
-
Return app backups
Api reference https://www.lamp.io/api#/app_backups/appBackupsList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return an app backup
Get an app backup
Api reference https://www.lamp.io/api#/app_backups/appBackupsShow
Arguments:
<app_backup_id>
(string) The ID of the app backup
-
Restore files to an app
Api reference https://www.lamp.io/api#/app_restores/appRestoresCreate
Arguments:
<app_id>
(string) The ID of the app<app_backup_id>
(string) The ID of the app backup
-
Delete an app backup
Api reference https://www.lamp.io/api#/app_restores/appRestoresDelete
Arguments:
<app_restore_id>
(string) The ID of the app restore
Options:
[--yes][-y]
(bool) Skip confirm delete question
-
Return app restores
Api reference https://www.lamp.io/api#/app_restores/appRestoresList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return an app restore
Allow you to get an app backup, api reference https://www.lamp.io/api#/app_backups/appRestoresShow
Arguments:
<app_restore_id>
(string) The ID of the app restore
-
Run command on app
Api reference https://www.lamp.io/api#/app_backups/appRunsCreate
Arguments:
<app_id>
(string) The ID of the app<exec>
(string) Command to run
-
Delete app run
Api reference https://www.lamp.io/api#/app_runs/appRunsDelete
Arguments:
<app_run_id>
(string) ID of app run
-
Return all app runs for all user's organizations
Api reference https://www.lamp.io/api#/app_runs/appRunsList
Options:
[--page_number]
(int) Pagination page, default value 1[--page_size]
(int) Count per paginated page, default value 100[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization[--output_lines]
(int) Maximum number of lines returned. 1 is Unlimited. Default 5
-
Return app run
Api reference https://www.lamp.io/api#/app_runs/appRunsShow
Arguments:
<app_run_id>
(string) ID of app run
-
databases:new [-d][--description] [-m][--memory] [-o][--organization_id] [--mysql_root_password] [--my_cnf] [--ssd] [--vcpu] [--delete_protection]
Create a new database
Api reference https://www.lamp.io/api#/databases/databasesCreate
Options:
[-d][--description]
(string) Description of your database[-m][--memory]
(string) Amount of virtual memory on your database (default: 512Mi)[-o][--organization_id]
(string) Name of your organization[--mysql_root_password]
(string) Your root password for mysql[--my_cnf]
(string) Path to your database config file[--ssd]
(string) Size of ssd storage (default: 1Gi)[--vcpu]
(float) The number of virtual cpu cores available (default: 0.25)[--delete_protection]
(bool) When enabled the database can not be deleted
-
Delete a database
Api reference https://www.lamp.io/api#/databases/databasesDelete
Arguments:
*
<database_id>
(string) The ID of databaseOptions:
[--yes][-y]
(bool) Skip confirm delete question
-
databases:update <database_id> [-d][--description] [-m][--memory] [-o][--organization_id] [--my_cnf] [--mysql_root_password] [--ssd] [--vcpu] [--delete_protection]
Update a database.
Api reference https://www.lamp.io/api#/databases/databasesUpdate
Arguments:
*
<database_id>)
(string) The ID of databaseOptions:
[-d][--description]
(string) Description of your database[-m][--memory]
(string) Amount of virtual memory on your database (default: 512Mi)[-o][--organization_id]
(string) Name of your organization[--mysql_root_password]
(bool) If you need to update root password, set it as true[--my_cnf]
(string) Path to your database config file[--ssd]
(string) Size of ssd storage (default: 1Gi)[--vcpu]
(float) The number of virtual cpu cores available (default: 0.25)[--delete_protection]
(bool) When enabled the database can not be deleted
-
Returns all databases
Api reference https://www.lamp.io/api#/databases/databasesList
Options:
<organization_id>
(string) Filter output by organization id value
-
Returns a database
Api reference https://www.lamp.io/api#/databases/databasesShow
Arguments:
<database_id>
(string) The ID of database
-
Back up database
Api reference https://www.lamp.io/api#/db_backups/dbBackupsCreate
Arguments:
*
<database_id>
(string) The id of database -
Delete a db backup
Api reference https://www.lamp.io/api#/db_backups/dbBackupsDelete
Arguments:
*
<db_backup_id>
(string) The ID of the db backupOptions:
[--yes][-y]
(string) Skip confirm delete question
-
###db_backups:list [-o][--organization_id]
Return db backups
Api reference https://www.lamp.io/api#/db_backups/dbBackupsList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return a database backup
Api reference https://www.lamp.io/api#/db_backups/dbBackupsShow
Arguments:
<db_backup_id>
(string) The ID of the db backup
-
Create database restore job (restore backup to a database)
Api reference https://www.lamp.io/api#/db_restores/dbRestoresCreate
Arguments:
<database_id>
(string) The id of database<db_backup_id>
(string) The ID of the db backup
-
Delete a db restore job
Api reference https://www.lamp.io/api#/db_restores/dbRestoresDelete
Arguments:
<db_restore_id>
(string) The ID of the db restore
-
Return db restore jobs
Api reference https://www.lamp.io/api#/db_backups/dbBackupsList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Return a db restore job
Api reference https://www.lamp.io/api#/db_backups/dbRestoresShow
Arguments:
<db_restore_id>
(string) The ID of the db restore
-
Create a file on your app
Api reference https://www.lamp.io/api#/files/filesCreate
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of a file to create'[<contents>]
(string) File content
Options:
[--source]
(string) A URL to that will be retrieved for fetch content[--apache_writable]
(bool) Allow apache to write to the file ID
-
Return files from the root of an app
Api reference https://www.lamp.io/api#/files/filesList
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) The ID of the file. The ID is also the file path relative to its app root (default: app root)
Options:
[-l][--limit]
(int) The number of results to return in each response to a list operation. The default value is 1000 (the maximum allowed). Using a lower value may help if an operation times out (default: 1000)[--human-readable]
(bool) Format size values from raw bytes to human readable format[-r][--recursive]
(bool) Command is performed on all files or objects under the specified path
-
Creates new file
Api reference https://www.lamp.io/api#/files/filesCreate
Arguments:
<file>
(string) Local path of file to upload<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to save
-
Download files as zip.
Api reference https://www.lamp.io/api#/files/filesShow
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) The ID of the file. The ID is also the file path relative to its app root<dir>
(string) Local path for downloaded file (default: current working dir)
-
Update file at file_id(file path including file name, relative to app root)
Api reference https://www.lamp.io/api#/files/filesUpdateID
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to update. If omitted, update app root directory[<local_file>]
(string) Path to a local file; this is uploaded to remote_path
Options:
[-r][--recursive]
(bool) Recur into directories (works only with [--apache_writable] option)[--apache_writable]
(bool) Allow apache to write to the file ID
-
Remove file/directory from your app
Api reference https://www.lamp.io/api#/files/filesDestroy
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to delete
Options:
[--yes][-y]
(bool) Skip confirm delete question
-
Create a directory on your app
Api reference https://www.lamp.io/api#/files/filesCreate
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of directory to create
Options:
[--apache_writable]
(bool) Allow apache to write to the file ID
-
Create a symlink on your app
Api reference https://www.lamp.io/api#/files/filesCreate
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of a symlink to create<target>
(string) Symlink target file ID
Options:
[--apache_writable]
(bool) Allow apache to write to the file ID
-
Update a symlink on your app
Api reference https://www.lamp.io/api#/files/filesUpdate
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of a symlink to update<target>
(string) Symlink target file ID
Options:
[--apache_writable]
(bool) Allow apache to write to the file ID
-
Extract archive file
Api reference https://www.lamp.io/api#/files/filesUpdateID
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to unarchive
-
Fetch file from URL
Api reference https://www.lamp.io/api#/files/filesUpdateID
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to fetch<source>
(string) URL to fetch
-
Move file to another directory
Arguments:
<app_id>
(string) The ID of the app<file_id>
(string) File ID of file to move<move_path>
(string) The target File ID to move to. NOTE: The target directory must exist
-
Creates a new key
Api reference https://www.lamp.io/api#/keys/keysCreate
Options:
[-o][--organization_id]
(string) One organization_id. If omitted defaults to user's default organization[-d][--description]
(string) An immutable description for this key
-
Update a key
Api reference https://www.lamp.io/api#/keys/keysUpdate
Arguments:
<key_id>
(string) The ID of the key
Options:
[-d][--description]
(string) An immutable description for this key
-
Delete a key
Api reference https://www.lamp.io/api#/keys/keysDelete
Arguments:
<key_id>
(string) The ID of the key
-
Returns keys for organization
Api reference https://www.lamp.io/api#/keys/keysList
Options
[-o][--organization_id]
(string) One organization_id. If omitted defaults to user's default organization
-
Returns a key
Api reference https://www.lamp.io/api#/keys/keysShow
Arguments:
<key_id>
(string) The ID of the key
-
Return logs
Api reference https://www.lamp.io/api#/logs/logsList
Options
[-o][--organization_id]
(string) One organization_id. If omitted defaults to user's default organization[--pod_name][-p]
(string) One pod_name. Uses wildcard prefix match[--start_time]
(string) Start time conforming to RFC3339 (default: 10 minutes in the past)[--end_time]
(string) End time conforming to RFC3339. (default: current date)
-
Update an organization
Api reference https://www.lamp.io/api#/organizations/organizationsUpdate
Arguments:
<organization_id>
(string) The ID of the organization
Options:
[--name]
(string) New organization name[--promo_code]
(string) Apply promo code[--payment][-p]
(string) Stripe source id
-
Returns this user's organizations
Api reference https://www.lamp.io/api#/organizations/organizationsList
###Organization users
-
Update an organization/user relationship (Allow to set/remove selected user role as an organization admin)
Api reference https://www.lamp.io/api#/organization_users/organizationUsersUpdate
Arguments:
<organization_user_id>
(string) The ID of the organization_use
Options:
[--admin]
(bool) Set selected user as admin of organization (if you need to remove admin role from selected user, just omit this option)
-
Returns organization/user relationships
Api reference https://www.lamp.io/api#/organization_users/organizationUsersList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization
-
Returns a organization/user relationship
Api reference https://www.lamp.io/api#/organization_users/organizationUsersShow
Arguments:
<organization_user_id>
(string) The ID of the organization_use
-
Creates a new token
Api reference https://www.lamp.io/api#/tokens/tokensCreate
Options:
[--description][-d]
(string) Token description[--enable]
(bool) Enable new token
-
Delete a token
Api reference https://www.lamp.io/api#/tokens/tokensDelete
Arguments:
<token_id>
(string) The ID of the token
Options:
[-yes][-y]
(bool) Skip confirm delete question
-
Update a token
Api reference https://www.lamp.io/api#/tokens/tokensList
Arguments:
<token_id>
(string) The ID of the token
Options:
[--enable]
(bool) Enable token[--disable]
(bool) Disable token
-
Returns all tokens for this user
Api reference https://www.lamp.io/api#/tokens/tokensList
-
Returns a token
Arguments:
<token_id>
(string) The ID of the token
-
Returns users
Api reference https://www.lamp.io/api#/users/usersList
Options:
[-o][--organization_id]
(string) Comma-separated list of requested organization_ids. If omitted defaults to user's default organization[--email][-e]
(string) Email address to filter for
self-update
Update your phar build to the latest release (will work only if you use phar build)
Requires 2 environment variables
-
APP_ID required Your lamp.io App Id
-
LAMP_IO_TOKEN required The lamp.io access token
.travis.yaml
language: php
sudo: false
php:
- "7.3"
jobs:
include:
- stage: deploy
before_script:
- composer install
- chmod +x build.sh
script: ./deploy.sh
deploy.sh
#!/bin/sh -l
set -e
composer install --optimize-autoloader
composer global require lamp-io/lio dev-master --update-with-dependencies
alias lio=$HOME/.composer/vendor/bin/lio
cp .env .env.live
app=$APP_ID
release="$(date +%Y%m%d%H%m%s)";
# zip up the app for uploading
zip -r /tmp/artifact.zip . \
-x "*\.env*" \
-x "*\.git*" \
--quiet
# create the new release directory in the lamp.io app
lio files:new:dir $app releases/$release
# upload the zip into it
lio files:upload /tmp/artifact.zip $app releases/$release/artifact.zip
# unzip it remotely
lio files:update:unarchive $app releases/$release/artifact.zip
# clean up
lio files:delete $app releases/$release/artifact.zip -y
# check if the (shared) storage directory already exists
if ! lio files:list $app storage -q; then
# if not, use the one from this release to get started
lio files:update:move $app releases/$release/storage /storage
fi
# delete this releases storage directory and symlink it to the shared one
lio files:delete $app releases/$release/storage -y -q
lio files:new:symlink $app releases/$release/storage ../../storage
# make sure the app can write to things
lio files:update $app storage --apache_writable=true --recursive
lio files:update $app releases/$release/bootstrap/cache --apache_writable=true --recursive
# upload the local .env.live file to be the remote .env file
lio files:upload .env.live $app releases/$release/.env
# run artisan remotely
# lio app_runs:new $app "cd releases/$release && php artisan migrate"
# get the current state of the docroot (public)
public="$(lio files:list $app public -j)"
# if there's a directory already there
if [ "$(echo $public | jq -r '.data.attributes.is_dir')" = 'true' ]; then
# back it up as a pre-release
lio files:new:dir $app releases/$release-pre
lio files:update:move $app public releases/$release-pre/public
# and then symlink public to this new release
lio files:new:symlink $app public releases/$release/public
# else if there's a symlink already there
elif [ "$(echo $public | jq -r '.data.attributes.is_symlink')" = 'true' ]; then
# update it to point to this new release
lio files:update:symlink $app public releases/$release/public
fi
Basic workflow example:
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Lio deploy
uses: lamp-io/action-lio-deploy@master
with:
auth_token: ${{ secrets.lamp_io_token }}
app_id: $({secrets.lamp_io_app_id})
You can get more details on lamp-io/lio_deploy action, repository page
composer build
Create phar build
The Lamp-io/lio command line interface is open-source software licensed under the MIT license.