![]() ![]() If for some reason BUILD_NUMBER is not defined we take the value 99 instead. On line 4 we build the Docker image and at the same time capture its unique ID in the corresponding variable. We take the content of the environment variable BUILD_NUMBER that is defined and updated by TC on each build. The above script does the following: On line 2 we define the version that we will use to tag our Docker image. Add the following code to the field Custom script: Select Command Line as step type and call it build and push. Last step is to add a build step to the build configuration. This will ensure that TC builds each time a change in the source code repository is detected (that is when you push changes to the master branch). Next add a trigger to the build configuration. Leave the Username and Password fields blank since this GitHub repository is public and thus needs no authentication. When asked for the Type of VCS enter the following data Now create a build configuration for the new project you just defined. You can run the same container on your local dev box, your integration or QA environment or in the production environment to just name a few.Īdd a new project to TC. Once a new Docker images is available on Docker hub it can be pulled from anywhere and instances of it can be run as Docker containers. It is free as long as you only create public repositories. Make sure that you have an account on Docker hub. Now we are ready to configure TC such as that it builds the Docker images with our code and pushes it to the Docker hub.
0 Comments
Leave a Reply. |