Skip to content
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
6 changes: 0 additions & 6 deletions Jenkinsfile.executable.release-signing
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
pipeline {
agent any
parameters {
string(name: 'API_URL', defaultValue: 'https://app.signpath.io/api')
string(name: 'ORGANIZATION_ID', defaultValue: '')
string(name: 'API_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.ExecutableProject.ApiToken')
string(name: 'TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.TrustedBuildSystemToken')
}
stages {
stage('Build') {
Expand All @@ -21,10 +18,7 @@ pipeline {
steps {
script {
signingRequestId = submitSigningRequest(
apiUrl: "${params.API_URL}",
organizationId: "${params.ORGANIZATION_ID}",
apiTokenCredentialId: "${params.API_TOKEN_CREDENTIAL_ID}",
trustedBuildSystemTokenCredentialId: "${params.TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID}",
projectSlug: "executable",
signingPolicySlug: "release-signing",
inputArtifactPath: "build-output/unsigned/executable.exe",
Expand Down
6 changes: 0 additions & 6 deletions Jenkinsfile.executable.test-signing
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
pipeline {
agent any
parameters {
string(name: 'API_URL', defaultValue: 'https://app.signpath.io/api')
string(name: 'ORGANIZATION_ID', defaultValue: '')
string(name: 'API_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.ExecutableProject.ApiToken')
string(name: 'TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.TrustedBuildSystemToken')
}
stages {
stage('Build') {
Expand All @@ -20,10 +17,7 @@ pipeline {
stage('Sign with SignPath') {
steps {
submitSigningRequest(
apiUrl: "${params.API_URL}",
organizationId: "${params.ORGANIZATION_ID}",
apiTokenCredentialId: "${params.API_TOKEN_CREDENTIAL_ID}",
trustedBuildSystemTokenCredentialId: "${params.TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID}",
projectSlug: "executable",
signingPolicySlug: "test-signing",
inputArtifactPath: "build-output/unsigned/executable.exe",
Expand Down
6 changes: 0 additions & 6 deletions Jenkinsfile.installer.release-signing
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
pipeline {
agent any
parameters {
string(name: 'API_URL', defaultValue: 'https://app.signpath.io/api')
string(name: 'ORGANIZATION_ID', defaultValue: '')
string(name: 'API_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.InstallerProject.ApiToken')
string(name: 'TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.TrustedBuildSystemToken')
}
stages {
stage('Build') {
Expand All @@ -21,10 +18,7 @@ pipeline {
steps {
script {
signingRequestId = submitSigningRequest(
apiUrl: "${params.API_URL}",
organizationId: "${params.ORGANIZATION_ID}",
apiTokenCredentialId: "${params.API_TOKEN_CREDENTIAL_ID}",
trustedBuildSystemTokenCredentialId: "${params.TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID}",
projectSlug: "installer",
signingPolicySlug: "release-signing",
inputArtifactPath: "build-output/unsigned/installer.msi",
Expand Down
2 changes: 0 additions & 2 deletions Jenkinsfile.installer.test-signing
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pipeline {
submitSigningRequest(
apiUrl: "${params.API_URL}",
organizationId: "${params.ORGANIZATION_ID}",
apiTokenCredentialId: "${params.API_TOKEN_CREDENTIAL_ID}",
trustedBuildSystemTokenCredentialId: "${params.TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID}",
projectSlug: "installer",
signingPolicySlug: "test-signing",
inputArtifactPath: "build-output/unsigned/installer.msi",
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.installer.test-signing-curl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pipeline {
agent any
environment {
API_TOKEN = credentials('SignPath.InstallerProject.ApiToken')
API_TOKEN = credentials('SignPath.ApiToken')
}
stages {
stage('Build') {
Expand All @@ -13,7 +13,7 @@ pipeline {
steps {
script {
output = sh(returnStdout: true, script: '''curl -i \\
-H "Authorization: Bearer ${API_TOKEN}" \\
-H "Authorization: Bearer ${API_TOKEN}" \\
-F "ProjectSlug=installer" \\
-F "SigningPolicySlug=release-signing" \\
-F "Artifact=@./build-output/unsigned/installer.msi" \\
Expand Down
5 changes: 2 additions & 3 deletions Jenkinsfile.installer.test-signing-pwsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pipeline {
agent any
environment {
API_TOKEN = credentials('SignPath.InstallerProject.ApiToken')
API_TOKEN = credentials('SignPath.ApiToken')
}
stages {
stage('Build') {
Expand All @@ -12,8 +12,7 @@ pipeline {
stage('Sign with SignPath') {
steps {
pwsh '''Submit-SigningRequest `
-ApiUrl "${env:API_URL}", `
-ApiToken "${env:API_TOKEN}" `
-ApiToken "${env:API_TOKEN}" `
-OrganizationId "${env:ORGANIZATION_ID}" `
-ProjectSlug "installer" `
-SigningPolicySlug "test-signing" `
Expand Down
6 changes: 0 additions & 6 deletions Jenkinsfile.installer.test-signing.api_token
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
pipeline {
agent any
parameters {
string(name: 'API_URL', defaultValue: 'https://app.signpath.io/api')
string(name: 'ORGANIZATION_ID', defaultValue: '')
string(name: 'CI_USER_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.InstallerProject.CIUserToken')
string(name: 'TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID', defaultValue: 'SignPath.TrustedBuildSystemToken')
}
stages {
stage('Build') {
Expand All @@ -21,10 +18,7 @@ pipeline {
steps {
sh 'curl -o build-output/unsigned/bigArtifact.exe https://www.rubicon.eu/downloads/26bb711a-5771-49fb-b41c-cdb2e48243ee/SFX_512MB.exe'
submitSigningRequest(
apiUrl: "${params.API_URL}",
organizationId: "${params.ORGANIZATION_ID}",
apiTokenCredentialId: "${params.CI_USER_TOKEN_CREDENTIAL_ID}",
trustedBuildSystemTokenCredentialId: "${params.TRUSTED_BUILD_SYSTEM_TOKEN_CREDENTIAL_ID}",
projectSlug: "installer",
signingPolicySlug: "test-signing",
inputArtifactPath: "build-output/unsigned/bigArtifact.exe",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Preview sample of [Jenkins SignPath Plugin](https://github.com/jenkinsci/signpat
# Demo

1. Install the Jenkins CIConnector Plugin
2. Add `SignPath.TrustedBuildSystemToken` (Scope: System) and `SignPath.ExecutableProject.ApiToken` (Scope: Global)
2. Add `SignPath.TrustedBuildSystemToken` (Scope: System) and `SignPath.ApiToken` (Scope: Global)
3. Create a new Pipeline `Sign Executable (test-signing)`
* Add a parameter `ORGANIZATION_ID` with the org id as default
* Select _Pipeline script from SCM_ and enter this repo URL and `Jenkinsfile.executable.test-signing` as name
Expand Down