Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrog-ecosystem committed Mar 5, 2024
2 parents d4e44c4 + 9848b0c commit 88aa40e
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 44 deletions.
45 changes: 16 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def runRelease(architectures) {
}
}

// We sign the binary also for the standalone Windows executable, and not just for Windows executable packaged inside Chocolaty.
downloadToolsCert()
print "Uploading version $version to Repo21"
uploadCli(architectures)
Expand Down Expand Up @@ -159,8 +160,6 @@ def runRelease(architectures) {
buildPublishDockerImages(version, jfrogCliRepoDir)
}

// Download cert files, to be used for signing the Windows executable, packaged by Chocolatey.
downloadToolsCert()
stage('Build and publish Chocolatey') {
publishChocoPackageWithRetries(version, jfrogCliRepoDir, architectures)
}
Expand Down Expand Up @@ -228,16 +227,11 @@ def validateReleaseVersion() {

def downloadToolsCert() {
stage('Download tools cert') {
// Download the certificate file and key file, used for signing the JFrog CLI binary.
withCredentials([
string(credentialsId: 'download-signing-cert-access-token', variable: 'DOWNLOAD_SIGNING_CERT_ACCESS_TOKEN'),
string(credentialsId: 'repo21-url', variable: 'REPO21_URL')
]) {
// Download the certificate files, used for signing the JFrog CLI binary.
// To update the certificate before it is expired, download the digicert_sign.zip file and follow the instructions in the README file, which is packaged inside that zip.
sh """#!/bin/bash
$builderPath rt dl installation-files/certificates/jfrog/jfrogltd_signingcer_full.tar.gz --url $REPO21_URL/artifactory --flat --access-token=$DOWNLOAD_SIGNING_CERT_ACCESS_TOKEN
"""
}
sh 'tar -xvzf jfrogltd_signingcer_full.tar.gz'
$builderPath rt dl ecosys-installation-files/certificates/jfrog/digicert_sign.zip "${cliWorkspace}/${jfrogCliRepoDir}build/sign/" --flat --explode
"""
}
}

Expand Down Expand Up @@ -415,22 +409,14 @@ def build(goos, goarch, pkg, fileName) {
env.GOARCH=""

if (goos == 'windows') {
dir("${cliWorkspace}/certs-dir") {
dir("${jfrogCliRepoDir}build/sign") {
// Move the jfrog executable into the 'sign' directory, so that it is signed there.
sh "mv $jfrogCliRepoDir/$fileName ${jfrogCliRepoDir}build/sign/${fileName}.unsigned"
// Copy all the certificate files into the 'sign' directory.
sh "cp -r ./ ${jfrogCliRepoDir}build/sign/"
// Pull the docker container, which signs the JFrog CLI binary.
// In order to build it locally, run the following command:
// "docker build -t jfrog-cli-sign-tool ${jfrogCliRepoDir}build/sign/"
sh """#!/bin/bash
$cliWorkspace/$builderPath rt docker-pull ${REPO_NAME_21}/ecosys-docker-local/jfrog-cli-sign-tool ecosys-docker-local
"""
// Run the pulled image in order to signs the JFrog CLI binary.
def signCmd = "osslsigncode sign -certs workspace/JFrog_Ltd_.crt -key workspace/jfrogltd.key -n JFrog_CLI -i https://www.jfrog.com/confluence/display/CLI/JFrog+CLI -in workspace/${fileName}.unsigned -out workspace/$fileName"
sh "docker run -v ${jfrogCliRepoDir}build/sign/:/workspace --rm ${REPO_NAME_21}/ecosys-docker-local/jfrog-cli-sign-tool $signCmd"
sh "mv $jfrogCliRepoDir/$fileName ${fileName}.unsigned"
sh "docker build -t jfrog-cli-sign-tool"
// Run the built image in order to signs the JFrog CLI binary.
sh "docker run --pull=never -v ${jfrogCliRepoDir}build/sign/:/home/frogger jfrog-cli-sign-tool -in ${fileName}.unsigned -out $fileName"
// Move the JFrog CLI binary from the 'sign' directory, back to its original location.
sh "mv ${jfrogCliRepoDir}build/sign/$fileName $jfrogCliRepoDir"
sh "mv $fileName $jfrogCliRepoDir"
}
}
}
Expand Down Expand Up @@ -475,13 +461,16 @@ def installNpm(nodeVersion) {
}

def publishChocoPackageWithRetries(version, jfrogCliRepoDir, architectures) {
def architecture = architectures.find { it.goos == 'windows' && it.goarch == 'amd64' }
build(architecture.goos, architecture.goarch, architecture.pkg, "${cliExecutableName}.exe")

def maxAttempts = 10
def currentAttempt = 1
def waitSeconds = 18

while (currentAttempt <= maxAttempts) {
try {
publishChocoPackage(version, jfrogCliRepoDir, architectures)
publishChocoPackage(version, jfrogCliRepoDir, architecture)
echo "Successfully published Choco package!"
return
} catch (Exception e) {
Expand All @@ -495,9 +484,7 @@ def publishChocoPackageWithRetries(version, jfrogCliRepoDir, architectures) {
}
}

def publishChocoPackage(version, jfrogCliRepoDir, architectures) {
def architecture = architectures.find { it.goos == 'windows' && it.goarch == 'amd64' }
build(architecture.goos, architecture.goarch, architecture.pkg, "${cliExecutableName}.exe")
def publishChocoPackage(version, jfrogCliRepoDir, architecture) {
def packageName = "jfrog-cli"
if (cliExecutableName == 'jf') {
packageName="${packageName}-v2-jf"
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2-jf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2-jf",
"version": "2.53.1",
"version": "2.53.2",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2",
"version": "2.53.1",
"version": "2.53.2",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
6 changes: 0 additions & 6 deletions build/sign/Dockerfile

This file was deleted.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240218115031-cc5c8b521695
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240225151519-de88b95a3824

// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240218093454-1c352a93c23d
// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240225150756-e5fed3788eca

// replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.2-0.20240215122147-517c589b5ada
// replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.4-0.20240225141439-cc8b9f3d1962

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8
// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20240225113943-096bf22ca54c

// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.3.3-0.20231223133729-ef57bd08cedc
2 changes: 1 addition & 1 deletion utils/cliutils/cli_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "time"

const (
// General CLI constants
CliVersion = "2.53.1"
CliVersion = "2.53.2"
ClientAgent = "jfrog-cli-go"

// CLI base commands constants:
Expand Down

0 comments on commit 88aa40e

Please sign in to comment.