Unable to download docker image layer from artifactory using JFrog CLI - artifactory

Command:
jf rt download https://myartifactory/docker/myrepo/10.21.0/sha256__dd42811e-a483-5d86-8446-fec0d46f67d8
The command outputs:
{
"status": "success",
"totals": {
"success": 0,
"failure": 0
}
}
and in the logs I only see:
[Info] Searching items to download...
Is this expected behaviour?

The download command expects arguments to be a relative path so the command should have been:
jf rt download docker/myrepo/10.21.0/sha256__dd42811e-a483-5d86-8446-fec0d46f67d8

Related

How to upload multiple seperate folders and thier contents to a single zip file to JFrog Artifactory using "jf rt upload". ( /Alpha, /Beta, /Gamma)

Given the following folder structure:"/Alpha,/Beta,/Gamma,/Delta, ..."
Using JFrog CLI how can I upload only the first two folders and thier entire contents.
Ive tried the following using a regular expression:
jf rt upload "Alpha|Beta" My-generic-local/My-rep-folder/target.zip --archive zip --dry-run --regexp
[Error]CreateFile Aplha|Beta: The filename, directory name, or volume label syntax is incorrect.
You can try File Specs for this purpose.
jf rt upload --spec=filespec.json
filespec.json:
{
"files": [
{
"pattern": "Alpha/",
"target": "My-generic-local/My-rep-folder/target.zip",
"archive": "zip"
},
{
"pattern": "Beta/",
"target": "My-generic-local/My-rep-folder/target.zip",
"archive": "zip"
}
]
}
Learn more about JFrog File Specs:
JFrog File Specs
Using File Specs in JFrog CLI

Testing Cypress with Browserstack does not work: "Malformed Archive"

I am trying to get a Cypress example test running in Browserstack. I am following this tutorial: Run your Cypress tests
However when it comes to running browserstack-cypress run im getting the following output:
[2020-12-4 17:00:12] - info: Reading config from /home/dennis/Repos/CMS/browserstack.json
[2020-12-4 17:00:12] - info: Reading username from the environment variable BROWSERSTACK_USERNAME
[2020-12-4 17:00:12] - info: Reading access key from the environment variable BROWSERSTACK_ACCESS_KEY
[2020-12-4 17:00:12] - info: browserstack.json file is validated
[2020-12-4 17:00:46] - error: Malformed archive
[2020-12-4 17:00:46] - error: Zip Upload failed.
[2020-12-4 17:00:46] - info: Zip file deleted successfully.
This is what my browserstack.json looks like:
{
"auth": {
"username": "<user name>",
"access_key": "<access key>"
},
"browsers": [
{
"browser": "chrome",
"os": "Windows 10",
"versions": [
"latest",
"latest-1"
]
}
],
"run_settings": {
"cypress_config_file": "./cypress.json",
"project_name": "<project name>",
"build_name": "",
"parallels": "10",
"npm_dependencies": {},
"package_config_options": {}
},
"connection_settings": {
"local": false,
"local_identifier": null
},
"disable_usage_reporting": false
}
The cypress.json file is empty:
{}
What I'm also not getting is where I am defining what tests I want to run and where they are located.
I appreciate any help! Thanks!
I've come across the "Malformed archive" error when the runner tries to compress the entire project and tries to upload it instead of just the Cypress Test files.
You should be able to fix this by moving the Cypress test files into a subfolder:
test
|
| cypress.json
| Browserstack.json
| cypress
|
| fixtures
| integration
| support
| plugins
Set the path to cypress.json in browserstack.json
Refer: https://www.browserstack.com/docs/automate/cypress/sample-tutorial

Permission denied on File.Copy using C# dotnet core CENTOS with samba mount

When using File.Copy,
File.Copy(file.FullName, Path.Combine(config.DestinationDir, file.Name), true);
I encountered the following issue:
"ClassName": "System.UnauthorizedAccessException",
"Message": "Access to the path is denied.",
"Data": null,
"InnerException": {
"ClassName": "System.IO.IOException",
"Message": "Operation not permitted",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": null,
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": 1,
"Source": null,
"WatsonBuckets": null
}
This looks a permission issue. However:
I have the correct permission on both source and destination folder
I can execute commands like mv/cp/touch on the destination folder without issue
This issue appears only when the destination folder is a SAMBA mnt.
I have no problem by using File.Read and File.Write (which .... should trigger the exception if it was linked to some basic permission issue)
If I run the command with SUDO, no problem.
Here is the result of ls -ld on the destination folder:
drwxrwxr-x. 2 svc_smb_share grp_smb_share 0 24 jui 14:49 DestinationFolder
My user belongs to the grp_smb_share and therefore have the read/write/execute permission.
A note about my configuration:
Server using Centos (centos-release-7-7.1908.0.el7.centos.x86_64)
dotnet core (3.1.100)
Do you have any clue ?

Jfrog artifactory cli

you I am trying to pass two ${key} values in a file spec. Is there any way I can call these two ${key} values through jfrog cli command?
E.g., I have tried the following command
sh "./jfrog rt s --spec compare.spec --spec-vars currentBuild=${currentBuild.number};previousBuild=${currentBuild.previousBuild.number}"
But it is displaying output only for one value.
The command is missing quotes surrounding the spec-vars. So for example with a spec file like
{
"files": [
{
"pattern": "${pat}/",
"target": "${tgt}/"
}
]
}
I need to run the command as
jfrog rt dl --spec otherspec --spec-vars "pat=generic-local;tgt=local"
To make sure that I download the files from the "generic-local" repository to a folder called "local"
If you execute the command with JFROG_CLI_LOG_LEVEL=DEBUG, the output will display both the spec file you provided as well as the resolved file:
$ JFROG_CLI_LOG_LEVEL=DEBUG jfrog rt dl --spec otherspec --spec-vars "pat=generic-local;tgt=local"
[Debug] Replacing variables in the provided File Spec:
{
"files": [
{
"pattern": "${pat}/",
"target": "${tgt}/"
}
]
}
[Debug] Replacing '${pat}' with 'generic-local'
[Debug] Replacing '${tgt}' with 'local'
[Debug] The reformatted File Spec is:
{
"files": [
{
"pattern": "generic-local/",
"target": "local/"
}
]
}
[Info] Searching items to download...

Nginx-passenger RVM cookbook chef

Unable to setup nginx-passenger module using chef-solo.. Phusion passenger compile issue.
cookbook 'rvm', '~> 0.9.2'
cookbook 'nginx', '~> 2.7.4'
i have gone through solutions in other similar threads,, but no success yet... any help is highly appreciated..
My Configuration
{
"name": "nginx-server",
"description": "Nginx server",
"default_attributes": {
"rvm": {
"default_ruby":"ruby-2.1.2",
"gems": {
"2.1.2": [
{"name": "bundler"},
{"name": "passenger"},
{"name": "rake"}
]
}
},
"nginx": {
"version": "1.4.1",
"dir" : "/etc/nginx",
"log_dir" : "/var/log/nginx",
"binary": "/opt/nginx-1.4.1/sbin",
"user" : "www-data",
"init_style" : "init",
"source" :{
"modules" : [
"nginx::http_stub_status_module",
"nginx::http_gzip_static_module",
"nginx::passenger"
]
},
"passenger" : {
"version": "3.0.21",
"ruby" : "/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby",
"root" : "/usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21"
}
}
},
"json_class": "Chef::Role",
"run_list": [
"rvm::system",
"rvm::gem_package",
"nginx::source",
"monit_configs-tlq::nginx"
],
"chef_type": "role",
"override_attributes": {
}
}
Error message: Phusion Passenger support files are not yet compiled. Compiling them for you
adding module in /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21/ext/nginx
*** The Phusion Passenger support files are not yet compiled. Compiling them for you... ***
*** Running 'rake nginx RELEASE=yes' in /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21/ext/nginx... ***
STDERR: /opt/chef/embedded/bin/rake:9:in `require': no such file to load -- rubygems (LoadError)
from /opt/chef/embedded/bin/rake:9
---- End output of "bash" "/tmp/chef-script20141016-27177-1eqrpme" ----
Ran "bash" "/tmp/chef-script20141016-27177-1eqrpme" returned 1
[2014-10-16T20:45:43+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
Any idea to solve this,, will be of great help... :)
Many Thanks
Dave
The problem is that you are trying to use the ruby binary from RVM but your path is still setup to use other scripts from the Chef omnibus install. The trace shows rake running the the omnibus folder but ruby from RVM. Fix the PATH environment variable used for the bash recipe or source the RVM shell config in the bash code before running rake. This will likely require forking the above cookbooks unless they have explicit support for each other.

Resources