I have a project with serenity and selenium where the chromedriver inside of the java's project folder, so only when I run for the first time it I have to run the command: "chmod +x chromedriver" inside of that folder, then for the rest of the executions it's not necessary to run the command again
For jenkins I recently install it, by according to this https://www.jenkins.io/download/lts/macos/, running "brew install jenkins-lts" and I created a pipeline job, but when I run it, I suppose that jenkins it's pulling the project from github to his local workspace but when it's time to run the test, it gave this message:
"The driver is not executable: /src/test/resources/driver/chromedriver"
So how can I run the chmod command if for each project that i have the chromedriver is inside of his folder respectivally
Related
I'm using Jenkins to run the CI. I'm using the docker image mingc/android-build-box to run a fastlane lane (dokka) in a container.
If I follow the guidelines suggested here and I run:
docker run --rm -v `pwd`:/project mingc/android-build-box bash -c 'cd /project; bundle exec fastlane dokka'
the operation succeeds but all the generated files are owned by root. This breaks the CI because I can't delete them when they are not necessary anynmore.
I tried to pass the CI user:
docker run --rm --user $(id -u):$(id -g) -v `pwd`:/project mingc/android-build-box bash -c "cd /project; bundle install --deployment; bundle exec fastlane dokka"
I get the error:
/ is not writable.
Bundler will use `/tmp/bundler20200511-6-m21qkb6' as your home directory temporarily.
bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
Bundler::GemNotFound: Could not find aws-eventstream-1.1.0 in any of the sources
So I tried to call bundle install --deployment before bundle exec and now I get the error:
fileutils.rb:232:in `mkdir': [!] Permission denied # dir_s_mkdir - /.fastlane (Errno::EACCES)
I googled the error and I've found many reports but none of them contains a useful answer and anyway, this wouldn't be ideal because the docker image already has the fastlane gem installed and it would be good to be able to use it without having to reinstall it.
Another solution would be to let the container run with root as user and then delete the files after having used them. This solution is not ideal either because I would have to remember to delete every file created but the container.
If you're running this in Jenkins, its standard Docker support handles the mounts, permissions, etc. for you. In scripted pipeline code, it should be enough to do
docker.inside('mingc/android-build-box') {
sh 'bundle exec fastlane dokka'
}
Jenkins will mount the WORKDIR into the container (on an identical path), run as the same user ID, keep the same working directory, and so on. You can see in its logs the (rather long) docker run command it uses.
I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server.
Here is the script I am running through slather
slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home/workspace/TestApp/TestApp.xcodeproj
Here is the PATH variable I am setting while executing this shell
$PATH:/Users/Shared/Jenkins/.gem/ruby/2.4.0/bin
Finally fixed this issue by running the following shell command using Jenkins.
$Home/.rvm/gems/ruby-2.4.1/wrappers/slather
Earlier, I was referring to
$Home/.rvm/gems/ruby-2.4.1/bin/slather
and the bin does not have ruby environment support when executed via shell script.
I have set up CI for Angular2 projects in the past which use npm commands, however I recently started using Angular-CLI which uses 'ng' commands instead.
When I try to set up CI for my project in Visual Studio Online I can't find a way to execute 'ng' commands.
I have tried running NPM command (using npm task from the catalog) to install the CLI; npm install -g angular-cli, after that I run npm install. Now to run 'ng build' I have tried to run in using command line tool (since there doesn't appear to be a tool to allow me to run ng commands), however that fails saying that ng is not a recognised command.
Any suggestions on setting up CI for an Angular-CLI project using VSO?
Thanks
If you want your build definition to run on any build agent (the Hosted one and any on premise agent), you could relying on local installation of angular-cli with npm, without the -g flag:
>npm install angular-cli
By default npm will install 'ng' under .\node_modules\.bin\
Your build definition could use the 'npm install' task to install locally 'ng', then you can invoke it by 'Command Line' task because you know the path to it (e.g. $(Build.SourcesDirectory)\node_modules\.bin).
Example of a build definition creating a new project and building it using 'ng':
install locally the 'ng' cli tool:
create the project 'helloworldproject':
build the project 'helloworldproject':
==Update (programmatically retrieve the actual binary path with 'npm bin')==
To remove the assumption where the binaries are placed and have a more resilient build definition, you could retrieve programmatically the actual binary path used by npm using the command:
>npm bin
The following example (this time a short PowerShell script) shows how to create the 'helloworldproject' and build it thereafter:
Remember:
to disable the option 'Fail on Standard Error' on the PowerShell task, as the ng tools likes to write stuff there even when it succeeds.
of course you still need the 'npm install' task as shown above before using the 'ng' tool.
I am currently going through the same thing so feel you pain.
You will probably have to create your own build server either as a VM on azure or on premise. The reason for this is that angular-cli isn't one of the capabilities of the hosted build server at present.
When you do create your own, you are still going to run into some hurdles. When you install angular-cli globally it still puts it under an AppData folder for the user that you install it with. If you have setup your agent to run as a different user for example NetworkService then for that service account "ng" wont be in the path. It will likely also not have permissions to run it because angular-cli has been installed under a user's folder for which it won't have permission.
Ok, so you run the agent with the same user or you resolve the permission and path issue you may still run into problems. If you use a powershell script task as one of your build tasks to perform "ng build" you will then run into the issue that I have highlighted here:
https://github.com/angular/angular-cli/issues/3979
So looks like we may have to resort to a command line build task instead.
Hope this helps. The last two days I have spent on this may as well help someone else.
Regarding Angular2-CLI command line, it uses ng2 instead of ng. (Angular-CLI uses ng), so your command is incorrect.
Refer to these steps to verify ng2 command (works on Hosted agent):
Add NPM build step (npm command: install; arguments: angular2-cli -g)
Add Command Line step (Tool: ng2; Arguments: --version)
If you are using on premise build agent with network service, using these steps instead:
NPM build step (npm command: install; Arguments: angular2-cli -g)
Command Line step (Tool: C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\ng2.cmd; Argumetns: --version)
For on premise build agent with user account, you can log on that machine and install Angular2-CLI command line (do not need to install it during the build).
I'm improving the continuos integration of a project. And we decided to take an extra step and start using cocoapods. All the rvm installation is legacy and indeed I have a lot of troubles installing ruby 2.2.0. The thing is that, when I test my build script using terminal it works fine, but when I try to run them without opening a terminal window (called from applescript, jenkins or another ruby script). The command is not found.
Already tried adding the path to .rvm/scripts to the PATH variable in both .bashrc and .bash_profile
Have you try to reconnect the server after you installed the cocoapods? sometimes it doesn't see the new vars till it disconnected and reconnected.
Also make suer that the vars that you see through the terminal are available for jenkins user. you can check that through the slave "Script Console"
If it still don't work, try to set the path in the "execute shell", just before you run the pod install.
This is how it works for me:
echo "Running pod install"
cd ${WORKSPACE}
export LANG=en_US.UTF-8
pod install
I have a Maven project that requires a bash script to be run before running "mvn clean install". When I use the terminal (I am on a Mac) I can easily run the script first and then do "mvn clean install". However, that is not the case when I try to build the project in IDEA. I created a Maven configuration that runs clean and install, but I need to tell IDEA to run the bash script before doing Maven stuff.
Anybody knows how to do this?
Create an external tool to run bash with your script as a parameter. In the Maven Run configuration, Before launch section add this tool via the Run External Tool option.