Work with Sample App

Learn more about the capabilities of an Internal Developer Platform during a typical day-to-day developer workflow using the free trial.
In this tutorial, you will learn what working with an Internal Developer Platform looks like in the everyday life of a developer. We will walk you through different activities such as how to create a new environment, how to trigger a new deployment, how to roll back to an older deployment (in case you need to), and other basic workflows.
If you do not have an application in Humanitec yet that you can use to test the everyday workflows, then follow the Create Sample App tutorial to create your first sample application without having to connect your own infrastructure. We will use the sample application in this tutorial wherever meaningful but you can use any existing app; the workflow will remain the same.
If you do not have a Humanitec account yet, head over to our website to request a free trial. We will send you instructions on how to start your free trial right away.
If you are missing a workflow you are interested in, then, please, let us know and we will add it to the list of workflows in this tutorial.

Create a new Environment

There are many good reasons why you want to create a new environment. Maybe, you want to run an integration test for a new service you just created, or you want to test a new feature branch you just started, or you want to test a hotfix that is urgently needed in production, or something else. Being able to create a new environment based on an existing environment within an application is a core functionality of an Internal Developer Platform. Here is how you can do it:
  • Go to the App Details Screen.
  • Select a deployment within an environment that you want to use as a starting point for your new environment
  • Select Clone deployment to and then + Create new environment from the context menu.
  • In the next screen give your new environment a name and choose the type of environment (the Environment Type determines which infrastructure to use for your new environment).
  • Hit Create.
Humanitec will now take the deployment you selected and copy it to a new environment. From here you will be able to deploy the new environment. The new environment will be completely separated from the environment you created it from.

Change Configurations

Humanitec allows you to update your application configuration without ever touching YAML files. There are many different changes your can make to each of the workloads in your application: you can create new ingress rules, add environment variables, change the min and max values for CPU and RAM, and many more.
Let's look at the simple example of adding a new environment variable to the workload sample-app.
  • Switch to the Draft within the environment where you want to apply the change.
  • Click on Edit workload (i.e., the banner) in the sample-app tile.
  • Under Variables add the key NEW-CONFIG and the value "Hello World".
  • Hit < Back to app details to return to the previous screen and hit Deploy to apply your changes.
Humanitec will show you the changes you just made and you can add a comment before deploying the changes.

Add a Resource

Another important feature of an Internal Developer Platform is adding a new resource to an existing application. This can be another database, file storage, or DNS. Basically, everything running outside of your Kubernetes cluster. The DevOps team can connect these resources to Humanitec and can also define which resources to use in which type of environment.

Diff Deployments

An Internal Developer Platform has many parallels to a version control system. But while a version control system (such as git) handles code, an Internal Developer Platform handles deployments. It does so by saving every deployment across all applications and environments. If you need to understand what changed between two deployments you can simply create a diff between them. This will surface the material changes.
Here is a simple example of how to compare two different deployments in Humanitec:
  • Select the deployment you want to diff to another deployment and click on Diff deployment from the context menu.
  • In the dialog box select the deployment you want to diff against.
  • The diff will be directly shown.
  • From here you can create a new draft from the diff.

Rollback to a previous Deployment

There are situations in which you need to roll back to a previous deployment. Humanitec supports moving back to previous deployments easily by following these steps:
  • Select the deployment you want to roll back to and click on Re-deploy.
  • Enter a comment and hit Deploy.
Note, that there are obvious limitations of rollbacks and that you should be very careful using this functionality for your production environment. The main limitation is - as always with rollbacks - data migration. If you try to roll back to a deployment that took place before any data migration, the rollback of the application will work but the database schema will be wrong.

Export Manifests

Humanitec allows you to export the manifests for each deployment. You can use the exported manifests in other processes - for example, if you are following a GitOps approach. Exporting manifests is simple:
  • Select the deployment for which you want to export the manifests and click on Export manifests from the context menu.
  • From the dialog box select Generate manifests. It might take a few minutes to generate the download. You can close the dialog box in the meantime and come back at a later point in time.
  • Once the export is finished click on Download to download the manifests for this deployment.

Add Automation

Going to your Internal Developer Platform just to update an image in your development environment after a successful build process is a repetitive and little value-adding task. That's where automation becomes important. In Humanitec, you can define automation rules to automatically deploy new images from specific branches into any environment.
Here is a simple example of how to do this:
  • Select the environment in which you want to create an Automation Rule and select Environment settings from the context menu.
  • In the Automation section select + Add rule.
  • Each Automation Rule can apply to All images, Selected images, or All images except.
  • The Automation Rules can be triggered when the Latest tag or Head of branch are pushed to Humanitec.
  • The Latest tag or Head of branch can be specified in the field That matches, using regular expressions. If the field is empty, it will match any Latest tag or Head of branch.
Each automatic deployment results in a new entry in the deployment history of your environment. You can even go one step further and use the webhook feature in the App Settings to trigger a webhook after each successful deployment. You can use these webhooks to trigger your automated test suite or to inform you and your teammates about a new deployment in your messenger app (such as Slack or MS Teams).
Congratulations. You learned the basics about the most important day-to-day workflows in an Internal Developer Platform. If you want to understand the related features in more detail, then continue reading in the section How-to Guides for Developers.