Fixed deployment
This commit is contained in:
parent
a5538730bb
commit
2083a0857b
|
@ -8,14 +8,38 @@ gCubePrefix=org.gcube
|
||||||
|
|
||||||
gCubeGroupId=org.gcube.common
|
gCubeGroupId=org.gcube.common
|
||||||
|
|
||||||
#repositoryId=gcube-snapshots
|
repositoryId=gcube-releases
|
||||||
#repositoryUrl=http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-snapshots
|
repositoryUrl=http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-releases
|
||||||
|
|
||||||
#repositoryId=gcube-externals
|
username=
|
||||||
repositoryUrl=http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-externals
|
password=
|
||||||
|
|
||||||
|
function showhelp {
|
||||||
|
echo -e "\nUsage: createAndDeploy.sh -u <nexus-releases-username> -p <nexus-releases-password> [-h]\n"
|
||||||
|
echo -e " -h = shows this help.\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts ":u:p:h" opt; do
|
||||||
|
case $opt in
|
||||||
|
u) username=$OPTARG;;
|
||||||
|
p) password=$OPTARG;;
|
||||||
|
h) showhelp
|
||||||
|
exit 0 ;;
|
||||||
|
\?) echo -e "\nERROR:invalid option: -$OPTARG";
|
||||||
|
showhelp;
|
||||||
|
echo -e "\naborting.\n"
|
||||||
|
exit 1 >&2 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
settingsFile=jenkins-releases-settings.xml
|
||||||
|
rm ${settingsFile}
|
||||||
|
wget https://code-repo.d4science.org/gCubeSystem/Configs/raw/branch/master/Maven/1.1.0/${settingsFile}
|
||||||
|
|
||||||
|
sed -i 's/{{ gcube_maven_user }}/'"${username}"'/g' ${settingsFile}
|
||||||
|
sed -i 's/{{ gcube_maven_pwd }}/'"${password}"'/g' ${settingsFile}
|
||||||
|
|
||||||
for i in jackson-core jackson-annotations jackson-databind
|
for i in jackson-core jackson-annotations jackson-databind
|
||||||
#for i in jackson-core
|
|
||||||
do
|
do
|
||||||
jacksonArtifactId=$i
|
jacksonArtifactId=$i
|
||||||
|
|
||||||
|
@ -52,20 +76,25 @@ do
|
||||||
cd ${projectDir}/target/${repackagedJacksonArtifact}
|
cd ${projectDir}/target/${repackagedJacksonArtifact}
|
||||||
zip -r ../${gCubeArtifactJar} .
|
zip -r ../${gCubeArtifactJar} .
|
||||||
|
|
||||||
cd ${projectDir}/target
|
cd ${projectDir}
|
||||||
|
mkdir ${gCubeArtifactId}
|
||||||
cp ../pom.deploy.template.${jacksonArtifactId}.xml deploy.pom.xml
|
mv ${projectDir}/target/${gCubeArtifactJar} ${gCubeArtifactId}
|
||||||
sed -i 's/JACKSON_ARTIFACT_ID/'"${jacksonArtifactId}"'/g' deploy.pom.xml
|
|
||||||
sed -i 's/JACKSON_VERSION/'"${jacksonVersion}"'/g' deploy.pom.xml
|
|
||||||
|
|
||||||
#mvn -U install:install-file -DpomFile=deploy.pom.xml -Dfile=${gCubeArtifactJar}
|
|
||||||
#mvn -U deploy:deploy-file -DpomFile=deploy.pom.xml -Dfile=${gCubeArtifactJar} -DrepositoryId=${repositoryId}
|
|
||||||
|
|
||||||
mvn -U deploy:deploy-file -DpomFile=deploy.pom.xml -Dfile=${gCubeArtifactJar} -Durl=${repositoryUrl}
|
|
||||||
|
|
||||||
cd ${projectDir}
|
|
||||||
mvn clean
|
mvn clean
|
||||||
rm pom.xml
|
rm pom.xml
|
||||||
rm dependency-reduced-pom.xml
|
rm dependency-reduced-pom.xml
|
||||||
|
|
||||||
|
cd ${gCubeArtifactId}
|
||||||
|
|
||||||
|
cp ${projectDir}/pom.deploy.template.${jacksonArtifactId}.xml pom.xml
|
||||||
|
sed -i 's/JACKSON_ARTIFACT_ID/'"${jacksonArtifactId}"'/g' pom.xml
|
||||||
|
sed -i 's/JACKSON_VERSION/'"${jacksonVersion}"'/g' pom.xml
|
||||||
|
|
||||||
|
mvn -s ../jenkins-releases-settings.xml -U deploy:deploy-file -DpomFile=pom.xml -Dfile=${gCubeArtifactJar} -DrepositoryId=${repositoryId} -Durl=${repositoryUrl}
|
||||||
|
|
||||||
|
cd ${projectDir}
|
||||||
|
rm -rf ${gCubeArtifactId}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
cd ${projectDir}
|
||||||
|
rm ${settingsFile}
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.gcube.tools</groupId>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.gcube.tools</groupId>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
||||||
<version>JACKSON_VERSION</version>
|
<version>JACKSON_VERSION</version>
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.gcube.tools</groupId>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
<artifactId>gcube-JACKSON_ARTIFACT_ID</artifactId>
|
||||||
<version>JACKSON_VERSION</version>
|
<version>JACKSON_VERSION</version>
|
||||||
|
|
Loading…
Reference in New Issue