Refactor: pre-commit cleanups
[releng/global-jjb.git] / docs / jjb / lf-go-jobs.rst
1 #######
2 Go Jobs
3 #######
4
5 Macros
6 ======
7
8 lf-go-test
9 ----------
10
11 Calls go-test.sh script against a Go project.
12
13 :Required Parameters:
14
15     :go-root: Path to the Go project root directory.
16
17 lf-go-common
18 ------------
19
20 Common Jenkins configuration for Go jobs.
21
22 Job Templates
23 =============
24
25 Go SNYK CLI
26 -----------
27
28 Builds the code, downloads and runs a Snyk CLI scan of the code into the Snyk dashboard.
29
30 :Template Names:
31
32     - {project-name}-go-snyk-cli-{stream}
33     - gerrit-go-snyk-cli
34     - github-go-snyk-cli
35
36 :Comment Trigger: run-snyk
37
38 :Required parameters:
39
40     :build-node:    The node to run build on.
41     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
42     :snyk-token-credential-id: Snyk API token to communicate with Jenkins.
43     :snyk-org-credential-id: Snyk organization ID.
44
45 :Optional parameters:
46
47     :branch: The branch to build against. (default: master)
48     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
49     :build-timeout: Timeout in minutes before aborting build. (default: 60)
50     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
51     :java-version: Version of Java to use for the build. (default: openjdk11)
52     :snyk-cli-options: Snyk CLI options. (default: '')
53     :stream: Keyword that represents a release code-name.
54         Often the same as the branch. (default: master)
55     :submodule-recursive: Whether to checkout submodules recursively.
56         (default: true)
57     :submodule-timeout: Timeout (in minutes) for checkout operation.
58         (default: 10)
59     :submodule-disable: Disable submodule checkout operation.
60         (default: false)
61
62     :gerrit_snyk_triggers: Override Gerrit Triggers.
63
64 Go Verify
65 ---------
66
67 Job which runs go test ./... to verify a Go project.
68 'go test ./...' runs unit tests on current folder and all subfolders.
69
70 :Template Names:
71
72     - {project-name}-go-verify-{stream}"
73     - gerrit-go-verify
74     - github-go-verify
75
76 :Comment Trigger: recheck|reverify
77
78 :Required parameters:
79
80     :build-node: The node to run build on.
81     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
82
83 :Optional parameters:
84
85     :branch: Git branch to fetch for the build. (default: master)
86     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
87     :build-timeout: Timeout in minutes before aborting build. (default: 60)
88     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
89     :stream: Keyword that represents a release code-name.
90         Often the same as the branch. (default: master)
91     :submodule-recursive: Whether to checkout submodules recursively.
92         (default: true)
93     :submodule-timeout: Timeout (in minutes) for checkout operation.
94         (default: 10)
95     :submodule-disable: Disable submodule checkout operation.
96         (default: false)
97     :gerrit_verify_triggers: Override Gerrit Triggers.
98     :gerrit_trigger_file_paths: Override file paths to filter which file
99         modifications will trigger a build.