I cant see examples of how to do this:
https://jenkins.io/doc/book/managing/plugins/
I backup a list of all plugins installed and their versions.
I want to use install-plugin command to install all plugins (and their specific versions) from the list.
I dont see option to specify version to install-plugin command
To install a specific version you can run the command and pass a parameter with a colon like this:
install-plugins.sh git:3.9.1
or alternatively add the list of plugins to a file (plugins.txt for instance):
git:3.9.1
saml:1.0.7
and run it with the following command:
install-plugins.sh plugins.txt
You can download jar file from here: https://github.com/jenkinsci/plugin-installation-manager-tool
$ rm -rf /usr/share/jenkins/plugins/ldap*
$ ls /usr/share/jenkins/plugins/ldap*
ls: cannot access '/usr/share/jenkins/plugins/ldap*': No such file or directory
$ echo $JAVA_OPTS
-Djenkins.install.runSetupWizard=false
$ java $JAVA_OPTS -jar /opt/jenkins-plugin-manager-2.12.8.jar --plugins ldap:2.7
Done
$ ls /usr/share/jenkins/plugins/ldap*
/usr/share/jenkins/plugins/ldap.jpi
$ echo "http://<jenkins-url>/restart"
http://<jenkins-url>/restart
$ ls /usr/share/jenkins/plugins/ldap*
/usr/share/jenkins/plugins/ldap.jpi
/usr/share/jenkins/plugins/ldap:
META-INF WEB-INF
$ cat /usr/share/jenkins/plugins/ldap/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: rsandell
Build-Jdk: 1.8.0_211
Extension-Name: ldap
Specification-Title: The Jenkins Plugins Parent POM Project
Implementation-Title: ldap
Implementation-Version: 2.7
Group-Id: org.jenkins-ci.plugins
Short-Name: ldap
Long-Name: LDAP Plugin
Url: https://github.com/jenkinsci/ldap-plugin
Compatible-Since-Version: 1.16
Minimum-Java-Version: 1.8
Plugin-Version: 2.7
Hudson-Version: 2.277.1
Jenkins-Version: 2.277.1
Plugin-Dependencies: mailer:1.34
Plugin-Developers:
Plugin-License-Name: The MIT license
Plugin-License-Url: https://opensource.org/licenses/MIT
Plugin-ScmUrl: https://github.com/jenkinsci/ldap-plugin
Related
I have a project A managed with pipenv that depends on another project B built with pipenv too. The project B is published in the private PYPI. My Pipfile looks like
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://${USERNAME}:${TOKEN}#MyPrivateRepoUrl"
verify_ssl = true
name = "MyRepoPYPI"
When I install A locally I have not problems and every works fine (declaring environment variables with export command). I have configured an azure-pipelines.yml with 2 jobs, first install A and testing, and the second one is to build and publish the docker image to the ACR. When I trigger the pipeline, the first job fails with this error:
FAIL
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 741, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 709, in resolve_packages
[ResolutionFailure]: requirements_dir=requirements_dir,
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 692, in resolve
[ResolutionFailure]: req_dir=requirements_dir
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1403, in resolve_deps
[ResolutionFailure]: req_dir=req_dir,
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/home/adminroot/.local/lib/python3.7/site-packages/pipenv/utils.py", line 833, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Could not find a version that matches pymooslotting (from -r /tmp/pipenvzsh1c47crequirements/pipenv-y37q7d_w-constraints.txt (line 11))
No versions found
Were https://pypi.org/simple or https://MyUsername:***#MyPrivateRepoUrl reachable?
I'm pretty sure the credentials are set correctly.
The amazing thing is that if I run the second job, the docker image is built correctly, therefore it is telling me that the credentials to install B are being passed correctly.
here is the part of the pipelines where I install A
steps:
- task: UsePythonVersion#0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: |
python -m pip install --user --upgrade pip
python -m pip install --user pipenv
displayName: Install Pipenv
- script: |
pipenv lock --clear
pipenv install --system
displayName: Install Dev Dependencies
- bash: pytest -rf
displayName: Unit test
I'm not commiting the lock file, but I have done many tests that include the lock in the repo.
Here is the command for docker Publish (that works fine and do the job)
- task: Docker#2
displayName: Build Docker Image
inputs:
command: build
containerRegistry: $(acrRepository)
repository: samples/execslotting
inputs:
tags: |
latest
$(tag)
arguments: '--build-arg USERNAME=$(MyUserName) --build-arg TOKEN=$(MyToken)'
The docker image is installing B, so in the build I pass USERNAME and TOKEN vars.
OBS: The error message No versions found Were https://pypi.org/simple or https://MyUsername:***#MyPrivateRepoUrl reachable? tells me that the envars are correctly read in the execution of the installation job.
the docs specify a different push and pull endpoint urls for pip... Try appending /pypi/simple to the repo description where you are pulling from.
full url: https://<your-feed-name>:<your-PAT-key>#pkgs.dev.azure.com/<your-organization-name>/<your-project-name>/_packaging/<your-feed-name>/pypi/simple/
I am trying to start jenkins via command prompt but getting
jenkins error on staring via cmd, using war 2.9
org.xmlpull.v1.XmlPullParserException: only 1.0 is supported as <?xml version not '1.1' (position: START_DOCUMENT seen <?xml version=\'1.1\'... #1:19)
at org.xmlpull.mxp1.MXParser.parseXmlDeclWithVersion(MXParser.java:2608)
at org.xmlpull.mxp1.MXParser.parseXmlDecl(MXParser.java:2592)
at org.xmlpull.mxp1.MXParser.parsePI(MXParser.java:2466)
at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1447)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(
You have file with invalid XML version, you can replace it using Jenkins Issue 49450 answer:
ran this command in $JENKINS_HOME:
find . -name "*.xml" -print -exec sed -i '.bak' "s/xml version='1.1'/xml version='1.0'/" {} \;
I want to use Travis-CI with my Grails 3.0.9 app. For this I created a .travis.yml file:
language: groovy
jdk:
- oraclejdk7
before_install:
- curl -s get.sdkman.io | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk install grails 3.0.9
- sdk default grails 3.0.9
script: grails test-app --stacktrace
When the Travis-CI service wants to build my application, it ends up with this error:
$ export GRAILS_HOME=/home/travis/.sdkman/candidates/grails/3.0.9/
$ export PATH=$PATH:$GRAILS_HOME/bin
$ ./gradlew assemble
...
(downloading a lot of gradle dependencies)
...
BUILD SUCCESSFUL
$ grails test-app
/home/travis/build.sh: line 45: grails: command not found
So do I have to install Grails somehow else or is it because of a missing/wrong path variable?
I've found a working .travis.yml here:
language: groovy
jdk:
- oraclejdk7
before_install:
- curl -s http://get.sdkman.io | bash
- echo sdkman_auto_answer=true > ~/.sdkman/etc/config
- source "/home/travis/.sdkman/bin/sdkman-init.sh"
- sdk install grails 3.0.9
script: grails test-app --stacktrace
Update:
Use get.sdkman.io since get.gvmtool.net doesn't work anymore.
How can i answer a question made by the console in travis-ci? I made a script that is downloading gvm but right after it completes i receive something like this:
"Do you want grails 2.1.5 to be set as default? (Y/n):"
Right after this question the build can't go foward, i tried to use expects but i was not very successful, my travis.yml is this:
language: groovy
jdk:
- oraclejdk7
before_install:
rm -rf ~/.gvm
curl -s get.gvmtool.net > ~/install_gvm.sh
chmod 775 ~/install_gvm.sh
~/install_gvm.sh
source "/home/travis/.sdkman/bin/sdkman-init.sh"
sdk install grails 2.1.5
echo "gvm_auto_answer=Y" > ~/.sdkman/bin/config
branches:
only:
- master
script: grails test-app --non-interactive
EDIT Grails wrapper is not working as you can see here
https://travis-ci.org/jpms2/ResS/builds/81761164
I seemed to find a problem like mine that happened with gvm instalation, the solution to this problem was a command like this:
echo "gvm_auto_answer=true" >> ~/.gvm/etc/config
So i tried to use this command and had no success:
echo "gvm_auto_answer=Y" >> ~/.sdkman/etc/config
I did find a way to pass the log message, using
echo sdkman_auto_answer=true > ~/.sdkman/etc/config
my travis.yml file is like this now:
language: groovy
jdk:
- oraclejdk7
before_install:
rm -rf ~/.gvm
curl -s get.gvmtool.net > ~/install_gvm.sh
chmod 775 ~/install_gvm.sh
~/install_gvm.sh
echo sdkman_auto_answer=true > ~/.sdkman/etc/config
source "/home/travis/.sdkman/bin/sdkman-init.sh"
sdk install grails 2.1.5
branches:
only:
- master
script: grails test-app --non-interactive
I want to use the Siesta testing Framework with PhantomJS on a local server and there is no problem. I worked like in http://www.bryntum.com/forum/viewtopic.php?f=20&t=3068 and on my machine, there were nothing to complain about, so i want to combine it with Jenkins.
But using Jenkins an Error 403 appears.
What I do:
Copy the files of my project in the webapps folder of Jetty (incl.
Framework )
Start the jetty server (so far no problems)
Use the PhantomJs of the framwork on my
localhost:port/project/index.html
And there my Problem starts:
Failed to load URL: localhost:port/project/index.html(Status 403)
I searched for some results but didn't find anything that solves this problem.
Every hint is welcome
Thanks
To see what i've done:
My Jenkins Shell Script
JETTY="jetty-distribution-9.2.0.v20140526"
JETTYWEB="$JETTY/webapps"
DIR="$WORKSPACE/$JETTYWEB/myProject/src/test"
PHANTOM="$DIR/Siesta_Framework/bin"
rm -r "$JETTYWEB/myProject/"
mkdir "$JETTYWEB/myProject/"
cp -pr "src/" "$JETTYWEB/myProject/"
chmod u+x -R $JETTYWEB/
cd $WORKSPACE/$JETTY
# Start des Servers
java -DSTOP.PORT=11183 -jar start.jar -DSTOP.KEY=tadam &
sleep 5
#jenkins "$DIR/browse-autmation.html?phantom=true&enableCodeCoverage=false&hasPreviousReport=false&page=0
cd $PHANTOM
#curl http://localhost:11182/myProject/src/test/browse-automation.html
./phantomjs "http://127.0.0.1:11182/myProject/src/test/browse-automation.html"
#"http://.../ci/job/test-phatomJS/ws/src/test/browse-automation.html?phantom=true&enableCodeCoverage=false&hasPreviousReport=false&page=0"
#curl http://127.0.0.1:11182/myProject/src/test/Siesta_Framework/bin/phantomjs
sleep 15
# Stop des Servers -DSTOP.KEY=tadam
cd $WORKSPACE/$JETTY
java -DSTOP.PORT=11183 -DSTOP.KEY=tadam -jar start.jar --stop
And the Result was:
[EnvInject] - Loading node environment variables.
Building remotely on ja_lin01 in workspace /var/opt/coinop/data/workspace/test-phatomJS
Fetching changes from the remote Git repository
Fetching upstream changes from gitlab#moso-ci-srv.novalocal:b.rohn/myProject.git
Checking out Revision a056b4ac6a7b47a4e77f3f80c5b7cbc51167cefc (origin/master)
[test-phatomJS] $ /bin/bash -xe /tmp/hudson8419984949815797813.sh
+ JETTY=jetty-distribution-9.2.0.v20140526
+ JETTYWEB=jetty-distribution-9.2.0.v20140526/webapps
+ DIR=/var/opt/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/myProject/src/test
+ PHANTOM=/var/opt/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/myProject/src/test/Siesta_Framework/bin
+ rm -r jetty-distribution-9.2.0.v20140526/webapps/myProject/
+ mkdir jetty-distribution-9.2.0.v20140526/webapps/myProject/
+ cp -pr src/ jetty-distribution-9.2.0.v20140526/webapps/myProject/
+ chmod u+x -R jetty-distribution-9.2.0.v20140526/webapps/
+ cd /var/opt/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526
+ sleep 5
+ java -DSTOP.PORT=11183 -jar start.jar -DSTOP.KEY=tadam
WARNING: System properties and/or JVM args set. Consider using --dry-run or --exec
2014-07-01 15:37:10.895:INFO::main: Logging initialized #1014ms
2014-07-01 15:37:12.451:INFO:oejs.Server:main: jetty-9.2.0.v20140526
2014-07-01 15:37:12.480:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/data/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/] at interval 1
2014-07-01 15:37:13.232:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext#57cd102a{/myProject,file:/data/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/myProject/,AVAILABLE}{/myProject}
2014-07-01 15:37:13.255:INFO:oejs.ServerConnector:main: Started ServerConnector#6d622548{HTTP/1.1}{0.0.0.0:11182}
2014-07-01 15:37:13.255:INFO:oejs.Server:main: Started #3388ms
+ cd /var/opt/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/myProject/src/test/Siesta_Framework/bin
+ ./phantomjs http://127.0.0.1:11182/myProject/src/test/browse-automation.html
/var/opt/coinop/data/workspace/test-phatomJS/jetty-distribution-9.2.0.v20140526/webapps/myProject/src/test/Siesta_Framework/bin
Launching PhantomJS 1.6.0 at http://127.0.0.1:11182/myProject/src/test/browse-automation.html
Failed to load URL: http://127.0.0.1:11182/myProject/src/test/browse-automation.html?phantom=true&enableCodeCoverage=false&hasPreviousReport=false&page=0(status: 403)
Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
Build step 'Execute shell' marked build as failure
2014-07-01 15:37:24.931:INFO:oejs.ServerConnector:Thread-0: Stopped ServerConnector#6d622548{HTTP/1.1}{0.0.0.0:11182}
Finished: FAILURE
after long searching i noticed, that the phantomjs call doesn't have all the informations it need. It needs the directory itself. So my resolution was: install phantomjs on the linux server and use this phantomjs, including the directory and the phantom script of the framework: now it works.
my actually call is:
./phantomjs "$DIR/phantomjs-launcher.js" $DIR http://127.0.0.1:11182/myProject/browse-automation.html
Situation: i cd in my phtomjs directory on the linux machine and give it the "DIR" of my framework/bin