forked from jenkins-infra/release
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfra-agents-health
More file actions
116 lines (109 loc) · 4.02 KB
/
infra-agents-health
File metadata and controls
116 lines (109 loc) · 4.02 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
pipeline {
agent none
options {
disableConcurrentBuilds()
}
environment {
RELEASE_PROFILE = 'weekly'
AZURE_VAULT_NAME = 'prodreleasecore'
AZURE_VAULT_CERT = 'prodreleasecore-2023'
SIGN_KEYSTORE_FILENAME = 'jenkins.pfx'
SIGN_STOREPASS = credentials('signing-cert-pass-2023')
GPG_FILE = 'jenkins-release.gpg'
AZURE_VAULT_CLIENT_ID = credentials('azure-vault-client-id')
AZURE_VAULT_CLIENT_SECRET = credentials('azure-vault-client-secret')
AZURE_VAULT_TENANT_ID = credentials('azure-vault-tenant-id')
// Using HTTPS with no credentials - https://github.com/jenkins-infra/helpdesk/issues/4909 - need a GH app if rate limited or need to write things to git
PACKAGING_GIT_REPOSITORY = 'https://github.com/jenkinsci/packaging.git'
PACKAGING_GIT_BRANCH = 'master'
WORKING_DIRECTORY = "release"
}
stages {
stage('Test Agents Health'){
parallel {
stage('Test Linux Agent `package-linux`') {
agent {
kubernetes {
yamlFile 'PodTemplates.d/package-linux.yaml'
}
}
environment {
SSH_HOSTKEY_ARCHIVES_JENKINS_IO = credentials('ssh-hostkey-archives.jenkins.io')
}
steps {
checkout scm
// Ensure we can get the secondary git repository used for packaging
dir (WORKING_DIRECTORY) {
git branch: PACKAGING_GIT_BRANCH, url: PACKAGING_GIT_REPOSITORY
}
// Ensure we can retrieve the Code Signing Certificate'
sh '''
utils/release.bash --downloadAzureKeyvaultSecret
utils/release.bash --configureKeystore
utils/release.bash --getGPGKeyFromAzure
'''
// Ensure we get the correct Java and Maven versions
sh 'mvn -v'
// Ensure the correct storage is mounted in expected paths
sh 'ls -la /var/www/pkg.jenkins.io.staging/'
sh 'ls -la /var/www/pkg.jenkins.io.production/'
sh 'ls -la /var/www/get.jenkins.io.staging/'
sh 'ls -la /var/www/get.jenkins.io.production/'
// Ensure we can SSH-connect to required remote servers
sshagent(credentials: [
'pkgserver',
'archives.jenkins.io'
]) {
sh '''
mkdir -m 700 -p "${HOME}/.ssh"
cat "${SSH_HOSTKEY_ARCHIVES_JENKINS_IO}" >> "${HOME}/.ssh/known_hosts"
ssh -v mirrorsync@archives.jenkins.io whoami
'''
}
}
}
stage('Test Linux Agent `release-linux`') {
agent {
kubernetes {
yamlFile 'PodTemplates.d/release-linux.yaml'
}
}
steps {
// Ensure we can clone the secondary git repository used for releases
sshagent(['release-key']) {
sh 'utils/release.bash --cloneReleaseGitRepository'
}
// Ensure we can retrieve the Code Signing Certificate'
sh '''
utils/release.bash --downloadAzureKeyvaultSecret
utils/release.bash --configureKeystore
utils/release.bash --getGPGKeyFromAzure
'''
// Ensure we get the correct Java and Maven versions
sh 'mvn -v'
}
}
stage('Test Windows Agent `package-windows`') {
agent {
kubernetes {
yamlFile 'PodTemplates.d/package-windows.yaml'
}
}
steps {
pwsh 'java -version'
container('dotnet') {
powershell 'msbuild -version'
}
container('dotnet') {
checkout scm
// Ensure we can get the secondary git repository used for packaging
dir (WORKING_DIRECTORY) {
git branch: PACKAGING_GIT_BRANCH, url: PACKAGING_GIT_REPOSITORY
}
}
}
}
}
}
}
}