Project

General

Custom queries

Profile

Actions

Feature #5472

closed

[ci.in2p3.fr] deploy

Added by Schwarz Lionel over 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Build
Target version:
-
Start date:
11/08/2013
Due date:
% Done:

100%

Estimated time:

Description

How to deploy the passwords for "deploy":
~jenkins/.m2/settings.xml
~jenkins/.m2/settings-security.xml
?

Actions #1

Updated by Schwarz Lionel over 11 years ago

  • Status changed from New to Assigned

- install "config file" plugin
- create credential for domain "maven.in2p3.fr" with user/password
- configure "config files" on Jenkins with the specific settings.xml

TODO: how to deploy settings-security.xml ?

Actions #2

Updated by Schwarz Lionel over 11 years ago

  • settings.xml
  1. define a Maven settings conf file: MySettings
  2. Job config:Build/Settings file=provided/Provided=MySettings
  3. Or general config:Maven Config/Default settings provider=provided/Provided=MySettings
  • settings-security.xml (master password)
  1. Define a config file/Simple XML fichier: deploySettingsSecurity.xml (with the master password)
  2. Job config:pre-steps/provide conf file/deploySettingsSecurity.xml/Target=/home/jenkins/.m2/settings-security.xml
Actions #3

Updated by Schwarz Lionel over 11 years ago

  • Subject changed from [ci.in2p3.fr] security for "deploy" to [ci.in2p3.fr] deploy

The pubkey of maven.in2p3.fr must be in the known_hosts file. Configure the job with a pre-steps shell script:

test -f /home/jenkins/.ssh/known_hosts && ssh-keygen -R maven.in2p3.fr
ssh-keyscan -H maven.in2p3.fr >> /home/jenkins/.ssh/known_hosts
Another possibility is to create a configuration file in Jenkins with the public_key in it and copy this file in /home/jenkins/.ssh/known_hosts in the pre-steps. This solution has 2 drawbacks:
  1. The config file must be edited when the pubkey of maven.in2p3.fr changes
  2. To avoid overriding, all needed keys in all jobs must be declared in the config file
Actions #4

Updated by Schwarz Lionel over 11 years ago

Issue with deploy ZIP to sftp://maven.in2p3.fr:

[INFO] Retrieving previous build number from maven2-repository
Uploading: sftp://maven.in2p3.fr/www/htdocs/fr/in2p3/lavoisier/lavoisier-package/2.0-SNAPSHOT/lavoisier-package-2.0-20131112.143209-51-bin.zip
[JENKINS] Archiving /home/jenkins/workspace/Lavoisier/lavoisier-package/pom.xml to /opt/jenkins-farm/var/projects/cc-maven-projects/jobs/Lavoisier/modules/fr.in2p3.lavoisier$lavoisier-package/builds/2013-11-12_15-32-03/archive/fr.in2p3.lavoisier/lavoisier-package/2.0-SNAPSHOT/lavoisier-package-2.0-SNAPSHOT.pom
[JENKINS] Archiving /home/jenkins/workspace/Lavoisier/lavoisier-package/build/lavoisier-package-2.0-SNAPSHOT.jar to /opt/jenkins-farm/var/projects/cc-maven-projects/jobs/Lavoisier/modules/fr.in2p3.lavoisier$lavoisier-package/builds/2013-11-12_15-32-03/archive/fr.in2p3.lavoisier/lavoisier-package/2.0-20131112.143209-51/lavoisier-package-2.0-20131112.143209-51.jar
[JENKINS] Archiving /home/jenkins/workspace/Lavoisier/lavoisier-package/build/lavoisier-package-2.0-SNAPSHOT-bin.zip to /opt/jenkins-farm/var/projects/cc-maven-projects/jobs/Lavoisier/modules/fr.in2p3.lavoisier$lavoisier-package/builds/2013-11-12_15-32-03/archive/fr.in2p3.lavoisier/lavoisier-package/2.0-20131112.143209-51/lavoisier-package-2.0-20131112.143209-51-bin.zip
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: PUT request to: fr/in2p3/lavoisier/lavoisier-package/2.0-SNAPSHOT/lavoisier-package-2.0-20131112.143209-51-bin.zip in maven2-repository failed

channel is broken

If run directly on the VM, it's OK:

/home/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven-2.2.1/bin/mvn deploy
...
[INFO] Retrieving previous build number from maven2-repository
Uploading: sftp://maven.in2p3.fr/www/htdocs/fr/in2p3/lavoisier/lavoisier-package/2.0-SNAPSHOT/lavoisier-package-2.0-20131112.145019-52-bin.zip
17222K uploaded  (lavoisier-package-2.0-20131112.145019-52-bin.zip)

Actions #5

Updated by Schwarz Lionel over 11 years ago

Test with Maven-3.1.1 gives:

message : Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project lavoisier: Failed to deploy artifacts/metadata: No connector available to access repository maven2-repository (sftp://maven.in2p3.fr/www/htdocs) of type default using the available factories WagonRepositoryConnectorFactory
cause : Failed to deploy artifacts/metadata: No connector available to access repository maven2-repository (sftp://maven.in2p3.fr/www/htdocs) of type default using the available factories WagonRepositoryConnectorFactory
Stack trace : 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project lavoisier: Failed to deploy artifacts/metadata: No connector available to access repository maven2-repository (sftp://maven.in2p3.fr/www/htdocs) of type default using the available factories WagonRepositoryConnectorFactory

Actions #6

Updated by Schwarz Lionel about 11 years ago

Successfully tested on ccci.in2p3.fr:
- use "wagon-ssh-external" for deploy by using an URL like "scpexe:/...".
- use "wagon-ssh" for site-deploy ("sftp://software.in2p3.fr/...")

Actions #8

Updated by Schwarz Lionel almost 11 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

"Connection refused" was due to brute-force ssh protection on the web cluster.

Actions

Also available in: Atom PDF