From 8ee10bb9a6f166eec3a35fc1558dbcc4f06098d3 Mon Sep 17 00:00:00 2001 From: Archit Mallik Date: Thu, 30 Jan 2025 12:45:40 +0530 Subject: [PATCH 1/5] Create pipeline drone-kaniko-harness --- .harness/harness.yaml | 681 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 681 insertions(+) create mode 100644 .harness/harness.yaml diff --git a/.harness/harness.yaml b/.harness/harness.yaml new file mode 100644 index 0000000..1492319 --- /dev/null +++ b/.harness/harness.yaml @@ -0,0 +1,681 @@ +pipeline: + name: drone-kaniko-harness + identifier: dronekanikoharness + projectIdentifier: Drone_Plugins + orgIdentifier: default + tags: {} + properties: + ci: + codebase: + connectorRef: GitHub_Drone_Org + repoName: drone-kaniko + build: <+input> + sparseCheckout: [] + stages: + - stage: + name: Manager Approval + identifier: Manager_Approval + description: "" + type: Approval + spec: + execution: + steps: + - step: + name: CI Manager Approval + identifier: CI_Manager_Approval + type: HarnessApproval + timeout: 1d + spec: + approvalMessage: |- + Please review the following information + and approve the pipeline progression + includePipelineExecutionHistory: true + approvers: + minimumCount: 1 + disallowPipelineExecutor: false + userGroups: + - CI_Manager + isAutoRejectEnabled: false + approverInputs: [] + tags: {} + - parallel: + - stage: + name: linux-amd64 + identifier: linuxamd64 + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: false + paths: [] + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + execution: + steps: + - step: + type: Run + name: Build Binary + identifier: Build + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: golang:1.22.4 + shell: Sh + command: |- + go test ./... + sh scripts/build.sh + - parallel: + - step: + type: Plugin + name: BuildAndPushDockerTag + identifier: BuildAndPushDockerTag + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/docker + settings: + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + repo: plugins/kaniko<+matrix.image> + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64 + auto_tag: "true" + auto_tag_suffix: linux-amd64 + daemon_off: "false" + when: + stageStatus: Success + condition: <+codebase.build.type> == "tag" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + - "-acr" + repo: + - docker + - gcr + - gar + - ecr + - acr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "" + repo: acr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gcr" + repo: acr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-gar" + repo: acr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + - image: "-ecr" + repo: acr + - image: "-acr" + repo: docker + - image: "-acr" + repo: gcr + - image: "-acr" + repo: gar + - image: "-acr" + repo: ecr + nodeName: _<+matrix.repo> + - step: + type: Plugin + name: BuildAndPushDockerTag_Kaniko + identifier: BuildAndPushDockerTag_Kaniko + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/docker + settings: + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + repo: plugins/kaniko<+matrix.image> + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64.kaniko1.9.1 + auto_tag: "true" + auto_tag_suffix: linux-amd64-kaniko1.9.1 + daemon_off: "false" + when: + stageStatus: Success + condition: <+codebase.build.type> == "tag" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + repo: + - docker + - gcr + - gar + - ecr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + nodeName: <+matrix.repo> + - parallel: + - step: + type: BuildAndPushDockerRegistry + name: BuildAndPushDockerBranch + identifier: BuildAndPushDockerBranch + spec: + connectorRef: Plugins_Docker_Hub_Connector + repo: plugins/kaniko<+matrix.image> + tags: + - linux-amd64 + caching: true + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64 + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + - "-acr" + repo: + - docker + - gcr + - gar + - ecr + - acr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "" + repo: acr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gcr" + repo: acr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-gar" + repo: acr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + - image: "-ecr" + repo: acr + - image: "-acr" + repo: docker + - image: "-acr" + repo: gcr + - image: "-acr" + repo: gar + - image: "-acr" + repo: ecr + nodeName: <+matrix.repo> + - step: + type: BuildAndPushDockerRegistry + name: BuildAndPushDockerBranch_Kaniko + identifier: BuildAndPushDockerBranch_Kaniko + spec: + connectorRef: Plugins_Docker_Hub_Connector + repo: plugins/kaniko<+matrix.image> + tags: + - linux-amd64-kaniko1.9.1 + caching: true + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64.kaniko1.9.1 + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + repo: + - docker + - gcr + - gar + - ecr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + nodeName: _<+matrix.repo> + when: + pipelineStatus: Success + - stage: + name: linux-arm64 + identifier: linuxarm64 + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: false + paths: [] + platform: + os: Linux + arch: Arm64 + runtime: + type: Cloud + spec: {} + execution: + steps: + - step: + type: Run + name: Build Binary + identifier: Build_and_Test + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: golang:1.22.4 + shell: Sh + command: |- + go test ./... + sh scripts/build.sh + - parallel: + - step: + type: Plugin + name: BuildAndPushDockerTag + identifier: BuildAndPushDockerTag + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/docker + settings: + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + repo: plugins/kaniko<+matrix.image> + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64 + auto_tag: "true" + auto_tag_suffix: linux-arm64 + daemon_off: "false" + when: + stageStatus: Success + condition: <+codebase.build.type> == "tag" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + - "-acr" + repo: + - docker + - gcr + - gar + - ecr + - acr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "" + repo: acr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gcr" + repo: acr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-gar" + repo: acr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + - image: "-ecr" + repo: acr + - image: "-acr" + repo: docker + - image: "-acr" + repo: gcr + - image: "-acr" + repo: gar + - image: "-acr" + repo: ecr + nodeName: _<+matrix.repo> + - step: + type: Plugin + name: BuildAndPushDockerTag_Kaniko + identifier: BuildAndPushDockerTag_Kaniko + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/docker + settings: + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + repo: plugins/kaniko<+matrix.image> + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64.kaniko1.9.1 + auto_tag: "true" + auto_tag_suffix: linux-arm64-kaniko1.9.1 + daemon_off: "false" + when: + stageStatus: Success + condition: <+codebase.build.type> == "tag" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + repo: + - docker + - gcr + - gar + - ecr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + nodeName: _<+matrix.repo> + - parallel: + - step: + type: BuildAndPushDockerRegistry + name: BuildAndPushDockerBranch + identifier: BuildAndPushDockerBranch + spec: + connectorRef: Plugins_Docker_Hub_Connector + repo: plugins/kaniko<+matrix.image> + tags: + - linux-arm64 + caching: true + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64 + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + - "-acr" + repo: + - docker + - gcr + - gar + - ecr + - acr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "" + repo: acr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gcr" + repo: acr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-gar" + repo: acr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + - image: "-ecr" + repo: acr + - image: "-acr" + repo: docker + - image: "-acr" + repo: gcr + - image: "-acr" + repo: gar + - image: "-acr" + repo: ecr + nodeName: <+matrix.repo> + - step: + type: BuildAndPushDockerRegistry + name: BuildAndPushDockerBranch_Kaniko + identifier: BuildAndPushDockerBranch_Kaniko + spec: + connectorRef: Plugins_Docker_Hub_Connector + repo: plugins/kaniko<+matrix.image> + tags: + - linux-arm64-kaniko1.9.1 + caching: true + dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64.kaniko1.9.1 + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" + strategy: + matrix: + image: + - "" + - "-gcr" + - "-gar" + - "-ecr" + repo: + - docker + - gcr + - gar + - ecr + exclude: + - image: "" + repo: gcr + - image: "" + repo: gar + - image: "" + repo: ecr + - image: "-gcr" + repo: docker + - image: "-gcr" + repo: gar + - image: "-gcr" + repo: ecr + - image: "-gar" + repo: docker + - image: "-gar" + repo: gcr + - image: "-gar" + repo: ecr + - image: "-ecr" + repo: docker + - image: "-ecr" + repo: gcr + - image: "-ecr" + repo: gar + nodeName: _<+matrix.repo> + when: + pipelineStatus: Success + - stage: + name: Manifest + identifier: Manifest + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: false + paths: [] + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + execution: + steps: + - parallel: + - step: + type: Plugin + name: Manifest + identifier: Manifest + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/manifest + settings: + auto_tag: "true" + spec: docker/<+matrix.repo>/manifest.tmpl + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + ignore_missing: "true" + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" || <+codebase.build.type> == "tag" + strategy: + matrix: + repo: + - docker + - gcr + - gar + - ecr + - acr + nodeName: manifest_<+matrix.repo> + - step: + type: Plugin + name: Manifest_kaniko + identifier: Manifest_kaniko + spec: + connectorRef: Plugins_Docker_Hub_Connector + image: plugins/manifest + settings: + auto_tag: "true" + spec: docker/<+matrix.repo>/manifest-kaniko1.9.1.tmpl + username: drone + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> + ignore_missing: "true" + when: + stageStatus: Success + condition: <+codebase.build.type> == "branch" || <+codebase.build.type> == "tag" + strategy: + matrix: + repo: + - docker + - gcr + - gar + - ecr + nodeName: manifest_<+matrix.repo> + when: + pipelineStatus: Success From 507998a34dd502dad94104bcd57ba94469af0dbd Mon Sep 17 00:00:00 2001 From: Archit Mallik Date: Thu, 30 Jan 2025 12:53:00 +0530 Subject: [PATCH 2/5] Create inputset event-PR --- .harness/eventPR.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .harness/eventPR.yaml diff --git a/.harness/eventPR.yaml b/.harness/eventPR.yaml new file mode 100644 index 0000000..1613f17 --- /dev/null +++ b/.harness/eventPR.yaml @@ -0,0 +1,14 @@ +inputSet: + name: event-PR + identifier: eventPR + orgIdentifier: default + projectIdentifier: Drone_Plugins + pipeline: + identifier: dronekanikoharness + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> From c65696994aa1b2c99d96f78958b8f1b8b6268a6f Mon Sep 17 00:00:00 2001 From: Archit Mallik Date: Thu, 30 Jan 2025 12:53:54 +0530 Subject: [PATCH 3/5] Create inputset event-Push --- .harness/eventPush.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .harness/eventPush.yaml diff --git a/.harness/eventPush.yaml b/.harness/eventPush.yaml new file mode 100644 index 0000000..ab001cf --- /dev/null +++ b/.harness/eventPush.yaml @@ -0,0 +1,14 @@ +inputSet: + name: event-Push + identifier: eventPush + orgIdentifier: default + projectIdentifier: Drone_Plugins + pipeline: + identifier: dronekanikoharness + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> From 9be866d9c9f76cfa27f8ed29e8861b5382af9806 Mon Sep 17 00:00:00 2001 From: Archit Mallik Date: Thu, 30 Jan 2025 12:54:42 +0530 Subject: [PATCH 4/5] Create inputset event-Tag --- .harness/eventTag.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .harness/eventTag.yaml diff --git a/.harness/eventTag.yaml b/.harness/eventTag.yaml new file mode 100644 index 0000000..73c3694 --- /dev/null +++ b/.harness/eventTag.yaml @@ -0,0 +1,14 @@ +inputSet: + name: event-Tag + identifier: eventTag + orgIdentifier: default + projectIdentifier: Drone_Plugins + pipeline: + identifier: dronekanikoharness + properties: + ci: + codebase: + build: + type: tag + spec: + tag: <+trigger.tag> From ee4fe0529d4efa7216a3159a296c80d4787d13d4 Mon Sep 17 00:00:00 2001 From: Archit Mallik Date: Fri, 31 Jan 2025 12:14:42 +0530 Subject: [PATCH 5/5] Update pipeline drone-kaniko-harness --- .harness/harness.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.harness/harness.yaml b/.harness/harness.yaml index 1492319..abf9718 100644 --- a/.harness/harness.yaml +++ b/.harness/harness.yaml @@ -209,7 +209,7 @@ pipeline: repo: plugins/kaniko<+matrix.image> tags: - linux-amd64 - caching: true + caching: false dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64 when: stageStatus: Success @@ -279,7 +279,7 @@ pipeline: repo: plugins/kaniko<+matrix.image> tags: - linux-amd64-kaniko1.9.1 - caching: true + caching: false dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64.kaniko1.9.1 when: stageStatus: Success @@ -494,7 +494,7 @@ pipeline: repo: plugins/kaniko<+matrix.image> tags: - linux-arm64 - caching: true + caching: false dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64 when: stageStatus: Success @@ -564,7 +564,7 @@ pipeline: repo: plugins/kaniko<+matrix.image> tags: - linux-arm64-kaniko1.9.1 - caching: true + caching: false dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64.kaniko1.9.1 when: stageStatus: Success