CONTROLLED DATA
Leidos Proprietary - US Citizens ONLY
The information contained herein is proprietary to Leidos, Inc. It may not be used, reproduced, disclosed, or exported without the written approval of Leidos.
A project using Bamboo for its CI/CD pipeline will have been provided with a build plan cloned from the PBC Build Agent Template. This article outlines the steps necessary to modify this template to create a PBC suitable for use in an application Maven build pipeline.
Step-by-step guide
Step | ||
---|---|---|
1 | Locate the cloned build plan in the Bamboo project. For example, HMT Maven Build Agent. | |
2 | Click on the Configure plan icon in the center of the right most column. | |
3 | Click on the Build Agent link under Default Stage in Plan Contents. | |
4 | Click on the Docker tab. | |
5 | This items on this page typically should not have to be changed. However, note the following items:
| |
6 | Click on the Plan Configuration link at the upper left of the navigation pane. | |
7 | Update the values as appropriate under the Plan details tab. | |
8 | Click on the Variables tab. | |
9 | Edit and save the following variables with the appropriate values:
NOTE: It may be the case that special characters in the password may need to be escaped with a backslash, i.e. '\'. This may be dependent on the client used for a particular task. In this case, create another variable called ARTIFACTORY_PASSWORD_ESC, escape the special characters and modify the affected tasks accordingly. | |
10 | Click the Repository task. | |
11 | Click Add repository. | |
12 | Click Bitbucket Server / Stash. | |
13 | Provide a Name for the repository. | |
14 | Select SDO Bitbucket from the Server dropdown. | |
15 | Locate the Repository. This repository is the location of the Dockerfile source code from which the PBC will be built. Note that the name will be different than that in the screenshot. | |
16 | For now leave the Branch as the default, i.e. master. | |
17 | Click Save Repository. | |
18 | Click on the Stages tab. | |
19 | Click on the Build Agent link under Default Stage. | |
20 | Click on the Source Code Checkout task | |
21 | Uncheck Disable this task. | |
22 | Verify that the selected Repository is the repository that was created in the repository creation step. | |
23 | Click Save. | |
24 | Click on the JFrog CLI Login command task. This task logs the JFrog CLI into Artifactory. | |
25 | Uncheck Disable this task. | |
26 | Click Save. | |
27 | Click on the Download Resource command task. This task uses the JFrog CLI to download resources directly from Artifactory. It depends on the previous login task. Hint: Use this task as a template to create other tasks to download all the resources necessary to build the PBC. | |
28 | Change the Task description as appropriate. | |
29 | Uncheck Disable this task. | |
30 | Change the Argument field to correspond to the path of the actual resource being downloaded. | |
31 | Click Save. | |
32 | Click on the Docker Login command task. This task logs into the project-specific Artifactory repository where the PBC will eventually be uploaded. | |
33 | Change the Task description as appropriate. | |
34 | Uncheck Disable this task. | |
35 | The Argument field can be left as is. | |
36 | Click Save. | |
37 | Click on the Docker Login - sdo-docker-public command task. This task logs into the public SDO Docker Artifactory repository that hosts the base Docker images from which every SDO tenant PBC must extend. | |
38 | Leave the Task description field as is. | |
39 | Uncheck Disable this task. | |
40 | Leave the Argument field as is. | |
41 | Click Save. | |
42 | Click on the Docker Build task. This task builds the PBC using the Docker plugin task. | |
43 | Uncheck Disable this task and do not edit any other fields. Note the Environment variables field. This variable points to the Docker registry in the Docker-inDocker container (i.e. the DinD) described in Step 5. | |
44 | Click Save. | |
45 | OPTIONAL: Click on the Docker Tag command task. The only purpose of this task is to add an additional 'latest' tag to the versioned image built in the previous step. This may or may not be desirable and will be governed by how a project chooses to tag its Docker images. This task is therefore included as a demonstration of how to use Bamboo plugins to accomplish this task should such an extra step be warranted. Note that if this task is enabled, that it should be used in conjunction with the Push By Latest Docker task described in the next section. | |
46 | OPTIONAL: Uncheck Disable this task and do not edit the other fields. | |
47 | OPTIONAL: Click Save. | |
48 | OPTIONAL: Click on the Push By Latest Docker task. This task is a corollary of the preceding task. If a project chooses to use both an explicit version tag and a 'latest' tag, then both tags should be pushed to Artifactory. | |
49 | OPTIONAL: Uncheck Disable this task. | |
50 | OPTIONAL: If this task is used, update the username and password with the credentials of the project service account. | |
51 | OPTIONAL: Click Save. | |
52 | Click on the JFrog CLI - Push by version command task. This task and the remaining other JFrog CLI tasks must be used to meet the SDO security and quality control requirements necessary to migrate a project PBC to the SDO docker repository where it will subsequently be used in project specific application builds. Specifically, this task is a prerequisite for the following JFrog CLI - Publish build-info task which pushes the 'build-info' metadata required to perform an Xray scan. | |
53 | Uncheck Disable this task. | |
54 | Leave all other fields unchanged. | |
55 | Click Save. | |
56 | Click on JFrog CLI - Publish build-info task. As described in the previous section this task pushes the 'build-info' metadata required to perform the Xray scan which is initiated in the final step.. | |
57 | Uncheck Disable this task. | |
58 | Leave all other fields unchanged. | |
59 | Click Save. | |
60 | Click on the JFrog CLI - Xray scan task. This task initiates the Xray scan that, in addition to a code review, forms the basis of the security and quality control requirements necessary to migrate a project PBC to the SDO Docker repository where it can be used in project specific application builds. | |
61 | Uncheck Disable this task. | |
62 | Leave all other fields unchanged. | |
63 | Click Save. | |
64 | In the upper right of the Bamboo page, select Run → Run plan. | |
65 | The plan should successfully execute. If any problems are encountered, inspect the logs and contact the SDO Service Desk for further assistance. |