Installing CloudBees SDK and running bees command first time - errors downloading plugins - cloudbees

I have installed the cloudbees SDK and am now running the bees command the first time..
I see this:
Installing plugin: org.cloudbees.sdk.plugins:ant-plugin:LATEST
You have not created a CloudBees configuration profile, let's create one now...
Enter your CloudBees account email address: XXX
Enter your CloudBees account password:
ERROR: Failed to install org.cloudbees.sdk.plugins:ant-plugin:LATEST
And thus, an unable to use it

In most cases if you just run the bees command again, it will download the plugins again (plugins are only fetched the first time they are needed). If you are on a VPN this can cause some temporary issues as well.
You can also add the -v flag to get more verbose messages from the command line.

Related

AppCenter Yarn 1.19 error Incorrect integrity when fetching from the cache

I have a React Native app hosted on Microsoft App center. The builds (both iOS and android) are failing because of yarn 1.19 (error Incorrect integrity when fetching from the cache)
I tried to remove the package-lock.json but it didn't help.
I would like to downgrade yarn or execute the cache clean command but don't know where to execute it.
I have installed the appcenter cli version 2.2.1 and successfully connected to it.
Where could I execute yarn cache clean for example?
I've read I could also create a script but I have no idea where to place it and how it should look like. Should it be both in the ios and android directory? Or in the root? Thank you
I actually noticed that I had a yarn.lock back from the initial commit, even though we are using npm in the team.
In the build logs, there is this line:
/bin/sh -c if [ -f yarn.lock ]; then { yarn install && yarn list --depth=0; } else npm install; fi
So I deleted the yarn.lock file and now it builds successfully using npm!
Not sure whether you build your React app with Azure Devops pipeline. If yes, you can use Command line task to achieve the things you want to do.
If the agent you used is hosted agent during the build, since each build will use a completely new VM, you need to install the AppCenter cli once per build.
Use follow command to install the AppCenter cli:
sudo npm install -g appcenter-cli
Then logging in it:
appcenter login --token {Token}
Here, you need first generate the token with this doc described: Go and login to https://appcenter.ms/ -> Click Self Avatar -> Choose Account Settings -> Click on API Tokens -> Click New API token then select the corresponding the scope for this token.
Copy and use it in this pipeline task. Note: Recommend you store
this token with secret variable for security.
Now, you can execute the clean command: yarn cache clean.
Where to place it and how it should look like?
According to your description, you need place this command line task into the first step, then it could clean the Yarn cache firstly.
Also, because of the image configuration that the hosted agent is using, its installed node.js version is 6.7.0, this does not match the runtime environment for AppCenter cli. You need also run Node.js tool installer task to install node.js v10.0.0.
All of them should look like this:
Should it be both in the ios and android directory?
As I mentioned previously, for Hosted agent, each build will use a completely new VM. So yes, you must execute these two steps firstly in every build.
If what you used is your private agent, since you have installed the AppCenter cli locally, the agent will automatically call the local configuration when running the command line task. At this time, you just need to skip the install command in the command task:
We fixed it by adding a "yarn cache clean" in appcenter-post-clone.sh, you can add this shell script in root of project.
See this docs for details.

Vagrantfile for phpBB giving error about missing laravel homestead file

The phpBB Vagrant.md document doesn't tell you what to do to get started beyond downloading/cloning the Git repo to your local machine, then running vagrant up to start the VM. However, I am currently greeted with the following error when attempting to start up the VM.
λ vagrant up
Vagrant failed to initialize at a very early stage:
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
Path: C:/Users/Phillip/Desktop/phpbb/Vagrantfile
Line number: 0
Message: LoadError: cannot load such file -- C:/Users/Phillip/Desktop/phpbb/phpBB/vendor/laravel/homestead/scripts/homestead.rb
I am on Windows 10, have Ruby 2.5.1 installed, and Vagrant which all work currently. However, that directory in the project is currently missing. Do I need that file to get this all working, or should I just create my own Vagrantfile using the INSTALL.html docs and go that route?
You just need to install all of the dependencies with composer.
As written in the readme (https://github.com/phpbb/phpbb/tree/master):
To be able to run an installation from the repo (and not from a pre-built package) you need to run the following commands to install phpBB's dependencies.
cd phpBB
php ../composer.phar install
If you don't have Composer for Windows, you can just download and install the exe on the official page
After this you can run vagrant up from the primary folder and it should work.

NPM Package Error- 'newman' is not recognized as an internal or external command

I have installed the latest version of Newman (3.10.0) in my 64-Bit Win 10 Machine.
C:\Users\ABC>npm install -g newman
C:\Users\ABC\AppData\Roaming\npm\newman -> C:\Users\ABC\AppData\Roaming\npm\node_modules\newman\bin\newman.js
+ newman#3.10.0
added 195 packages in 57.852s
However, I am not able to use the newman and I am getting below error while accessing.
C:\Users\ABC>newman -h
'newman' is not recognized as an internal or external command,
operable program or batch file.
I have added an environment variable for the NODE_PATH pointing to the newman directory C:\Users\ABC\AppData\Roaming\npm\node_modules\newman
but no luck. Could some one please help.
Adding in the Path variable under Environment Variable solve the problem even if we don't add in NODE_PATH
C:\Users\ yourusername \AppData\Roaming\npm
After doing this reopen command prompt
The issue was fixed after troubleshooting with the Node Application. A previous version of Node (32-bit) was installed in my machine and it was not completely removed after I did an uninstall. When I installed Node 64-Bit both entry was present in the environment variable and caused a conflict.
When I manually deleted both installation folder and the env variable the newman worked correcly.
I have installed node, vc redist and newman once (on clear windows 7 64 bit) and the issue is looks like related to wrong newman installation. Both newman and node should be installed from administrator session (not just with admin privileges). I have installed newman from regular user, system path setting are correct, but user environment was not set:
path=C:\Users\gagarin\AppData\Roaming\npm
So I have copied
C:\Users\<regular_user>\AppData\Roaming\npm
to C:\Users\admin\AppData\Roaming\npm and run C:\Users\admin\AppData\Roaming\npm\newman.cmd from administrator session. After that newman command became work in admin session. Sadly it works in regular user session only if I type full path to newman like
Blockquote
c:> C:\Users\admin\AppData\Roaming\npm\newman run ....
I was also getting the same error and I have followed the below steps to troubleshoot it-
1. Know what user is running jenkins, a simple way is Create a jenkins job and in its Build section run the command
whoami
2. If it shows System user, then do the following-
2.a. Set C:\Users\I823285\AppData\Roaming\npm and C:\Users\I823285\AppData\Roaming\npm\node_modules\newman\bin in SYSTEM ENV. VARIABLES.
b. Restart Jenkins by running CMD as ADMIN, and go to Jenkins installation folder, then enter jenkins.exe restart.
c. Re-build the project
SUCCESSFUL!

NPM not available when running installation script

I have an interesting issue, I have a setup or rails project and the deployment/upgrades works absolutely fine when running as a dedicated user (deploy) who is used to setup everything.
I am using codeDeploy to manage the deployments and it uses root user to do the deployment on AWS, but during the deployment it fails on running the same script because it's not able to find npm command
cd client && npm run build:client
sh: 1: npm: not found
rake aborted!
Command failed with status (127): [cd client && npm run build:client...]
If i run it manually to check that i also get nothing
root#ip-172-31-4-141:/home/ubuntu# su deploy -c "which npm"
root#ip-172-31-4-141:/home/ubuntu#
NPM is available via the deploy user but I am struggling to understand why it's not available via the root user
deploy#ip-172-31-4-141:/home/ubuntu$ which npm
/home/deploy/.nvm/versions/node/v7.8.0/bin/npm
Any help to get this resolved would be great.
Thanks,
The issue here was that AWS CodeDeploy when starts deployment loads only a minimum env; to load all the env variables I have exported the env and then in the deploy phase source that file, which resolves my issue

How to change the default setting '-DskipTests=true' during Heroku deployment?

I am trying to deploy a Java project from Beanstalk using Heroku. But during the deployment process, the tests are skipped by default. I am aware that the default settings for Dskiptests is true. Is it possible to run tests using Heroku? Where do I change the settings to overwrite the default settings.
Here is how the build is started by default:
output -----> Java app detected
output -----> Installing OpenJDK 1.8... done
output -----> Executing: mvn -B -DskipTests=true clean install
Run this command:
$ heroku config:set MAVEN_CUSTOM_OPTS=""
For more information see:
https://github.com/heroku/heroku-buildpack-java#customize-maven
Mine was working perfectly with out any change, suddenly stopped. Tried bellow and worked
heroku config:set MAVEN_CUSTOM_OPTS="-DskipTests=false"
btw I tried to set empty string as the value of MAVEN_CUSTOM_OPTS did not worked.
In case you want to know current value of all variable try:
heroku run printenv
You can also configure MAVEN_CUSTOM_OPTS in the Heroku Dashboard.