Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHTAP-3056 GitLab CI tests #171

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion default.env
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,29 @@ export JENKINS_USERNAME=''
# Jenkins API Token
# Required: no (by default testing on Jenkins is disabled)
# Example: 112b49e9....
export JENKINS_TOKEN=''
export JENKINS_TOKEN=''

# Quay Username - needed for GitLab CI, GitHub Actions
# Required: no (by default testing on Jenkins is disabled)
# Example: admin-admin-edit-view
export QUAY_USERNAME=''

# Quay Password - needed for GitLab CI, GitHub Actions
# Required: no (by default testing on Jenkins is disabled)
# Example: 112b49e9....
export QUAY_PASSWORD=''

# Cosign public key in base64 format - needed for GitLab CI, GitHub Actions, Jenkins
# Required: no (by default testing on Jenkins is disabled)
# Example: 112b49e9....
export COSIGN_PUBLIC_KEY=''

# Cosign private key in base64 format - needed for GitLab CI, GitHub Actions, Jenkins
# Required: no (by default testing on Jenkins is disabled)
# Example: 112b49e9....
export COSIGN_SECRET_KEY=''

# Cosign secret password in base64 format - needed for GitLab CI, GitHub Actions, Jenkins
# Required: no (by default testing on Jenkins is disabled)
# Example: 112b49e9....
export COSIGN_SECRET_PASSWORD=''
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
active: true,
tekton: true,
jenkins: false,
actions: false,
host: 'https://api.github.com',
registriesConfig: {
quay: {
Expand All @@ -24,6 +25,7 @@ module.exports = {
active: true,
tekton: true,
jenkins: false,
gitlabci: false,
host: 'https://gitlab.com',
registriesConfig: {
quay: {
Expand Down
17 changes: 11 additions & 6 deletions src/apis/ci/jenkins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class JenkinsCI extends Utils {
*/
constructor(jenkinsURL: string, jenkinsUsername: string, jenkinsToken: string) {
super();

this.jenkinsUrl = jenkinsURL;
this.jenkinsUsername = jenkinsUsername;
this.jenkinsApiToken = jenkinsToken;
Expand Down Expand Up @@ -93,8 +92,17 @@ export class JenkinsCI extends Utils {
}
return response.status === 200;
} catch (error) {
console.error('Error checking job existence:', error);
throw error;
if (axios.isAxiosError(error)) {
if (error.response && error.response.status === 404) {
return false;
} else {
console.error('Axios error checking job existence:', error);
throw error;
}
} else {
console.error('Error checking job existence:', error);
throw error;
}
}
}

Expand Down Expand Up @@ -203,7 +211,4 @@ export class JenkinsCI extends Utils {
console.error('Error deleting job:', error);
}
}



}
Loading