diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 509dbd01e3ed403f62759c9dada14d3757f33a67..742ad7519cb82c424aa96f06ecb5bb8db97d72a2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -175,7 +175,7 @@ deploy:
     # Checkout the expected branch
     - git checkout -f -q $CI_COMMIT_SHA
   script:
-    - ./CI/deploy.sh $CI_COMMIT_REF_NAME
+    - ./CI/deploy.sh $CI_COMMIT_REF_NAME $RC_NUMBER
   dependencies:
     - ubuntu-superbuild-build 
     - centos-superbuild-build
diff --git a/CI/deploy.sh b/CI/deploy.sh
index 2fff5ec0817929c15f9015e7a66df496737698aa..051bc2ee082b0cfbe4d0c44bf5af14ff677043e5 100755
--- a/CI/deploy.sh
+++ b/CI/deploy.sh
@@ -2,13 +2,13 @@
 # Configure git for tar.xz
 git config tar.tar.xz.command "xz -c"
 
-if [ $1 = "develop" ] # check if the branch name is develop or not
 pack_suffix=""
+if [ $1 = "develop" ] # check if the branch name is develop or not
 then # we are on develop
   jobs_directory=/home/otbpush/test/$(date +%F)
 else # we are on a release branch
   jobs_directory=/home/otbpush/test/staging
-  if [ \( "$#" -eq 2 \) && \( echo "$2" | grep "rc[0-9]*" \) ]
+  if [ "$#" -eq 2 ]
     then # there is a rc tag, we need a suffix for packages
     pack_suffix=$(echo "$2" | grep -o "rc[0-9]*") # this retrieve the rc number
   fi
@@ -43,7 +43,7 @@ find build_packages/. -name "*.run" \
 
 # TO REMOVE
 ###########
-ls -all
+ls -all build_packages/
 ###########
 
 echo "Pushing binary packages"