The snapcraft.yaml file is the main entry point to create a snap through Snapcraft. It contains all the details the snapcraft command needs to build a snap.
See Snapcraft checklist for an overview of the typical project details needed before creating snapcraft.yaml.
In general, snapcraft.yaml can be organised into three main sections:
1. top-level metadata, containing values, such as name, typically used by the store:
summary: GNU Hello, the "hello world" snap
GNU hello prints a friendly greeting.
2. apps detailing how apps and services are exposed to the host system:
3. and parts to describes how to import, and potentially build, each required part of the snap:
For further details on the metadata contained within each of the above sections, see one of the following:
A set of environment variables is also available during the build process. See Environment variables that Snapcraft exposes for further details.
Additionally, see Snapcraft.yaml reference for a complete overview of the metadata supported by snapcraft.yaml, and Snapcraft advanced grammar to learn how to check for specific conditions for certain YAML keys.