Register variant sandbox while performing build - mks

How do we register variant sandbox while performing the build?
While running the below cmd we are getting error:
si resync --noconfirm -f -R --sandbox=/builds/wcbd/sandbox18/eCommerce/workspace/WCBD/project.pj --hostname=ryew3mks1.na.avonet.net --port=7001
*** MKS125216: The sandbox file /builds/wcbd/sandbox18/eCommerce/workspace/WCBD/project.pj is not registered with the system.
si createsandbox -R --hostname=ryew3mks1.na.avonet.net --port=7001 --devpath
=SMT_DEVPATH_03MAR2015_REL_2.0
The above script doesn't give any response.
Thanks in advance!

resync command is used to re synchronize the code in already created sandbox. so better create a new sandbox every time you build your code.
Syntax to create sandbox:
si createsandbox -R -Y --user=replaceusernametoconnecttorepo --password="password" --hostname=givehostname --port=enterport --project="projectpath" "SANDBOXNAME OR Foldername"

Related

Create Build in Jenkins by using command line with ssh

I hope you're doing well,
I'm traying to automate a Jenkins process using a bash script in Linux, in which I need to create a build, then with created build I need to create a build using the option "Build with parameters" and use a specific build to create it.
First I'm creating the build with a similar command (it is corking fine it created the build successfully):
ssh -l MyUser -p JENK_PORT JENK_SERver build job-build -s –v
it creates the build number 10 then I need to use this build to create another one for the job job-deploy, something like:
ssh -l MyUser -p JENK_PORT JENK_SERver build job-deploy -p COPY_PROMOTION_LEVEL=1 -p BUILD_SELECTOR="\<SpecificBuildSelector plugin=\"copyartifact#1.37\"\> \<buildNumber\>10 \</buildNumber\>\</SpecificBuildSelector\>" -s -v
when I ran it, I'm getting this error:
ERROR: Too many arguments: plugin=copyartifact#1.37>
If I change the "space" for &nbsp/&#032 or adding a back slash between SpecificBuildSelector and plugin=copyartifact#1.37, I got this error:
ERROR: Unexpected exception occurred while performing build command.
com.thoughtworks.xstream.io.StreamException: : only whitespace
content allowed before start tag and not \ (position: START_DOCUMENT
seen ... #1:1)
Do you know how can I do it??, create the build for an specific build in the command line by passing the build parameters with -p option?
Thanks in advance.

Strange Behavior with clamd scan function

I have a simple python3 script running on ubuntu server 20.04 that tries to call clamd (clamav-daemon process) library to scan a file. The scan ping() and version() function all work correctly. However when I actually do a test write and scan, i get the following error:
{'/filedrop/test.doc': ('ERROR', "Can't open file or directory")}
This is the code that I used to call the test write and scan, and this is all standard sample from the clamd website:
open('/filedrop/test.doc','wb').write(clamd.EICAR)
print(cd.scan('/filedrop/test.doc'))
After the code is run, i get the following string in the test file which indicates that the python3 script was able to successfully write to the file, yet i keep getting the error that the file can't be opened when i use the clamd scan function.
This is the string that was written to the file:
X5O!P%#AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
I am also able to run clamscan from command line on the folder and it successfully scans the files as well.
I'm running as root user while the service is using clamav:clamav.
I did give read/write permission to the folder and the files to "other users", and also indicated by the fact that the file could be written by the python script.
I believe the solution to the problem here is that AppArmour is blocking clamd for that particular directory. I would look at the AppArmour profile for clamd. It should be called something like /etc/apparmor.d/clamav or similar. You can adjust that profile or alternatively disable it (according to Ubuntu):
sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/profile.name
More complete instructions available here:
https://help.ubuntu.com/community/AppArmor
You can also disable AppArmour, for the purposes of testing (I don't like to advise anyone to remove security features permanently), with:
sudo systemctl stop apparmor
sudo systemctl disable apparmor

SAP Hybris B2c 1905 Sample yacceleratorstorefront url not opening

We are looking to setup Build and Deployment pipeline for SAP Hybris B2c . We are able to build and deploy but we are not able to test the URL -> https://localhost:9002/yacceleratorstorefront .
Is there any other sample development code that we could use and test the deployment.
You could also use site parameter approach.
http://localhost:9001/yacceleratorstorefront?site=apparel-uk&clear=true
http://localhost:9001/yacceleratorstorefront?site=apparel-de&clear=true
http://localhost:9001/yacceleratorstorefront?site=electronics&clear=true
http://localhost:9001/yacceleratorstorefront?site=powertools&clear=true
Execute the following command to install and initialize the b2c accelerator
In windows:
Your_hybris_installation_directory\installer\>install.bat -r b2c_acc_plus -A local_property:initialpassword.admin=nimda && install.bat -r b2c_acc_plus initialize -A local_property:initialpassword.admin=nimda
In Linux:
Your_hybris_installation_directory/installer]./install.sh -r b2c_acc_plus -A local_property:initialpassword.admin=nimda && ./install.sh -r b2c_acc_plus initialize -A local_property:initialpassword.admin=nimda
Make the following entry in your hosts file:
127.0.0.1 apparel-uk.local apparel-de.local electronics.local
Start the hybris server in any of the two ways:
In windows:
Your_hybris_installation_directory\installer\>install.bat -r b2c_acc_plus start
or
Your_hybris_installation_directory\hybris\bin\platform\>hybrisserver.bat
In Linux:
Your_hybris_installation_directory/installer]./install.sh -r b2c_acc_plus start
or
Your_hybris_installation_directory/hybris/bin/platform]./hybrisserver.sh
Once your hybris server is running, you can access any of the following URLs:
http://electronics.local:9001/yacceleratorstorefront/
http://apparel-uk.local:9001/yacceleratorstorefront/
http://apparel-de.local:9001/yacceleratorstorefront/

Azure batch job start tasks failed

I'm using Azure batch python API. When I'm creating a new job, I see exit code 128 (image attached). How can I know what is the reason for that?
I'm creating a new job using this code :
def wrap_commands_in_shell(commands):
return "/bin/bash -c 'set -e; set -o pipefail; {}; wait'".format(';'.join(commands))
job_tasks = ['cd /mnt/batch/tasks/shared/ && git clone https://github.com/cryptobiu/OSPSI.git',
'cd /mnt/batch/tasks/shared/OSPSI && git checkout cloud',
'cd /mnt/batch/tasks/shared/OSPSI && cmake CMake',
'cd /mnt/batch/tasks/shared/OSPSI && mkdir -p assets'
]
job_creation_information = batch.models.JobAddParameter(job_id, batch.models.PoolInformation(pool_id=pool_id),
job_preparation_task=batch.models.JobPreparationTask(
command_line=wrap_commands_in_shell(
job_tasks),
run_elevated=True,
wait_for_success=True
)
)
To diagnose, you can look at the stderr.txt and stdout.txt for the Job Preparation task that has failed in the Azure Portal, using Azure Batch Explorer, or using an SDK via code. If you look at which node ran the job prep task, navigate to that node, then the job directory. Under the job directory, you should see a jobpreparation directory. In that directory will have the stderr.txt and stdout.txt.
With regard to the exit code, there are a few potential problems that could cause this:
Did you install git, cmake and any other dependencies as part of a start task?
I get a 404 when I try to navigate to: https://github.com/cryptobiu/OSPSI. Does this repo exist? If it's a private repository, are you providing the correct credentials?
A few notes about your job_tasks array:
You should not hardcode the paths /mnt/batch/tasks/shared. This path to the "shared" directory may not be the same between Linux distributions. You should use the environment variable $AZ_BATCH_NODE_SHARED_DIR instead. You can view a full list of Azure Batch pre-filled environment variables here.
You do not need to cd into the directory for each command, you only need to do it once. You can rewrite job_tasks as:
['cd $AZ_BATCH_NODE_SHARED_DIR',
'TODO: INSERT YOUR COMMANDS TO SETUP AUTH WITH GITHUB FOR PRIVATE REPO',
'git clone https://github.com/cryptobiu/OSPSI.git',
'cd OSPSI',
'cmake CMake',
'mkdir -p assets']

Switching the update channel on Firefox Flame fails

I tried to follow the steps to change the update channel described here: Switch to nightly update channel. But the phone won't reboot after executing change_channel.sh because the scripts fails with
$ ./change_channel.sh -v aurora
adbd is already running as root
remount succeeded
cannot stat '/tmp/channel-prefs/updates.js': No such file or directory
Currently I have B2G 21.0.0.0-prerelease installed from here.
I you open the script and read the line 57, there is
cat >$TMP_DIR/updates.js <<UPDATES
If it fails to create the file in that directory, he won't be able to push it when doing adb push:
$ADB push $TMP_DIR/updates.js $B2G_PREF_DIR/updates.js
So check your permissions or change the temp directory to let your script create the updates.js file,
TMP_DIR=/tmp/channel-prefs

Resources