test backblaze copy

This commit is contained in:
Ruben Abad 2024-01-25 17:43:46 +01:00
parent 8d181b666b
commit cf89f8ac72
2 changed files with 40 additions and 13 deletions

17
Jenkinsfile vendored
View File

@ -127,7 +127,7 @@ pipeline
steps steps
{ {
sh 'git checkout .' sh 'git checkout .'
//sh 'make deploy ARGS="--replace-latest"' sh 'make deploy ARGS="--test"'
} }
} }
@ -138,7 +138,7 @@ pipeline
steps steps
{ {
sh 'git checkout .' sh 'git checkout .'
//sh 'make deploy ARGS="--replace-latest"' sh 'make deploy ARGS="--replace-latest"'
} }
} }
stage('ubuntu deploy master') stage('ubuntu deploy master')
@ -147,13 +147,13 @@ pipeline
steps steps
{ {
sh 'git checkout .' 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 steps
{ {
sh 'make docs' 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 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']]) 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 tar -xvzf carla_doc.tar.gz
git add Doxygen git add Doxygen
git commit -m "Updated c++ docs" || true git commit -m "Updated c++ docs" || true
git push
''' '''
// don't forget git push
} }
post post
{ {

View File

@ -12,6 +12,10 @@ AWS_COPY="aws s3 cp"
DOCKER="docker" DOCKER="docker"
UNTAR="tar -xvzf" UNTAR="tar -xvzf"
UPLOAD_MAPS=true UPLOAD_MAPS=true
PROFILE="--profile Jenkins-CVC"
ENDPOINT="--endpoint-url=https://s3.us-east-005.backblazeb2.com/"
TEST=false
# ============================================================================== # ==============================================================================
# -- Parse arguments ----------------------------------------------------------- # -- 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]" 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" eval set -- "$OPTS"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--test )
TEST=true
shift ;;
--replace-latest ) --replace-latest )
REPLACE_LATEST=true; REPLACE_LATEST=true;
shift ;; shift ;;
@ -86,6 +93,25 @@ if [ ! -f ${LATEST_PACKAGE_PATH} ]; then
fatal_error "Latest package not found, please run 'make package'." fatal_error "Latest package not found, please run 'make package'."
fi 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 -------------------------------------------------------------------- # -- Upload --------------------------------------------------------------------
# ============================================================================== # ==============================================================================
@ -93,10 +119,10 @@ fi
DEPLOY_URI=${S3_PREFIX}/${DEPLOY_NAME} DEPLOY_URI=${S3_PREFIX}/${DEPLOY_NAME}
DEPLOY_URI2=${S3_PREFIX}/${DEPLOY_NAME2} 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}." 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}." log "Latest build uploaded to ${DEPLOY_URI2}."
# ============================================================================== # ==============================================================================
@ -105,10 +131,10 @@ log "Latest build uploaded to ${DEPLOY_URI2}."
if ${REPLACE_LATEST} ; then 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}." 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}." log "Latest build uploaded to ${LATEST_DEPLOY_URI2}."
fi fi