adds lint-scan template
This commit is contained in:
parent
57a217b986
commit
7d15e4c8b6
2 changed files with 131 additions and 121 deletions
|
@ -42,27 +42,36 @@ spec:
|
|||
- name: unit-tests
|
||||
template: unit-tests
|
||||
arguments:
|
||||
parameters: [{name: message, value: "unit-tests task completed"}]
|
||||
parameters:
|
||||
[{ name: message, value: "unit-tests task completed" }]
|
||||
dependencies: [ls]
|
||||
- name: lint-scan
|
||||
template: simple-container
|
||||
template: lint-scan
|
||||
arguments:
|
||||
parameters: [{ name: message, value: "lint-scan task completed" }]
|
||||
dependencies: [ls]
|
||||
- name: trivy-image-scan
|
||||
template: simple-container
|
||||
arguments:
|
||||
parameters: [{name: message, value: "trivy-image-scan task completed"}]
|
||||
parameters:
|
||||
[{ name: message, value: "trivy-image-scan task completed" }]
|
||||
dependencies: [build]
|
||||
- name: trivy-filesystem-scan
|
||||
template: simple-container
|
||||
arguments:
|
||||
parameters: [{name: message, value: "trivy-filesystem-scan task completed"}]
|
||||
parameters:
|
||||
[
|
||||
{
|
||||
name: message,
|
||||
value: "trivy-filesystem-scan task completed",
|
||||
},
|
||||
]
|
||||
dependencies: [git-clone]
|
||||
- name: push-image
|
||||
template: simple-container
|
||||
arguments:
|
||||
parameters: [{name: message, value: "push-image task completed"}]
|
||||
parameters:
|
||||
[{ name: message, value: "push-image task completed" }]
|
||||
# when: " == true"
|
||||
dependencies: [trivy-image-scan, trivy-filesystem-scan]
|
||||
|
||||
|
@ -89,7 +98,7 @@ spec:
|
|||
- |
|
||||
apt update
|
||||
apt install -y git
|
||||
git clone -b main http://forgejo-http.gitea.svc.cluster.local:3000/giteaAdmin/fibonacci_go.git /shared-data/repo
|
||||
git clone -b main https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/Franz.Germann/fibonacci_go.git /shared-data/repo
|
||||
ls -la /
|
||||
ls -la /shared-data
|
||||
ls -la /shared-data/repo
|
||||
|
@ -104,9 +113,7 @@ spec:
|
|||
[
|
||||
"--dockerfile=/shared-data/repo/Dockerfile",
|
||||
"--context=/shared-data/repo/",
|
||||
"--destination=gitea.cnoe.localtest.me/giteaadmin/fibonacci_go:latest",
|
||||
"--registry-certificate",
|
||||
"gitea.cnoe.localtest.me=/shared-data/repo/tls/gitea.cnoe.localtest.me.crt"
|
||||
"--destination=forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/franz.germann/fibonacci_go:latest",
|
||||
]
|
||||
volumeMounts:
|
||||
- name: shared-data
|
||||
|
@ -127,7 +134,16 @@ spec:
|
|||
- name: shared-data
|
||||
mountPath: /shared-data
|
||||
# How to extract artifacts
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: test-results
|
||||
path: /shared-data/repo/test-results.txt
|
||||
|
||||
- name: lint-scan
|
||||
container:
|
||||
image: golangci/golangci-lint:v1.61.0
|
||||
command: [sh, -c]
|
||||
args:
|
||||
- |
|
||||
cd /shared-data/repo && \
|
||||
golangci-lint run ./... --out-format=json --timeout 5m > lint-results.json; \
|
||||
cat lint-results.json
|
||||
volumeMounts:
|
||||
- name: shared-data
|
||||
mountPath: /shared-data
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- run: echo All Good
|
Loading…
Reference in a new issue