-
Notifications
You must be signed in to change notification settings - Fork 6.1k
/
nanobox_cli.sh
174 lines (120 loc) Β· 5.36 KB
/
nanobox_cli.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# *****************************************************************************
# CLI COMMANDS SUMMARY
# https://docs.nanobox.io/cli/
# *****************************************************************************
# Update your Nanobox CLI to the most recent version
nanobox-update
# Starts your local environment, allowing you to run your app
nanobox run [<command>]
# Builds your app's runtime
nanobox build
# Compiles your app's code into a deployable package
nanobox compile
# Manages connections to remote applications
nanobox remote add <app-name> [<remote-alias>]
nanobox remote rm <remote-alias>
nanobox remote ls
# Deploys your app to a live app
nanobox deploy [<dry-run | {remote-alias}>] [-m <message>]
# Opens an interactive terminal from inside a component in your live app
nanobox console [<local | dry-run | {remote-alias}>] <component.id>
# Displays information about the app and its components
nanobox info [<local | dry-run | {remote-alias}>]
# Establishes a secure tunnel from your local machine to a running service
nanobox tunnel [<remote-alias>] <component.id> [-p <local-port>[:[<remote-port>]]]
# Manages environment variables on your production environment
nanobox evar add [<local | dry-run | {remote-alias}>] <key1>=<value1> <key2>=<value2>
nanobox evar load [<local | dry-run | {remote-alias}>] path/to/file
nanobox evar rm [<local | dry-run | {remote-alias}>] <key1> <key2>
nanobox evar ls [<local | dry-run | {remote-alias}>]
# Manage DNS aliases for local applications
nanobox dns add <local | dry-run> <hostname>
nanobox dns rm <local | dry-run> <hostname>
nanobox dns ls <local | dry-run>
# View and streams application logs
nanobox log [<dry-run | {remote-alias}>]
nanobox log [<dry-run | {remote-alias}>] -f
nanobox log [<dry-run | {remote-alias}>] -n <number>
# Walks through prompts to configure Nanobox
nanobox config set <config-key> <config-value>
nanobox config get <config-key>
nanobox config ls
# Downloads the most recent versions of Nanobox docker images
nanobox update-images
# Authenticates your Nanobox client with your nanobox.io account
nanobox login
# Removes your nanobox.io api token from your local nanobox client
nanobox logout
# Starts the Nanobox container
nanobox start
# Stops the Nanobox container
nanobox stop
# Display the status of Nanobox & apps
nanobox status
# Destroys the current project and removes it from Nanobox
nanobox destroy [<local | dry-run>]
# Clean out any environments that no longer exist
nanobox clean
# Removes all Nanobox-created containers, files, & data
nanobox implode
# Show the current Nanobox version
nanobox version
--help # Displays help information about the CLI and specific commands
--debug # In the event of a failure, drop into a debug context
-t, --trace # Increases display output and sets level to 'trace'
-v, --verbose # Increases display output and sets level to 'debug'
-f, --force # Forces the command to run without any confirmation. Use responsibly!
# *****************************************************************************
# LOCAL ENVIRONMENT
# https://docs.nanobox.io/workflow/modifying-your-app/
# *****************************************************************************
# Add a convenient way to access your app from the browser
nanobox dns add local vue.dev
nanobox dns add local laravel.dev
# Run your app as you would normally, with Nanobox
nanobox run npm run dev --host 0.0.0.0
nanobox run python manage.py runserver 0.0.0.0:8000
# View info about the app and its components for a given environment
nanobox info local
# *****************************************************************************
# DRY RUN ENVIRONMENT
# https://docs.nanobox.io/workflow/dry-run/
# *****************************************************************************
# Add a DNS Alias to a dry-run app
nanobox dns add dry-run laravel.preview
# Preview your app locally
nanobox deploy dry-run
# Add environment variables to dry-run
nanobox evar add dry-run ENV=staging PROCESS_JOBS=true
# Console into web.site in a dry-run app
nanobox console dry-run web.site
# Output the connection credentials for your dry-run components
nanobox info dry-run
# *****************************************************************************
# PRODUCTION ENVIRONMENT
# https://docs.nanobox.io/workflow/deploy-code/
# *****************************************************************************
# Add your live app as a remote
nanobox remote add app-name
# Deploy to your remote server(s)
nanobox deploy
# Drop you into an interactive console inside a component running on production
nanobox console <component.id>
# View logs from your app
nanobox log [<dry-run | {remote-alias}>]
nanobox log [<dry-run | {remote-alias}>] -n 100
# Creates a secure tunnel from your local machine to a production data component
# Local port can be omitted
nanobox tunnel <component.id> -p <local_port>
# *****************************************************************************
# ENVIRONMENT VARIABLES
# https://docs.nanobox.io/cli/evar/
# *****************************************************************************
# Add an environment variable
nanobox evar add local KEY1=VALUE1 KEY2=VALUE2
# Add environment variables from a file
nanobox evar load local path/to/evar-file
# Remove an environment variable
nanobox evar rm local KEY1
# List all variables for a given environment
nanobox evar ls local