github.com/cloudberrydb/gpbackup@v1.0.3-0.20240118031043-5410fd45eed6/ci/scripts/s3-plugin-tests.bash (about)

     1  #!/bin/bash
     2  
     3  set -ex
     4  
     5  # setup cluster and install gpbackup tools using gppkg
     6  ccp_src/scripts/setup_ssh_to_cluster.sh
     7  out=$(ssh -t cdw 'source env.sh && psql postgres -c "select version();"')
     8  GPDB_VERSION=$(echo ${out} | sed -n 's/.*Greenplum Database \([0-9]\).*/\1/p')
     9  mkdir -p /tmp/untarred
    10  tar -xzf gppkgs/gpbackup-gppkgs.tar.gz -C /tmp/untarred
    11  scp /tmp/untarred/gpbackup_tools*gp${GPDB_VERSION}*${OS}*.gppkg cdw:/home/gpadmin
    12  ssh -t cdw "source env.sh; gppkg -i gpbackup_tools*.gppkg"
    13  
    14  cat <<SCRIPT > /tmp/run_tests.bash
    15    #!/bin/bash
    16  
    17    set -ex
    18    source env.sh
    19  
    20    cat << CONFIG > \${HOME}/s3_config.yaml
    21  executablepath: \${GPHOME}/bin/gpbackup_s3_plugin
    22  options:
    23    region: ${REGION}
    24    aws_access_key_id: ${AWS_ACCESS_KEY_ID}
    25    aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
    26    bucket: ${BUCKET}
    27    folder: test/backup
    28    backup_multipart_chunksize: 100MB
    29    restore_multipart_chunksize: 100MB
    30  CONFIG
    31  
    32    pushd ~/go/src/github.com/cloudberrydb/gpbackup/plugins
    33      ./plugin_test.sh \${GPHOME}/bin/gpbackup_s3_plugin \${HOME}/s3_config.yaml
    34    popd
    35  SCRIPT
    36  
    37  chmod +x /tmp/run_tests.bash
    38  scp /tmp/run_tests.bash cdw:/home/gpadmin/run_tests.bash
    39  ssh -t cdw "/home/gpadmin/run_tests.bash"