> .mortar.yml
20 | EOF
21 | }
22 | if [ "$#" = "1" ]; then
23 | echo "$1" | \
24 | openssl rsautl -encrypt -inkey ./id_rsa.pub -pubin | \
25 | openssl enc -base64 -A | \
26 | sed -e 's/\(.*\)/ secret: "\1"/'
27 | elif [ $# = "2" ]; then
28 | echo $" - key: \"$1\""
29 | echo "$2" | \
30 | openssl rsautl -encrypt -inkey ./id_rsa.pub -pubin | \
31 | openssl enc -base64 -A | \
32 | sed -e 's/\(.*\)/ secret: "\1"/'
33 | else
34 | help
35 | fi
36 |
--------------------------------------------------------------------------------
/src/test/resources/mocks/vault_8200_v1_auth_token_lookup-self_94cd1485322def4aff1733b599cf889ac1b65536a13aaa7e19963fa6c6cdd344:
--------------------------------------------------------------------------------
1 | request_id: e82e703b-e975-fe82-0955-e16ef4e9f1ce
2 | lease_id: ''
3 | renewable: false
4 | lease_duration: 0
5 | data:
6 | accessor: ctXoFqHoZUq2eOoTnRQnIhhb
7 | creation_time: 1672289592
8 | creation_ttl: 60
9 | display_name: approle
10 | entity_id: 40dabc48-87eb-d28b-3f3d-02a4a43f27bf
11 | expire_time: '2022-12-29T04:54:12.140639017Z'
12 | explicit_max_ttl: 0
13 | id: hvs.CAESIDNfT9a8ge4id9TlW_t5w5Y3DG9vFP3e9gdjgQGTcrv_Gh4KHGh2cy5wdDNiemhCYVVvd29Xazh0VXRQOWs1NjU
14 | issue_time: '2022-12-29T04:53:12.140642586Z'
15 | meta:
16 | role_name: my_approle_service
17 | num_uses: 0
18 | orphan: true
19 | path: auth/approle/login
20 | policies:
21 | - my_role
22 | renewable: true
23 | ttl: 60
24 | type: service
25 | wrap_info: null
26 | warnings: null
27 | auth: null
28 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_missing_defaults_os.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "stability": "stable",
5 | "sudo": "sudo"
6 | },
7 | "supported_platforms": {
8 | "docker": {
9 | "ubuntu1404": {
10 | "language": [
11 | "groovy",
12 | "java",
13 | "python",
14 | "ruby"
15 | ],
16 | "toolchain": [
17 | "env",
18 | "gemset",
19 | "rvm",
20 | "python",
21 | "jdk"
22 | ]
23 | }
24 | }
25 | },
26 | "restrictions": {
27 | "docker": {
28 | "only_organizations": ["samrocketman"],
29 | "only_projects": ["samrocketman/jervis"]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/good_toolchains_simple.yaml:
--------------------------------------------------------------------------------
1 | toolchains:
2 | java:
3 | - env
4 | - jdk
5 | python:
6 | - env
7 | - python
8 | ruby:
9 | - gemfile
10 | - env
11 | - rvm
12 | - jdk
13 | shell:
14 | - env
15 | compiler:
16 | default_ivalue: gcc
17 | friendlyLabel: true
18 | gcc: |-
19 | export CXX="g++"
20 | export CC="gcc"
21 | clang: |-
22 | export CXX="clang++"
23 | export CC="clang"
24 | env:
25 | matrix: advanced
26 | '*': export ${jervis_toolchain_ivalue}
27 | gemfile:
28 | default_ivalue: ${PWD}/Gemfile
29 | '*': export BUNDLE_GEMFILE="${jervis_toolchain_ivalue}"
30 | jdk:
31 | default_ivalue: openjdk7
32 | openjdk6: more commands
33 | openjdk7: some commands
34 | python:
35 | default_ivalue: '2.7'
36 | matrix: advanced
37 | '2.6': more commands
38 | '2.7': some commands
39 | rvm:
40 | default_ivalue: 1.9.3
41 | '*': some commands
42 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_missing_defaults_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "os": "ubuntu1404",
4 | "stability": "stable",
5 | "sudo": "sudo"
6 | },
7 | "supported_platforms": {
8 | "docker": {
9 | "ubuntu1404": {
10 | "language": [
11 | "groovy",
12 | "java",
13 | "python",
14 | "ruby"
15 | ],
16 | "toolchain": [
17 | "env",
18 | "gemset",
19 | "rvm",
20 | "python",
21 | "jdk"
22 | ]
23 | }
24 | }
25 | },
26 | "restrictions": {
27 | "docker": {
28 | "only_organizations": ["samrocketman"],
29 | "only_projects": ["samrocketman/jervis"]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_missing_defaults_stability.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "sudo": "sudo"
6 | },
7 | "supported_platforms": {
8 | "docker": {
9 | "ubuntu1404": {
10 | "language": [
11 | "groovy",
12 | "java",
13 | "python",
14 | "ruby"
15 | ],
16 | "toolchain": [
17 | "env",
18 | "gemset",
19 | "rvm",
20 | "python",
21 | "jdk"
22 | ]
23 | }
24 | }
25 | },
26 | "restrictions": {
27 | "docker": {
28 | "only_organizations": ["samrocketman"],
29 | "only_projects": ["samrocketman/jervis"]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_missing_defaults_sudo.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable"
6 | },
7 | "supported_platforms": {
8 | "docker": {
9 | "ubuntu1404": {
10 | "language": [
11 | "groovy",
12 | "java",
13 | "python",
14 | "ruby"
15 | ],
16 | "toolchain": [
17 | "env",
18 | "gemset",
19 | "rvm",
20 | "python",
21 | "jdk"
22 | ]
23 | }
24 | }
25 | },
26 | "restrictions": {
27 | "docker": {
28 | "only_organizations": ["samrocketman"],
29 | "only_projects": ["samrocketman/jervis"]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/bad_toolchains_friendly.json:
--------------------------------------------------------------------------------
1 | {
2 | "toolchains": {
3 | "java": ["env", "jdk"],
4 | "ruby": ["gemfile", "env", "rvm", "jdk"]
5 | },
6 | "env": {
7 | "matrix": "advanced",
8 | "*": [
9 | "export ${jervis_toolchain_ivalue}"
10 | ]
11 | },
12 | "gemfile": {
13 | "default_ivalue": "${PWD}/Gemfile",
14 | "*": [
15 | "export BUNDLE_GEMFILE=\"${jervis_toolchain_ivalue}\""
16 | ]
17 | },
18 | "jdk": {
19 | "default_ivalue": "openjdk7",
20 | "friendlyLabel": 6,
21 | "openjdk6": [
22 | "more commands"
23 | ],
24 | "openjdk7": [
25 | "some commands"
26 | ]
27 | },
28 | "rvm": {
29 | "default_ivalue": "1.9.3",
30 | "friendlyLabel": true,
31 | "*": [
32 | "some commands"
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/resources/good_toolchains_friendly.json:
--------------------------------------------------------------------------------
1 | {
2 | "toolchains": {
3 | "java": ["env", "jdk"],
4 | "ruby": ["gemfile", "env", "rvm", "jdk"]
5 | },
6 | "env": {
7 | "matrix": "advanced",
8 | "*": [
9 | "export ${jervis_toolchain_ivalue}"
10 | ]
11 | },
12 | "gemfile": {
13 | "default_ivalue": "${PWD}/Gemfile",
14 | "*": [
15 | "export BUNDLE_GEMFILE=\"${jervis_toolchain_ivalue}\""
16 | ]
17 | },
18 | "jdk": {
19 | "default_ivalue": "openjdk7",
20 | "friendlyLabel": true,
21 | "openjdk6": [
22 | "more commands"
23 | ],
24 | "openjdk7": [
25 | "some commands"
26 | ]
27 | },
28 | "rvm": {
29 | "default_ivalue": "1.9.3",
30 | "friendlyLabel": true,
31 | "*": [
32 | "some commands"
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vars/isPRBuild.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /*
17 | A pipeline interface to check if the current build is being done from a Git
18 | tag. Designed for multibranch pipeline jobs.
19 | */
20 |
21 | @NonCPS
22 | Boolean call() {
23 | isBuilding(['pr'])
24 | }
25 |
--------------------------------------------------------------------------------
/vars/isTagBuild.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /*
17 | A pipeline interface to check if the current build is being done from a Git
18 | tag. Designed for multibranch pipeline jobs.
19 | */
20 |
21 | @NonCPS
22 | Boolean call() {
23 | isBuilding(['tag'])
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/resources/good_platforms_simple.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemfile",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_defaults_os.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": true,
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_defaults_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": true,
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_defaults_stability.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": true,
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_defaults_sudo.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": true
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_value_defaults_os.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "centos6x": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Jervis",
3 | "initializeCommand": "./.devcontainer/build-dependencytrack-snapshot.sh",
4 | "dockerComposeFile": ["docker-compose.yml"],
5 | "workspaceFolder": "/workspace/jervis",
6 | "service": "jervis",
7 | "extensions": [
8 | "2gua.rainbow-brackets",
9 | "Gruntfuggly.todo-tree",
10 | "davehart.quick-run-panel",
11 | "marlon407.code-groovy",
12 | "mhutchie.git-graph",
13 | "naco-siren.gradle-language",
14 | "oderwat.indent-rainbow",
15 | "shardulm94.trailing-spaces",
16 | "vscjava.vscode-gradle",
17 | "vscjava.vscode-java-pack",
18 | "vscodevim.vim"
19 | ],
20 | "settings": {
21 | "trailing-spaces.deleteModifiedLinesOnly": true,
22 | "QuickRunPanel.includeDebugConfigs": false,
23 | "QuickRunPanel.taskSources": [
24 | "Workspace"
25 | ]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_value_defaults_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "metal": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_value_defaults_sudo.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "invalid"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_missing_restrictions_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "metal": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_restrictions_platform_only_projects.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": "invalid"
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_value_defaults_stability.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "invalid",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": ["samrocketman"],
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_restrictions_platform_only_organizations.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | }
26 | },
27 | "restrictions": {
28 | "docker": {
29 | "only_organizations": "invalid",
30 | "only_projects": ["samrocketman/jervis"]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/rsa_keys/bad_id_rsa_1024:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXQIBAAKBgQCmDT2vGthvevV7QbZygYowDsIfmpFFDyAl5UmF3aDFxgKnFrQW
3 | Ro0tc/mjo0sJC3w4DH3/oe0EQPYqL5bzCDSE4dTiA5i26dwvROQGFpOvh9ks4691
4 | zoJ/yUnBDD1DxZh0CC4jzb1OBfp1VnF9pGAMXHzor7LLnKUXWnf+PLKJ4wIDAQAB
5 | AoGBAKF5KszGvEXcOi87/aFoGusUzu1Qr4eKZ+ayC0cj+B2aqiW1zDYFMXBL4Syh
6 | tGv9QTR34WbfHc8PJNJtKMr45afpAJRIZsckWhijgIvfbudp2VmA8fiqhlfYSPA7
7 | XXAIS86npR+t5lvR0Fk8CnDXaDrlBC2W3lIOoT/IN19iLcRxAkEA2xWNJwPX99aA
8 | XBh4yXWKW2dwBJigdVK2Ml0QLGkqf6WoYeQJTxUBUHRGCGibO/8PzwKTZEKhkAQQ
9 | ES0fOwm6tQJBAMIIEr8uZoE4q534gQy0+Fl4oBviPr43g7t5w5WELhL1O+a8/ao/
10 | ybEQjmyvcIUWcmWV1K0GtSkQUgDvQRP42TcCQQChplE0DF35/EdRrKzS2Otxbez1
11 | NziN2K2ek5QvcJlu/egz8nH769/AYUqbQbPonNYpRBlEzPUwsg643bZBdXhRAkB0
12 | GHqHE89XcD4XVjJ5FOsoNamvJW8fR341tYSWOLGMvFksFVa+AE7A+EQPueVcbHLk
13 | X4MSSForCM3YK0/IEHR/AkAuFScon0cc1Z3gIPlQg0dNDMDlnT9cyC4C7EwU4CKN
14 | APzykkuomc5jpgtKw9o3AJsITlLMrMlO8a7vLdrT/5WO
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_value_supported_platforms_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | },
26 | "metal": {}
27 | },
28 | "restrictions": {
29 | "docker": {
30 | "only_organizations": ["samrocketman"],
31 | "only_projects": ["samrocketman/jervis"]
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_supported_platforms_platform.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | },
26 | "metal": "invalid"
27 | },
28 | "restrictions": {
29 | "docker": {
30 | "only_organizations": ["samrocketman"],
31 | "only_projects": ["samrocketman/jervis"]
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/groovy/net/gleske/jervis/lang/package-info.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /**
17 | Provides helpers for lifecycles, build tools, and other utilities surrounding supported programming languages.
18 | This class should be strictly for classes directly related to supported programming languages.
19 | */
20 | package net.gleske.jervis.lang
21 |
--------------------------------------------------------------------------------
/src/test/resources/rsa_keys/bad_id_rsa_pkcs8_1024:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKYNPa8a2G969XtB
3 | tnKBijAOwh+akUUPICXlSYXdoMXGAqcWtBZGjS1z+aOjSwkLfDgMff+h7QRA9iov
4 | lvMINITh1OIDmLbp3C9E5AYWk6+H2Szjr3XOgn/JScEMPUPFmHQILiPNvU4F+nVW
5 | cX2kYAxcfOivssucpRdad/48sonjAgMBAAECgYEAoXkqzMa8Rdw6Lzv9oWga6xTO
6 | 7VCvh4pn5rILRyP4HZqqJbXMNgUxcEvhLKG0a/1BNHfhZt8dzw8k0m0oyvjlp+kA
7 | lEhmxyRaGKOAi99u52nZWYDx+KqGV9hI8DtdcAhLzqelH63mW9HQWTwKcNdoOuUE
8 | LZbeUg6hP8g3X2ItxHECQQDbFY0nA9f31oBcGHjJdYpbZ3AEmKB1UrYyXRAsaSp/
9 | pahh5AlPFQFQdEYIaJs7/w/PApNkQqGQBBARLR87Cbq1AkEAwggSvy5mgTirnfiB
10 | DLT4WXigG+I+vjeDu3nDlYQuEvU75rz9qj/JsRCObK9whRZyZZXUrQa1KRBSAO9B
11 | E/jZNwJBAKGmUTQMXfn8R1GsrNLY63Ft7PU3OI3YrZ6TlC9wmW796DPycfvr38Bh
12 | SptBs+ic1ilEGUTM9TCyDrjdtkF1eFECQHQYeocTz1dwPhdWMnkU6yg1qa8lbx9H
13 | fjW1hJY4sYy8WSwVVr4ATsD4RA+55VxscuRfgxJIWisIzdgrT8gQdH8CQC4VJyif
14 | RxzVneAg+VCDR00MwOWdP1zILgLsTBTgIo0A/PKSS6iZzmOmC0rD2jcAmwhOUsys
15 | yU7xru8t2tP/lY4=
16 | -----END PRIVATE KEY-----
17 |
--------------------------------------------------------------------------------
/src/main/groovy/net/gleske/jervis/tools/package-info.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /**
17 | Contains miscellaneous security tools and other doodads. The tools contained in this
18 | package are meant to enhance the capabilities of Jervis by providing classes which
19 | don't make sense as single functions in the Job DSL scripts.
20 | */
21 | package net.gleske.jervis.tools
22 |
--------------------------------------------------------------------------------
/src/test/resources/bad_platforms_type_supported_platforms_platform_os.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaults": {
3 | "platform": "docker",
4 | "os": "ubuntu1404",
5 | "stability": "stable",
6 | "sudo": "sudo"
7 | },
8 | "supported_platforms": {
9 | "docker": {
10 | "ubuntu1404": {
11 | "language": [
12 | "groovy",
13 | "java",
14 | "python",
15 | "ruby"
16 | ],
17 | "toolchain": [
18 | "env",
19 | "gemset",
20 | "rvm",
21 | "python",
22 | "jdk"
23 | ]
24 | }
25 | },
26 | "metal": {
27 | "ubuntu1404": "invalid"
28 | }
29 | },
30 | "restrictions": {
31 | "docker": {
32 | "only_organizations": ["samrocketman"],
33 | "only_projects": ["samrocketman/jervis"]
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribute to Jervis
2 |
3 | Thanks for taking an interest in contributing to the Jervis project! This guide
4 | details how to contribute to Jervis in a way that is efficient and safe for
5 | everyone.
6 |
7 | # Issue tracker
8 |
9 | [GitHub Issues][issues] is where I do all of my project planning. Feel free to
10 | collaborate on open issues or create an issue for a problem you're having.
11 |
12 | # The wiki
13 |
14 | [The wiki][wiki] is used as a comprehensive guide for users and developers of
15 | Jervis. All material is mirrored and regularly tagged in case of vandalism.
16 |
17 | # Code style
18 |
19 | Before making a contribution to Jervis be sure to review the [style
20 | guide][style] used by the Jervis project. Code that does not conform is less
21 | likely to be merged because it would require work to fix. So please ensure your
22 | code style conforms with the rest of the project.
23 |
24 | [issues]: https://github.com/samrocketman/jervis/issues
25 | [style]: STYLE_GUIDE.md
26 | [wiki]: https://github.com/samrocketman/jervis/wiki
27 |
--------------------------------------------------------------------------------
/src/test/resources/mocks/api.github.com_graphql_11d22ccb4e46c2bee006552cb7634b0ed8a50ba0ad5b5f20a3ef4c7310d43b32:
--------------------------------------------------------------------------------
1 | {
2 | "data": {
3 | "gitRef0": {
4 | "jervisYaml0": null,
5 | "jervisYaml1": {
6 | "text": "mock data 1"
7 | },
8 | "rootFolder": {
9 | "file": [
10 | {
11 | "name": ".travis.yml",
12 | "type": "blob"
13 | },
14 | {
15 | "name": "README.md",
16 | "type": "blob"
17 | }
18 | ]
19 | }
20 | },
21 | "gitRef1": {
22 | "jervisYaml0": null,
23 | "jervisYaml1": {
24 | "text": "mock data 2"
25 | },
26 | "rootFolder": {
27 | "file": [
28 | {
29 | "name": ".travis.yml",
30 | "type": "blob"
31 | },
32 | {
33 | "name": "CHANGELOG.md",
34 | "type": "blob"
35 | },
36 | {
37 | "name": "README.md",
38 | "type": "blob"
39 | }
40 | ]
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/groovy/net/gleske/jervis/remotes/creds/package-info.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /**
17 | Contains partially implemented credentials for remotes. This allows
18 | applications to provide secure credentials to the remote clients.
19 |
20 | See {@link ReadonlyTokenCredential} which serves as an example and
21 | provides sample usage.
22 |
23 | */
24 | package net.gleske.jervis.remotes.creds
25 |
--------------------------------------------------------------------------------
/dependencytrack/README.md:
--------------------------------------------------------------------------------
1 | # DependencyTrack integration
2 |
3 | This is an automated local integration for vulnerability reporting in Jervis
4 | dependencies.
5 |
6 | This guide assumes you have docker, docker-compose, GNU Awk, and OpenSSL tools
7 | available. Tested from Ubuntu 18.04 GNU/Linux.
8 |
9 | # Provision
10 |
11 | docker-compose up -d
12 |
13 | 1. Log into `http://localhost:8080/` username `admin` and password `admin`. You
14 | will be prompted to change it.
15 | 2. Under _Administration > Access Management > Teams_, open the `Automation`
16 | team, and add the permission `PROJECT_CREATION_UPLOAD`.
17 | 3. Within the `Automation` team copy the generated API key. You'll need this
18 | later to set the `DT_API_TOKEN` environment variable.
19 |
20 | # Generate SBOM
21 |
22 | From the root of this repository.
23 |
24 | ./gradlew --init-script ./dependencytrack/dtrack.gradle cyclonedxBom
25 |
26 | # Upload to DependencyTrack
27 |
28 | From the root of this repository execute the following.
29 |
30 | export DT_API_TOKEN=...
31 | ./dependencytrack/submit-results.sh
32 |
--------------------------------------------------------------------------------
/jobs/create_folder.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014-2025 Sam Gleske - https://github.com/samrocketman/jervis
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | /*
17 | Create a folder in which jobs will be grouped based on GitHub organization
18 | or user.
19 | */
20 | require_bindings('jobs/create_folder.groovy', ['parent_job', 'project_folder'])
21 |
22 | import jenkins.model.Jenkins
23 |
24 | if(!Jenkins.instance.getItem(project_folder)) {
25 | println "Creating folder ${project_folder}"
26 | parent_job.folder(project_folder)
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/resources/net/gleske/jervis/doctemplates/lifecycle.tmpl.md:
--------------------------------------------------------------------------------
1 | <% if(onlyEntry) { %>Because ${friendlyName} support is basic there's only one default lifecycle.
2 |
3 | ```yaml
4 | language: ${language}
5 | install: ${buildtool.install ?: '# no command run'}
6 | script: ${buildtool.script ?: '# no command run'}
7 | ```
8 | <% } else { %><% if(!lastEntry) { %>
9 | If a file named `${buildtool.fileExistsCondition}` is in the repository root, then the following `install` and `script` defaults will be run.
10 |
11 | ```yaml
12 | language: ${language}
13 | install: ${buildtool.install ?: '# no command run'}
14 | script: ${buildtool.script ?: '# no command run'}
15 | ```<% if(nextFile) { %>
16 |
17 | If `${buildtool.fileExistsCondition}` does not exist, then the system will fall back to finding a file named `${nextFile}`.<% } %><% } else { %>
18 | Otherwise, ${friendlyName} falls back to the following default YAML with no further defaults detection.
19 |
20 | ```yaml
21 | language: ${language}
22 | install: ${buildtool.install ?: '# no command run'}
23 | script: ${buildtool.script ?: '# no command run'}
24 | ```<% } %><% } %>
25 |
--------------------------------------------------------------------------------