github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/website/source/docs/concepts/compile.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Appfile Compilation" 4 sidebar_current: "docs-concepts-compile" 5 description: |- 6 The compilation step in Otto takes the [Appfile](/docs/concepts/appfile.html), 7 validates it, fetches any dependencies, and generates dozens of output 8 files that are used by subsequent Otto operations. 9 --- 10 11 # Compilation 12 13 The first command run on any project with Otto is `otto compile`. 14 The idea of "compilation" is core to the function of Otto, and is 15 also the secret behind a lot of the magic of Otto. 16 17 The compilation step in Otto takes the [Appfile](/docs/concepts/appfile.html), 18 validates it, fetches any dependencies, and generates dozens of output 19 files that are used by subsequent Otto operations. 20 21 Because compilation is relatively rare, it gives Otto an opportunity to 22 perform more expensive operations, such as resolving dependencies, 23 fetching Appfile imports, semantic validation, verifying state, 24 generating upgrade paths for deploys, etc. Despite this, compilation in 25 Otto is still incredibly fast, taking milliseconds, except in the case 26 of network operations (dependencies, imports). 27 28 Once compilation is complete, the remaining Otto operations such as 29 `otto dev` use the output of compilation and can assume validation passed, 30 making their load times much faster. 31 32 ## Output 33 34 The output of Otto compilation goes into the ".otto" directory relative 35 to the location of the Appfile. This directory is local to every Otto 36 compilation and _should not_ be committed to version control. 37 38 In addition to the output in ".otto", the first compilation will generate 39 a file called ".ottoid" alongside the Appfile. This file contains a unique 40 ID that is used to identify this application. It _should be_ committed to 41 version control. If you're starting a new project, you should run 42 `otto compile` just to generate and commit the ".ottoid" file early, even 43 if the Appfile will change dramatically. 44 45 More details on the ".ottoid" are in its own dedicated section below. 46 47 ### .otto 48 49 Within the ".otto" directory, Otto outputs dozens of files that are used 50 for the remainder of Otto execution (until another compile). An example 51 of some of these files are shown below: 52 53 ``` 54 $ tree .otto 55 .otto 56 ├── appfile 57 │ ├── Appfile.compiled 58 │ └── version 59 ├── compiled 60 │ ├── app 61 │ │ ├── build 62 │ │ │ ├── build-ruby.sh 63 │ │ │ └── template.json 64 │ │ ├── deploy 65 │ │ │ └── main.tf 66 │ │ ├── dev 67 │ │ │ └── Vagrantfile 68 ... 69 70 24 directories, 41 files 71 ``` 72 73 This folder contains [Vagrant](https://www.vagrantup.com) files, 74 [Packer](https://www.packer.io) templates, [Terraform](https://www.terraform.io) 75 configurations, and more. Otto uses these tools under the covers to 76 manage many aspects of development and deployment. If you're familiar with 77 this tooling, you can inspect the files to see exactly what Otto will do. 78 79 In addition to these files, you can see the "Appfile.compiled" file, which 80 is the Appfile structure used by the other `otto` commands. 81 82 The ".otto" folder _should not_ be committed to version control. It is 83 local to the system that ran `otto compile`. 84 85 ### .ottoid 86 87 The ".ottoid" file is generated one time per application and contains 88 a unique identifier for that application. This UUID is used to track the 89 application deployment in the [directory](/docs/concepts/directory.html). 90 It is a critical piece of information that Otto uses to ensure an application 91 is only deployed once (unless explicitly requested otherwise), to maintain 92 state history, etc. 93 94 This file should be committed to version control.