Automatic preview environments
If your service is one of many micro-services, after all your automatic tests on your service you would probably want to check the new service with your whole system. In this case you can launch the composition of your system as part of your build. At the end of this build you would be able to open the composition.
You should already have done the tutorial
Launching The Composition
- Open your
codefresh.ymlfile and add a new step:
- Commit and push the changes to git repository
- Build your service with Codefresh
- Click on Compositions on the left sidebar and then choose the Running Compositions tab.
- You will see the new preview environment on this page
Launching an environment only on one branch
There is a limit to the number environments you can run concurrently. That’s why it’s a good practice to launch the the composition only on certain condition. Usually the most relevant condition is the branch, since you probably want your environment to be updated by you main branch.
The following instructions would explain how to launch the environment for only the
- Open your
codefresh.ymlfile and add to the ‘launch_composition_step` the following:
- Commit and push changes to your git repository
- Build your service with codefresh on branch
- Create a new branch and push it to your git repository under a new branch
- Build your service with codefresh on the new branch
- When the build would finish, open the its log. You should see something like: