-
Notifications
You must be signed in to change notification settings - Fork 221
Expand file tree
/
Copy pathTest_Shell_Script_Pipeline.yaml
More file actions
60 lines (60 loc) · 1.92 KB
/
Test_Shell_Script_Pipeline.yaml
File metadata and controls
60 lines (60 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pipeline:
name: Test_Shell_Script_Pipeline
identifier: Test_Shell_Script_Pipeline
projectIdentifier: shashank_sandbox
orgIdentifier: default
tags: {}
properties:
ci:
codebase:
connectorRef: shashank_github
repoName: goHelloWorldServer
build: <+input>
stages:
- stage:
name: test_build
identifier: test_build
description: ""
type: CI
spec:
cloneCodebase: true
execution:
steps:
- step:
type: Run
name: Run_1
identifier: Run_1
spec:
connectorRef: Shashank_docker
image: golang:1.15
shell: Sh
command: |
go get gotest.tools/gotestsum
gotestsum --format=standard-verbose --junitfile unit-tests.xml || true
sleep 5m
testresult="passed"
testfail=$(grep -c "<failure" *.xml)
if [ $testfail == 1 ]
then
testresult="failed"
else
testresult="passed"
fi
echo $testresult
export testresult
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
reports:
type: JUnit
spec:
paths:
- "**/*.xml"
outputVariables:
- name: testresult
infrastructure:
type: KubernetesDirect
spec:
connectorRef: account.shashankcluster
namespace: harness-delegate-ng
automountServiceAccountToken: true
nodeSelector: {}
os: Linux