From cf89f8ac722a31f26cc88487a3b0ff95879f6f7a Mon Sep 17 00:00:00 2001 From: Ruben Abad Date: Thu, 25 Jan 2024 17:43:46 +0100 Subject: [PATCH] test backblaze copy --- Jenkinsfile | 17 +++++++++-------- Util/BuildTools/Deploy.sh | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 946be60b9..60e451f6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -127,7 +127,7 @@ pipeline steps { sh 'git checkout .' - //sh 'make deploy ARGS="--replace-latest"' + sh 'make deploy ARGS="--test"' } } @@ -138,7 +138,7 @@ pipeline steps { sh 'git checkout .' - //sh 'make deploy ARGS="--replace-latest"' + sh 'make deploy ARGS="--replace-latest"' } } stage('ubuntu deploy master') @@ -147,13 +147,13 @@ pipeline steps { sh 'git checkout .' - //sh 'make deploy ARGS="--replace-latest --docker-push"' + sh 'make deploy ARGS="--replace-latest --docker-push"' } } - stage('TEST: ubuntu Doxygen generation') + stage('ubuntu Doxygen generation') { - when { branch "ruben/jenkins_migration" } + when { anyOf { branch "master"; branch "dev"; buildingTag() } } steps { sh 'make docs' @@ -162,9 +162,9 @@ pipeline } } - stage('TEST: ubuntu Doxygen upload') + stage('ubuntu Doxygen upload') { - when { branch "ruben/jenkins_migration" } + when { anyOf { branch "master"; branch "dev"; buildingTag() } } steps { checkout scmGit(branches: [[name: '*/master']], extensions: [checkoutOption(120), cloneOption(noTags:false, reference:'', shallow: false, timeout:120)], userRemoteConfigs: [[credentialsId: 'github_token_as_pwd_2', url: 'https://github.com/carla-simulator/carla-simulator.github.io.git']]) @@ -174,8 +174,9 @@ pipeline tar -xvzf carla_doc.tar.gz git add Doxygen git commit -m "Updated c++ docs" || true + git push + ''' - // don't forget git push } post { diff --git a/Util/BuildTools/Deploy.sh b/Util/BuildTools/Deploy.sh index 55fb6beba..3d3e45a80 100755 --- a/Util/BuildTools/Deploy.sh +++ b/Util/BuildTools/Deploy.sh @@ -12,6 +12,10 @@ AWS_COPY="aws s3 cp" DOCKER="docker" UNTAR="tar -xvzf" UPLOAD_MAPS=true +PROFILE="--profile Jenkins-CVC" +ENDPOINT="--endpoint-url=https://s3.us-east-005.backblazeb2.com/" +TEST=false + # ============================================================================== # -- Parse arguments ----------------------------------------------------------- @@ -21,12 +25,15 @@ DOC_STRING="Upload latest build to S3." USAGE_STRING="Usage: $0 [-h|--help] [--replace-latest] [--docker-push] [--dry-run]" -OPTS=`getopt -o h --long help,replace-latest,docker-push,dry-run -n 'parse-options' -- "$@"` +OPTS=`getopt -o h --long help,replace-latest,docker-push,dry-run,test -n 'parse-options' -- "$@"` eval set -- "$OPTS" while [[ $# -gt 0 ]]; do case "$1" in + --test ) + TEST=true + shift ;; --replace-latest ) REPLACE_LATEST=true; shift ;; @@ -86,6 +93,25 @@ if [ ! -f ${LATEST_PACKAGE_PATH} ]; then fatal_error "Latest package not found, please run 'make package'." fi + +# ============================================================================== +# -- TEST -------------------------------------------------------------------- +# ============================================================================== + +if ${TEST} ; then + LATEST_PACKAGE=test_CARLA_${REPOSITORY_TAG}.tar.gz + LATEST_PACKAGE_PATH=./${LATEST_PACKAGE} + LATEST_PACKAGE2=test_AdditionalMaps_${REPOSITORY_TAG}.tar.gz + LATEST_PACKAGE_PATH2=./${LATEST_PACKAGE2} + + DEPLOY_NAME=test_CARLA_${REPOSITORY_TAG}.tar.gz + DEPLOY_NAME2=test_AdditionalMaps_${REPOSITORY_TAG}.tar.gz + + touch ${LATEST_PACKAGE} + touch ${LATEST_PACKAGE2} + +fi + # ============================================================================== # -- Upload -------------------------------------------------------------------- # ============================================================================== @@ -93,10 +119,10 @@ fi DEPLOY_URI=${S3_PREFIX}/${DEPLOY_NAME} DEPLOY_URI2=${S3_PREFIX}/${DEPLOY_NAME2} -${AWS_COPY} ${LATEST_PACKAGE_PATH} ${DEPLOY_URI} +${AWS_COPY} ${LATEST_PACKAGE_PATH} ${DEPLOY_URI} ${ENDPOINT} ${PROFILE} log "Latest build uploaded to ${DEPLOY_URI}." -${AWS_COPY} ${LATEST_PACKAGE_PATH2} ${DEPLOY_URI2} +${AWS_COPY} ${LATEST_PACKAGE_PATH2} ${DEPLOY_URI2} ${ENDPOINT} ${PROFILE} log "Latest build uploaded to ${DEPLOY_URI2}." # ============================================================================== @@ -105,10 +131,10 @@ log "Latest build uploaded to ${DEPLOY_URI2}." if ${REPLACE_LATEST} ; then - ${AWS_COPY} ${DEPLOY_URI} ${LATEST_DEPLOY_URI} + ${AWS_COPY} ${DEPLOY_URI} ${LATEST_DEPLOY_URI} ${ENDPOINT} ${PROFILE} log "Latest build uploaded to ${LATEST_DEPLOY_URI}." - ${AWS_COPY} ${DEPLOY_URI2} ${LATEST_DEPLOY_URI2} + ${AWS_COPY} ${DEPLOY_URI2} ${LATEST_DEPLOY_URI2} ${ENDPOINT} ${PROFILE} log "Latest build uploaded to ${LATEST_DEPLOY_URI2}." fi