As you develop your application, you need to regularly deploy it. Deploying the application allows you or other teams to test it, and/or the targeted end users to use the new developed features. To deploy an application to the cloud, you need to follow CodeNOW's deployment process and provide four types of information:
- what to deploy (e.g., application package)
- where to deploy to (e.g., deployment environment, domain)
- deployment configuration variables (e.g., runtime environment variables, connected services configuration)
- deployment infrastructure (e.g., CPU, memory, replicas)
What to deploy. You may have several versions of your application in as many application packages. While you generally want to deploy the latest version of your application, this is not always the case. You may want to deploy a previous version of your application (e.g., rollback in case of deployment failure or bug).
Where to deploy to. Some teams have one
dev deployment environment for each team member. They may additionally have a
staging, and multiple
prod environments (e.g., one per customer). With deployment environments, teams can fulfill different purposes (e.g., integration testing, user acceptance testing) separately without interference between environments. You may also want to use another domain name for your deployment so target users can remember it easily, or to fit marketing purposes. For more information on assigning domain names, see Domain name configuration.
Deployment configuration variables. You often need to parameterize the deployed application to fit the purpose of the target deployment environment. You may for instance want to turn down some features in non-production environments. You may also want to change an application's configuration at runtime (e.g., API URLs, theme data, connection strings). You would then change the relevant variables and possibly redeploy the application without ever touching the codebase or rebuilding the application. Not rebuilding the application saves computing resources. Not modifying the code ensures that you do not inadvertently introduce bugs. In other words, deployment configurations save you engineering time and money. Separating configuration and code is a fundamental practice for cloud-native applications.
Deployment infrastructure. Your application runs on resources that you need to specify: maximum available memory for the application, computing power, and more. Parameterize the availability of your application by setting the number of simultaneously running application instances.
CodeNOW already knows how to deploy application components that were created with its predefined scaffolders (e.g., PHP/Compose). You can however use any stack that does not match the existing scaffolders (e.g., Python/Flask, Elastic Stack). To see how to configure the deployment of custom stacks, see Custom stacks.
- Deployment process
- Deployment configurations
- Deploy an application
- Create a deployment configuration
- Modify a deployment configuration
- Modify a configuration template
- Create environment variables
- Custom stacks
- Place deployment configuration data that is common to all deployment environments in configuration templates in components' Git repositories (do NOT do this for secrets though). When you deploy an application, you will not need to edit again those common configuration values. You can extend the reasoning to configuration variables whose value changes infrequently. You will only have to edit their values sometimes.