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

Merge from dev to v2 #2338

Merged
merged 11 commits into from
Nov 30, 2023
Merged
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
5 changes: 1 addition & 4 deletions .github/workflows/pythonTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: [ pip, pipenv, poetry ]
suite: [ pip, pipenv ]
os: [ ubuntu, windows, macos ]
runs-on: ${{ matrix.os }}-latest
steps:
Expand All @@ -35,9 +35,6 @@ jobs:
- name: Setup Pipenv
if: ${{ matrix.suite == 'pipenv' }}
run: python -m pip install pipenv
- name: Setup Poetry
if: ${{ matrix.suite == 'poetry' }}
run: python -m pip install poetry
- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scriptTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- 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-`
export LATEST_RELEASE=`curl https://api.github.com/repos/jfrog/jfrog-cli/releases/latest -s --retry 10 | jq .name -r | cut -c 2-`
echo "LATEST_RELEASE=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
shell: bash

Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ The available test types are:
| `-test.go` | Go tests |
| `-test.pip` | Pip tests |
| `-test.pipenv` | Pipenv tests |
| `-test.poetry` | Poetry tests |
| `-test.nuget` | Nuget tests |
| `-test.plugins` | Plugins tests |
| `-test.distribution` | Distribution tests |
Expand Down
34 changes: 34 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ node("docker") {
}
}

state('synchronize branches') {
if ("$EXECUTION_MODE".toString().equals("Build CLI")) {
masterBranch = 'v2'
devBranch = 'dev'
if (BRANCH?.trim() == 'v1') {
masterBranch = 'v1'
devBranch = 'dev-v1'
}
synchronizeBranches(masterBranch, devBranch)
}
}

stage('install npm') {
installNpm(nodeVersion)
}
Expand Down Expand Up @@ -148,6 +160,28 @@ def runRelease(architectures) {
}
}

def synchronizeBranches(masterBranch, devBranch) {
dir("$cliWorkspace/$repo") {
releaseTag = "v$RELEASE_VERSION"
withCredentials([string(credentialsId: 'ecosystem-github-automation', variable: 'GITHUB_ACCESS_TOKEN')]) {
stage("Merge to $masterBranch") {
sh """#!/bin/bash
git merge origin/$devBranch --no-edit
git push "https://[email protected]/jfrog/jfrog-cli.git"
"""
}
stage("Merge to $devBranch") {
sh """#!/bin/bash
git checkout $devBranch
git merge origin/$masterBranch --no-edit
git push "https://[email protected]/jfrog/jfrog-cli.git"
git checkout $masterBranch
"""
}
}
}
}

def createTag() {
stage('Create a tag and a GitHub release') {
dir("$jfrogCliRepoDir") {
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.51.1",
"version": "2.52.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.51.1",
"version": "2.52.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
24 changes: 23 additions & 1 deletion distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func TestUpdateBundleProps(t *testing.T) {
cleanDistributionTest(t)
}

func TestBundlePathMapping(t *testing.T) {
func TestBundlePathMappingFromPatternAndTarget(t *testing.T) {
initDistributionTest(t)

// Upload files
Expand All @@ -465,6 +465,28 @@ func TestBundlePathMapping(t *testing.T) {
cleanDistributionTest(t)
}

func TestBundlePathMappingFromPatternAndTargetUsingSpec(t *testing.T) {
initDistributionTest(t)

// Upload files
specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB)
assert.NoError(t, err)
runRt(t, "u", "--spec="+specFile)

// Create and distribute release bundle with path mapping from <DistRepo1>/data/ to <DistRepo2>/target/
spec, err := tests.CreateSpec(tests.DistributionCreateWithPatternAndTarget)
assert.NoError(t, err)
runDs(t, "rbc", tests.BundleName, bundleVersion, "--sign", "--spec="+spec)
runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync")

// Validate files are distributed to the target mapping
spec, err = tests.CreateSpec(tests.DistributionMappingDownload)
assert.NoError(t, err)
inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t)

cleanDistributionTest(t)
}

func TestBundlePathMappingUsingSpec(t *testing.T) {
initDistributionTest(t)

Expand Down
Loading
Loading