orange.p2: deploy artifact in a located based on the name of the branch

Signed-off-by: BOLLE Sebastien <sebastien.bolle@orange.com>
Signed-off-by: BONNARDEL Gregory <gbonnardel.ext@orange.com>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eab8bdc..aaedff1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,7 +24,7 @@
   stage: deploy
   script: 
     - "nohup dockerd&"
-    - "mvn deploy -B -Dmaven.repo.local=./.m2/repository -s /root/.m2/settings.xml -DaltDeploymentRepository=inhouse.snapshot::default::http://maven2.rd.francetelecom.fr/proxy/repository/inhouse.snapshot -Pdocker"
+    - "mvn deploy -B -Dmaven.repo.local=./.m2/repository -s /root/.m2/settings.xml -DaltDeploymentRepository=inhouse.snapshot::default::http://maven2.rd.francetelecom.fr/proxy/repository/inhouse.snapshot -Drepo=${CI_COMMIT_REF_NAME} -Pdocker"
     - "rm -fr .m2"
   tags:
     - docker-privileged
diff --git a/com.orange.om2m.p2.repo/.project b/com.orange.om2m.p2.repo/.project
new file mode 100644
index 0000000..7f9e244
--- /dev/null
+++ b/com.orange.om2m.p2.repo/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<projectDescription>

+	<name>com.orange.om2m.p2.repo</name>

+	<comment></comment>

+	<projects>

+	</projects>

+	<buildSpec>

+		<buildCommand>

+			<name>org.eclipse.m2e.core.maven2Builder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+	</buildSpec>

+	<natures>

+		<nature>org.eclipse.m2e.core.maven2Nature</nature>

+	</natures>

+</projectDescription>

diff --git a/com.orange.om2m.p2.repo/pom.xml b/com.orange.om2m.p2.repo/pom.xml
index d056527..b1b1ddf 100644
--- a/com.orange.om2m.p2.repo/pom.xml
+++ b/com.orange.om2m.p2.repo/pom.xml
@@ -24,6 +24,11 @@
 	<artifactId>com.orange.om2m.p2.repo</artifactId>

 	<packaging>eclipse-repository</packaging>

 	<name>org.eclipse.om2m :: Orange's p2 repo</name>

+	

+	<properties>

+		<repo>default</repo>

+	</properties>

+	

 	<build>

 		<extensions>

 			<extension>

@@ -52,7 +57,7 @@
 					<includes>*/**</includes>

 					<excludes>pom.xml</excludes>

 					<url>dhsa.forge.orange-labs.fr</url>

-					<toDir>/home/groups/dhsa/htdocs/p2</toDir>

+					<toDir>/home/groups/dhsa/htdocs/p2/${repo}</toDir>

 				</configuration>

 				<executions>

 					<execution>

@@ -63,7 +68,7 @@
 						</goals>

 						<configuration>

 							<commands>

-								<command>rm -rf /home/groups/dhsa/htdocs/p2/*</command>

+								<command>rm -rf /home/groups/dhsa/htdocs/p2/${repo}</command>

 							</commands>

 						</configuration>

 					</execution>