Skip to content

Commit 5576338

Browse files
ci-reporunnerarchitmallik7raghavharness
authored
Create pipeline drone-plugin-harness (#36)
* Create pipeline drone-plugin-harness * Create inputset event-PR * Create inputset event-Push * Create inputset event-Tag * Update pipeline drone-plugin-harness * Update pipeline drone-plugin-harness --------- Co-authored-by: Archit Mallik <archit.mallik@harness.io> Co-authored-by: raghav.gupta@harness.io <raghav.gupta@harness.io>
1 parent 99e4116 commit 5576338

4 files changed

Lines changed: 134 additions & 0 deletions

File tree

.harness/eventPR.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
inputSet:
2+
name: event-PR
3+
identifier: eventPR
4+
orgIdentifier: default
5+
projectIdentifier: Drone_Plugins
6+
pipeline:
7+
identifier: dronepluginharness
8+
properties:
9+
ci:
10+
codebase:
11+
build:
12+
type: PR
13+
spec:
14+
number: <+trigger.prNumber>

.harness/eventPush.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
inputSet:
2+
name: event-Push
3+
identifier: eventPush
4+
orgIdentifier: default
5+
projectIdentifier: Drone_Plugins
6+
pipeline:
7+
identifier: dronepluginharness
8+
properties:
9+
ci:
10+
codebase:
11+
build:
12+
type: branch
13+
spec:
14+
branch: <+trigger.branch>

.harness/eventTag.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
inputSet:
2+
name: event-Tag
3+
identifier: eventTag
4+
orgIdentifier: default
5+
projectIdentifier: Drone_Plugins
6+
pipeline:
7+
identifier: dronepluginharness
8+
properties:
9+
ci:
10+
codebase:
11+
build:
12+
type: tag
13+
spec:
14+
tag: <+trigger.tag>

.harness/harness.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
pipeline:
2+
name: drone-plugin-harness
3+
identifier: dronepluginharness
4+
projectIdentifier: Drone_Plugins
5+
orgIdentifier: default
6+
tags: {}
7+
properties:
8+
ci:
9+
codebase:
10+
connectorRef: GitHub_Drone_Org
11+
repoName: plugin
12+
build: <+input>
13+
stages:
14+
- stage:
15+
name: Build and Binaries Release
16+
identifier: Build_and_Binaries_Release
17+
description: ""
18+
type: CI
19+
spec:
20+
cloneCodebase: true
21+
caching:
22+
enabled: true
23+
platform:
24+
os: Linux
25+
arch: Amd64
26+
runtime:
27+
type: Cloud
28+
spec: {}
29+
execution:
30+
steps:
31+
- step:
32+
type: Run
33+
name: version
34+
identifier: version
35+
spec:
36+
shell: Sh
37+
command: VERSION=${DRONE_TAG}
38+
outputVariables:
39+
- name: VERSION
40+
type: String
41+
value: VERSION
42+
when:
43+
stageStatus: Success
44+
condition: <+codebase.build.type> == "tag"
45+
- step:
46+
type: Run
47+
name: Test and Build
48+
identifier: Test_and_Build
49+
spec:
50+
connectorRef: Plugins_Docker_Hub_Connector
51+
image: golang:1.19
52+
shell: Sh
53+
command: |-
54+
go test ./...
55+
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o release/plugin-linux-amd64
56+
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o release/plugin-linux-arm64
57+
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o release/plugin-darwin-amd64
58+
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o release/plugin-darwin-arm64
59+
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o release/plugin-windows-amd64.exe
60+
- step:
61+
type: Plugin
62+
name: Release amd64 Binaries
63+
identifier: Release_amd64_Binaries
64+
spec:
65+
connectorRef: Plugins_Docker_Hub_Connector
66+
image: plugins/github-release
67+
settings:
68+
api_key: <+secrets.getValue("ci_job_github_pat")>
69+
title: <+trigger.tag>
70+
files:
71+
- release/plugin-linux-amd64
72+
- release/plugin-linux-arm64
73+
- release/plugin-darwin-amd64
74+
- release/plugin-darwin-arm64
75+
- release/plugin-windows-amd64.exe
76+
when:
77+
stageStatus: Success
78+
condition: <+codebase.build.type> == "tag"
79+
- step:
80+
name: Upload_Binaries_To_GCS
81+
identifier: Upload_Binaries_To_GCS
82+
template:
83+
templateRef: Upload_Binary_GCS_TI
84+
versionLabel: v1
85+
templateInputs:
86+
type: GCSUpload
87+
spec:
88+
sourcePath: /harness/release
89+
target: harness-plugin/<+pipeline.stages.Build_and_Binaries_Release.spec.execution.steps.version.output.outputVariables.VERSION>
90+
when:
91+
condition: <+codebase.build.type> == "tag"
92+
allowStageExecutions: true

0 commit comments

Comments
 (0)