Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/jfrog/jfrog-cli into signed-…
Browse files Browse the repository at this point in the history
…pipelines
  • Loading branch information
bhanurp committed Nov 3, 2023
2 parents aa0ac66 + d047c66 commit 792ae8d
Show file tree
Hide file tree
Showing 114 changed files with 4,306 additions and 714 deletions.
23 changes: 23 additions & 0 deletions .github/RELEASE_LINK_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<details>
<summary>Downloads JFrog CLI</summary>

### Linux

[386](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-386/jf)
[AMD-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-amd64/jf)
[ARM-32](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-arm/jf)
[ARM-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-arm64/jf)
[PPC-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-ppc64/jf)
[PPC-64-LE](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-ppc64le/jf)
[S390X](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-linux-s390x/jf)

### MacOS

[AMD-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-mac-386/jf)
[ARM-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-mac-arm64/jf)

### Windows

[AMD-64](https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{version}/jfrog-cli-windows-amd64/jf.exe)

</details>
27 changes: 27 additions & 0 deletions .github/workflows/addReleaseLinks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Add links on release
on:
release:
types: [created]

jobs:
add-links-on-release:
name: Add links on release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Create markdown download links
run: |
# Remove the prefix 'v' from version.
RELEASE_VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
# Replace the place-holders '{version}' with the actual release version.
sed "s/{version}/$RELEASE_VERSION/g" ./.github/RELEASE_LINK_TEMPLATE.md > ./temp_releaseLinkTemplate.md
- name: Add links to release notes
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body_path: "temp_releaseLinkTemplate.md"
append_body: true
14 changes: 13 additions & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go
restore-keys: ${{ runner.os }}-go-
- name: Run Go vet
run: go vet -v ./...

Expand Down Expand Up @@ -65,3 +65,15 @@ jobs:
uses: securego/gosec@master
with:
args: -exclude G204,G301,G302,G304,G306 -tests -exclude-dir \.*test\.* ./...

ShellCheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore_paths: '*test*'
3 changes: 1 addition & 2 deletions .github/workflows/dockerTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
# We are temporarily downgrading to Go 1.20.5 due to a bug in version 1.20.6 that causes Docker tests to fail.
go-version: 1.20.5
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/frogbot-scan-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: jfrog/frogbot@v2
env:
JFROG_CLI_LOG_LEVEL: "DEBUG"

# [Mandatory]
# JFrog platform URL (This functionality requires version 3.29.0 or above of Xray)
JF_URL: ${{ secrets.FROGBOT_URL }}
Expand Down Expand Up @@ -116,4 +117,5 @@ jobs:
# [Optional]
# Set the minimum severity for vulnerabilities that should be fixed and commented on in pull requests
# The following values are accepted: Low, Medium, High or Critical
# JF_MIN_SEVERITY: ""
# JF_MIN_SEVERITY: ""

2 changes: 2 additions & 0 deletions .github/workflows/frogbot-scan-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
security-events: write
jobs:
scan-repository:
name: Scan Repository (${{ matrix.branch }} branch)
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -19,6 +20,7 @@ jobs:
- uses: jfrog/frogbot@v2
env:
JFROG_CLI_LOG_LEVEL: "DEBUG"

# [Mandatory]
# JFrog platform URL (This functionality requires version 3.29.0 or above of Xray)
JF_URL: ${{ secrets.FROGBOT_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mavenTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go
restore-keys: ${{ runner.os }}-go-
- name: Setup Maven v3.8.8 for macOS
uses: stCarolas/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nugetTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go
restore-keys: ${{ runner.os }}-go-
- name: Setup Artifactory
run: |
go install github.com/jfrog/jfrog-testing-infra/local-rt-setup@latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pythonTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.20.x
# Due to a bug in Python 3.12.0 we temporary use version 3.11.5
- name: Setup Python3
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.11.5"
- name: Setup Pipenv
if: ${{ matrix.suite == 'pipenv' }}
run: python -m pip install pipenv
Expand Down
75 changes: 68 additions & 7 deletions .github/workflows/scriptTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,86 @@ concurrency:
cancel-in-progress: true
jobs:
Scripts-tests:
name: Script tests (${{ matrix.os }})
name: Script tests (${{ matrix.suite.os }})
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows, macos ]
runs-on: ${{ matrix.os }}-latest
suite:
- os: "ubuntu"

- os: "macos"

- os: "windows"
osSuffix: ".exe"
runs-on: ${{ matrix.suite.os }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Go Cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Test install CLI - jf
run: sh build/installcli/jf.sh && jf --version
run: |
sh build/installcli/jf.sh
jf --version
- name: Test install CLI - jfrog
run: sh build/installcli/jfrog.sh && jfrog --version
run: |
sh build/installcli/jfrog.sh
jfrog --version
- name: Test get CLI - jf
run: sh build/getcli/jf.sh && ./jf --version
run: |
sh build/getcli/jf.sh
./jf --version
- name: Test get CLI - jfrog
run: sh build/getcli/jfrog.sh && ./jfrog --version
run: |
sh build/getcli/jfrog.sh
./jfrog --version
- name: Test Build CLI - sh
run: |
sh build/build.sh
./jf${{ matrix.suite.osSuffix }} --version
if: ${{ matrix.suite.os != 'windows' }}

- name: Test Build CLI - bat
run: |
build/build.bat
./jf${{ matrix.suite.osSuffix }} --version
if: ${{ matrix.suite.os == 'windows' }}

# Prior to the release, we set the new version in the package.json files, introducing the prereleased version.
# This adjustment may result in an attempt to download a version that hasn't been published to releases.jfrog.io yet.
# To handle it, we fetch the most recent JFrog CLI release and store it in the LATEST_RELEASE step output.
- name: "Get latest release"
id: latest-release
run: |
export LATEST_RELEASE=`curl https://api.github.com/repos/jfrog/jfrog-cli/releases/latest -s | jq .name -r | cut -c 2-`
echo "LATEST_RELEASE=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
shell: bash

- name: Test install npm - v2
working-directory: build/npm/v2
run: |
npm version ${{ steps.latest-release.outputs.LATEST_RELEASE }} --allow-same-version
npm install
./bin/jfrog${{ matrix.suite.osSuffix }} --version
- name: Test install npm - v2-jf
working-directory: build/npm/v2-jf
run: |
npm version ${{ steps.latest-release.outputs.LATEST_RELEASE }} --allow-same-version
npm install
./bin/jf${{ matrix.suite.osSuffix }} --version
6 changes: 4 additions & 2 deletions .github/workflows/xrayTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run Xray tests

- name: Run Xray tests (without Docker Scan)
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.xray --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }}
if: ${{ matrix.os != 'ubuntu' }}
- name: Run Docker scan and Xray tests

- name: Run Xray tests (with Docker Scan, only on Ubuntu)
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.xray --test.dockerScan --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }}
if: ${{ matrix.os == 'ubuntu' }}
20 changes: 12 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ node("docker") {
repo = 'jfrog-cli'
sh 'rm -rf temp'
sh 'mkdir temp'
def goRoot = tool 'go-1.20.5'
def goRoot = tool 'go-1.20.10'
env.GOROOT="$goRoot"
env.PATH+=":${goRoot}/bin"
env.GO111MODULE="on"
Expand Down Expand Up @@ -395,18 +395,22 @@ def distributeToReleases(stage, version, rbcSpecName) {
}

def publishNpmPackage(jfrogCliRepoDir) {
dir('/tmp') {
sh '''#!/bin/bash
apt update
apt install wget -y
echo "Downloading npm..."
wget https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz
tar -xvf node-v8.17.0-linux-x64.tar.xz
'''
}
dir(jfrogCliRepoDir+"build/npm/$identifier") {
withCredentials([string(credentialsId: 'npm-authorization', variable: 'NPM_AUTH_TOKEN')]) {
sh '''#!/bin/bash
apt update
apt install wget -y
echo "Downloading npm..."
wget https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz
tar -xvf node-v8.11.1-linux-x64.tar.xz
export PATH=$PATH:$PWD/node-v8.11.1-linux-x64/bin/
export PATH=/tmp/node-v8.17.0-linux-x64/bin:$PATH
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > .npmrc
echo "registry=https://registry.npmjs.org" >> .npmrc
./node-v8.11.1-linux-x64/bin/npm publish
npm publish
'''
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![Scanned by Frogbot](https://raw.github.com/jfrog/frogbot/master/images/frogbot-badge.svg)](https://github.com/jfrog/frogbot#readme)
[![Go Report Card](https://goreportcard.com/badge/github.com/jfrog/jfrog-cli)](https://goreportcard.com/report/github.com/jfrog/jfrog-cli)
[![license](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat)](https://raw.githubusercontent.com/jfrog/jfrog-cli/v2/LICENSE) [![](https://img.shields.io/badge/Docs-%F0%9F%93%96-blue)](https://www.jfrog.com/confluence/display/CLI/JFrog+CLI)
[![license](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat)](https://raw.githubusercontent.com/jfrog/jfrog-cli/v2/LICENSE) [![](https://img.shields.io/badge/Docs-%F0%9F%93%96-blue)](https://docs.jfrog-applications.jfrog.io/jfrog-applications/jfrog-cli)
[![Go version](https://img.shields.io/github/go-mod/go-version/jfrog/jfrog-cli)](https://tip.golang.org/doc/go1.20)

</div>
Expand Down
Loading

0 comments on commit 792ae8d

Please sign in to comment.