thermostat init
This command is used to start a new application from scratch using only local files. It does not attempt to pull any data from the Thermostat API, instead it expects to find a code and data folder in the current directory which it uses to initialize the new application.
In order for this command to succeed your current directory must contain a "code" folder that contains a Git repository that contains a Thermostat configuration file, and optionally a "data" folder, and no other files. The command will read the configuration file in the code folder and load the application into Thermostat, intializing and configuring any services that the application depends on. The basic order of operations of this process are as follows:
- Check deployment status: Thermostat checks that the current directory contains deployable application files and checks that no other deployments of this application/stage combination already exist.
- Save application configuration: Thermostat saves an internal record of this application in it's internal configuration file.
- Apply data links: Thermostat symlinks files from the data folder into the code folder according to the data_links configuration in the application's Thermostat configuration file.
- Build application: Thermostat runs the "build" script defined in the scripts section of the application's Thermostat configuration file if it exists and if the
--no-build
option is not passed. - Update services: Thermostat initializes and configures the application services as specified in the services section of the application's Thermostat configuration file.
- Start application: Thermostat runs the "start" script defined in the scripts section of the application's Thermostat configuration file if it exists and if the
--no-start
option is not passed.
If any step of the initialization process fails, all changes are automatically rolled back to how things were before the command was run.
Usage:
$ thermostat init <client/application> <stage[:substage]>
Positionals:
client/application [string] [required] The client and application name of the new application
stage:substage [string] [required] The stage (and optionally the substage) of the new application (the stage must be production, staging, or development, unless --custom-stage is passed)
Options:
--no-build [boolean] Initialize the application without running the build script.
--no-start [boolean] Initialize the application without running the start script.
--custom-stage [boolean] Allow the application to be initialized with a custom stage name.
-f, --force [boolean] Allow the initalization process to perform dangerous actions such as deleting files and databases.