Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into add_zeroday_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Sep 18, 2023
2 parents c3fdc61 + 415d3dc commit 0a9c16b
Show file tree
Hide file tree
Showing 24 changed files with 194 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/addReleaseLinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
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/releaseLinkTemplate.md > ./temp_releaseLinkTemplate.md
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
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: ""

1 change: 1 addition & 0 deletions .github/workflows/frogbot-scan-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,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
4 changes: 2 additions & 2 deletions access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestRefreshableAccessTokens(t *testing.T) {
assert.NotEmpty(t, curRefreshToken)

// Make the token always refresh.
auth.InviteRefreshBeforeExpiryMinutes = 365 * 24 * 60
auth.RefreshPlatformTokenBeforeExpiryMinutes = 365 * 24 * 60

// Upload a file and assert tokens were refreshed.
uploadedFiles++
Expand All @@ -90,7 +90,7 @@ func TestRefreshableAccessTokens(t *testing.T) {
}

// Make the token not refresh. Verify Tokens did not refresh.
auth.InviteRefreshBeforeExpiryMinutes = 0
auth.RefreshPlatformTokenBeforeExpiryMinutes = 0
uploadedFiles++
err = uploadWithSpecificServerAndVerify(t, artifactoryCommandExecutor, "testdata/a/b/b2.in", uploadedFiles)
if !assert.NoError(t, err) {
Expand Down
4 changes: 2 additions & 2 deletions artifactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5268,7 +5268,7 @@ func TestRefreshableArtifactoryTokens(t *testing.T) {
assert.NotEmpty(t, curRefreshToken)

// Make the token always refresh.
auth.RefreshBeforeExpiryMinutes = 60
auth.RefreshArtifactoryTokenBeforeExpiryMinutes = 60

// Upload a file and assert tokens were refreshed.
uploadedFiles++
Expand Down Expand Up @@ -5312,7 +5312,7 @@ func TestRefreshableArtifactoryTokens(t *testing.T) {
}

// Make the token not refresh. Verify Tokens did not refresh.
auth.RefreshBeforeExpiryMinutes = 0
auth.RefreshArtifactoryTokenBeforeExpiryMinutes = 0
uploadedFiles++
err = uploadWithSpecificServerAndVerify(t, artifactoryCommandExecutor, "testdata/a/b/b2.in", uploadedFiles)
if err != nil {
Expand Down
7 changes: 3 additions & 4 deletions build/getcli/jf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

CLI_OS="na"
CLI_UNAME="na"
CLI_MAJOR_VER="v2-jf"
VERSION="[RELEASE]"

Expand All @@ -13,11 +12,11 @@ else
echo "Downloading the latest version of JFrog CLI..."
fi

if $(echo "${OSTYPE}" | grep -q msys); then
if echo "${OSTYPE}" | grep -q msys; then
CLI_OS="windows"
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe"
FILE_NAME="jf.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
elif echo "${OSTYPE}" | grep -q darwin; then
CLI_OS="mac"
if [[ $(uname -m) == 'arm64' ]]; then
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf"
Expand Down Expand Up @@ -52,7 +51,7 @@ else
;;
*)
echo "Unknown machine type: $MACHINE_TYPE"
exit -1
exit 1
;;
esac
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf"
Expand Down
7 changes: 3 additions & 4 deletions build/getcli/jfrog.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

CLI_OS="na"
CLI_UNAME="na"
CLI_MAJOR_VER="v2"
VERSION="[RELEASE]"

Expand All @@ -13,11 +12,11 @@ else
echo "Downloading the latest version of JFrog CLI..."
fi

if $(echo "${OSTYPE}" | grep -q msys); then
if echo "${OSTYPE}" | grep -q msys; then
CLI_OS="windows"
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe"
FILE_NAME="jfrog.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
elif echo "${OSTYPE}" | grep -q darwin; then
CLI_OS="mac"
if [[ $(uname -m) == 'arm64' ]]; then
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog"
Expand Down Expand Up @@ -52,7 +51,7 @@ else
;;
*)
echo "Unknown machine type: $MACHINE_TYPE"
exit -1
exit 1
;;
esac
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog"
Expand Down
7 changes: 3 additions & 4 deletions build/installcli/jf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

CLI_OS="na"
CLI_UNAME="na"
CLI_MAJOR_VER="v2-jf"
VERSION="[RELEASE]"
# Order is by destination priority.
Expand All @@ -16,11 +15,11 @@ else
fi
echo ""

if $(echo "${OSTYPE}" | grep -q msys); then
if echo "${OSTYPE}" | grep -q msys; then
CLI_OS="windows"
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe"
FILE_NAME="jf.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
elif echo "${OSTYPE}" | grep -q darwin; then
CLI_OS="mac"
if [[ $(uname -m) == 'arm64' ]]; then
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf"
Expand Down Expand Up @@ -55,7 +54,7 @@ else
;;
*)
echo "Unknown machine type: $MACHINE_TYPE"
exit -1
exit 1
;;
esac
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf"
Expand Down
7 changes: 3 additions & 4 deletions build/installcli/jfrog.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

CLI_OS="na"
CLI_UNAME="na"
CLI_MAJOR_VER="v2"
VERSION="[RELEASE]"
# Order is by destination priority.
Expand All @@ -16,11 +15,11 @@ else
fi
echo ""

if $(echo "${OSTYPE}" | grep -q msys); then
if echo "${OSTYPE}" | grep -q msys; then
CLI_OS="windows"
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe"
FILE_NAME="jfrog.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
elif echo "${OSTYPE}" | grep -q darwin; then
CLI_OS="mac"
if [[ $(uname -m) == 'arm64' ]]; then
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog"
Expand Down Expand Up @@ -55,7 +54,7 @@ else
;;
*)
echo "Unknown machine type: $MACHINE_TYPE"
exit -1
exit 1
;;
esac
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog"
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.46.3",
"version": "2.48.0",
"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.46.3",
"version": "2.48.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
7 changes: 3 additions & 4 deletions build/setupcli/jf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

CLI_OS="na"
CLI_UNAME="na"
CLI_MAJOR_VER="v2-jf"
VERSION="[RELEASE]"
# Order is by destination priority.
Expand All @@ -20,11 +19,11 @@ then
fi

echo "Downloading the latest version of JFrog CLI..."
if $(echo "${OSTYPE}" | grep -q msys); then
if echo "${OSTYPE}" | grep -q msys; then
CLI_OS="windows"
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe"
FILE_NAME="jf.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
elif echo "${OSTYPE}" | grep -q darwin; then
CLI_OS="mac"
if [[ $(uname -m) == 'arm64' ]]; then
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf"
Expand Down Expand Up @@ -59,7 +58,7 @@ else
;;
*)
echo "Unknown machine type: $MACHINE_TYPE"
exit -1
exit 1
;;
esac
URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf"
Expand Down
66 changes: 66 additions & 0 deletions documentation/CLI-for-JFrog-Lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,69 @@ Use signing key pair "myKeyPair" and overwrite in case of conflicts.
```
jf rbp --signing-key=myKeyPair --project=project0 --overwrite=true --sync=true myApp 1.0.0 PROD
```
### Distributing a release bundle
This command distributes a Release Bundle v2 to an edge node.
| | |
|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Command-name | release-bundle-distribute |
| Abbreviation | rbd |
| Command options | |
| --create-repo | \[Default: false\]<br><br>Set to true to create the repository on the edge if it does not exist. |
| --dry-run | \[Default: false\]<br><br>Set to true to disable communication with JFrog Distribution. |
| --dist-rules | \[Optional\]<br><br>Path to a file, which includes the Distribution Rules in a JSON format. See [structure](#distribution-rules-structure) bellow. |
| --site | \[Default: *\]<br><br>Wildcard filter for site name. |
| --city | \[Default: *\]<br><br>Wildcard filter for site city name. |
| --country-codes | \[Default: *\]<br><br>Semicolon-separated list of wildcard filters for site country codes. |
| --insecure-tls | \[Default: false\]<br><br>Set to true to skip TLS certificates verification. |
| --mapping-pattern | \[Optional\]<br><br>Specify along with 'mapping-target' to distribute artifacts to a different path on the edge node. You can use wildcards to specify multiple artifacts. |
| --mapping-target | \[Optional\]<br><br>The target path for distributed artifacts on the edge node. If not specified, the artifacts will have the same path and name on the edge node, as on the source Artifactory server. For flexibility in specifying the distribution path, you can include [placeholders](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UsingPlaceholders) in the form of {1}, {2} which are replaced by corresponding tokens in the pattern path that are enclosed in parenthesis. |
| Command arguments | |
| release bundle name | Name of the Release Bundle to distribute. |
| release bundle version | Version of the Release Bundle to distribute. |
#### Distribution Rules Structure:
```json
{
"distribution_rules": [
{
"site_name": "DC-1",
"city_name": "New-York",
"country_codes": ["1"]
},
{
"site_name": "DC-2",
"city_name": "Tel-Aviv",
"country_codes": ["972"]
}
]
}
```
The Distribution Rules format also supports wildcards. For example:
```json
{
"distribution_rules": [
{
"site_name": "",
"city_name": "",
"country_codes": ["*"]
}
]
}
```

#### Examples

#### Example 1
Distribute the Release Bundle v2 named myApp with version 1.0.0. Use the distribution rules defined in the specified file.

jf rbd --dist-rules=/path/to/dist-rules.json myApp 1.0.0

#### Example 2

Distribute the Release Bundle v2 named myApp with version 1.0.0 using the default distribution rules.
Map files under the 'source' directory to be placed under the 'target' directory.

jf rbd --dist-rules=/path/to/dist-rules.json --mapping-pattern="(*)/source/(*)" --mapping-target="{1}/target/{2}" myApp 1.0.0
Loading

0 comments on commit 0a9c16b

Please sign in to comment.