Skip to content

FFM-10311 Build TestGrid image on PR #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 22, 2024
121 changes: 90 additions & 31 deletions .harness/ffgolangserversdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pipeline:

echo "View Results Here: https://sonar.harness.io/dashboard?id=harness_ff-golang-server-sdk_AYSkVwnLWr37sP7QAgtQ"
- stepGroup:
name: Testgrid image - Release
name: Testgrid image
identifier: Testgrid_image
steps:
- step:
Expand All @@ -107,38 +107,86 @@ pipeline:
spec:
branch: main
description: Get the source code for ff-sdk-testgrid so we can build the go test grid container
- step:
type: GitClone
name: Copy SDK code
identifier: Copy_SDK_code
spec:
connectorRef: ffsdks
repoName: ff-golang-server-sdk
cloneDirectory: ff-sdk-testgrid/go/ff-golang-server-sdk
build:
type: tag
spec:
tag: <+codebase.tag>
description: Copy ff-golang-server-sdk code to the docker build context
- step:
type: BuildAndPushGCR
name: Build And Push testgrid image to GCR
identifier: Build_And_Push_testgrid_image_to_GCR
spec:
connectorRef: platform205701
host: us.gcr.io
projectID: platform-205701
imageName: ff-testgrid-go
tags:
- <+codebase.tag>
dockerfile: ff-sdk-testgrid/go/Dockerfile
context: ff-sdk-testgrid/go
buildArgs:
SDK_VERSION: <+codebase.tag>
BUILD_MODE: local
- parallel:
- stepGroup:
name: Release
identifier: Release
steps:
- step:
type: GitClone
name: Copy SDK code - Release
identifier: Copy_SDK_code
spec:
connectorRef: ffsdks
repoName: ff-golang-server-sdk
cloneDirectory: ff-sdk-testgrid/go/ff-golang-server-sdk
build:
type: tag
spec:
tag: <+codebase.tag>
description: Copy ff-golang-server-sdk code to the docker build context
- step:
type: BuildAndPushGCR
name: Build And Push testgrid image to GCR
identifier: Build_And_Push_testgrid_image_to_GCR
spec:
connectorRef: platform205701
host: us.gcr.io
projectID: platform-205701
imageName: ff-testgrid-go
tags:
- <+codebase.tag>
dockerfile: ff-sdk-testgrid/go/Dockerfile
context: ff-sdk-testgrid/go
buildArgs:
SDK_VERSION: <+codebase.tag>
BUILD_MODE: local
when:
stageStatus: Success
condition: "!empty(<+codebase.tag>)"
- stepGroup:
name: Pull Request
identifier: Pull_Request
steps:
- step:
type: GitClone
name: Copy SDK Code
identifier: Copy_SDK_Code
spec:
connectorRef: ffsdks
repoName: ff-golang-server-sdk
cloneDirectory: ff-sdk-testgrid/go/ff-golang-server-sdk
build:
type: branch
spec:
branch: <+trigger.sourceBranch>
when:
stageStatus: Success
- step:
type: BuildAndPushGCR
name: Build And Push testgrid image
identifier: Build_And_Push_testgrid_image
spec:
connectorRef: platform205701
host: us.gcr.io
projectID: platform-205701
imageName: ff-testgrid-go
tags:
- <+trigger.commitSha>
dockerfile: ff-sdk-testgrid/go/Dockerfile
context: ff-sdk-testgrid/go
buildArgs:
SDK_VERSION: v0.1.24
BUILD_MODE: local
resources:
limits:
memory: 10G
cpu: "10"
when:
stageStatus: Success
condition: <+stage.variables.pull_request>
when:
stageStatus: Success
condition: "!empty(<+codebase.tag>)"
- step:
type: Run
name: CVE scan
Expand Down Expand Up @@ -238,6 +286,17 @@ pipeline:
spec:
connectorRef: DockerHub
image: docker:dind
variables:
- name: pull_request
type: String
description: ""
required: false
value: <+input>.allowedValues(true,false)
- name: release
type: String
description: ""
required: false
value: <+input>.allowedValues(true,false)
- stage:
name: Publish Release Notes
identifier: Publish_Release_Notes
Expand Down
13 changes: 12 additions & 1 deletion .harness/pull_request_input_set.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
inputSet:
name: pull_request_input_set
tags: {}
identifier: pull_request_input_set
orgIdentifier: Feature_Flag
projectIdentifier: FFPipelines
Expand All @@ -13,14 +14,24 @@ inputSet:
spec:
branch: <+trigger.branch>
stages:
- stage:
identifier: Build
type: CI
variables:
- name: pull_request
type: String
value: "true"
- name: release
type: String
value: "false"
- stage:
identifier: Publish_Release_Notes
type: Approval
variables:
- name: release
type: String
default: "false"
value: "false"
- name: pull_request
type: String
value: "true"
object Object: pipeline.properties.ci.codebase
Loading