The perform a Git clone operation is not executed in most of the examples because Codefresh automatically adds a Git clone step, named initial-clone, in the beginning of the pipeline to clone your service’s repository.
Build an Image - Dockerfile in Root Directory
If your repository contains a Dockerfile in the root directory, you can use the following YAML file to build an image.
Build an Image - Specify Dockerfile Location
If your Dockerfile isn’t maintained in the root directory of your repository, you can specify its location relative to the root directory using the dockerfile attribute.
Build an Image - From a Different Git Repository
In this example we specify a git-clone step to clone a different Git repository and build our image from it instead.
Git-clone step not required and added automatically
In this example, the push step references the image built by the build step using the candidate attribute.
Make sure to configure your account’s Docker registry details and credentials before you execute a push.
Run Unit Tests
Using the freestyle step, you can execute a series of shell commands. The most common use case is to run unit tests on your code.
Run Integration Tests
Using the composition step, you can run a more complex interaction of services; For example – run integration tests on an image that was built.
Run unit tests with composition on example app + mysql
Run composition on example app + postgres
Run composition on example app + mongo
Run unit tests with composition on example app + mongo