github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/ci/cli/tasks/publish-debian.yml (about)

     1  platform: linux
     2  image: docker:///cloudfoundry/cli-ci
     3  
     4  inputs:
     5  - name: final-cli
     6    path: cli
     7  - name: cli-private
     8  - name: cli
     9    path: gopath/src/github.com/cloudfoundry/cli
    10  - name: cf-cli-installers
    11  
    12  params:
    13    GPG_KEY:
    14    KEY_ID:
    15    AWS_SECRET_ACCESS_KEY:
    16    AWS_ACCESS_KEY_ID:
    17    AWS_BUCKET_NAME: cf-cli-debian
    18  
    19  run:
    20    path: bash
    21    args:
    22    - -c
    23    - |
    24      set -ex
    25      gpg --import <(echo "${GPG_KEY}")
    26      export DEBIAN_FRONTEND=noninteractive
    27  
    28      mkdir installers
    29  
    30      pushd cli
    31        git remote set-url origin https://github.com/cloudfoundry/cli.git
    32        git fetch --tags
    33        release_tag=$( git show-ref --tags -d | grep $(git rev-parse HEAD) | cut -d'/' -f3 | egrep 'v[0-9]' | cut -d'v' -f2 )
    34      popd
    35  
    36      if [ -z "${release_tag}" ]; then
    37        echo "Expected the commit that triggered this build to be tagged." >&2
    38        exit 1
    39      fi
    40  
    41      tar -xvzf cf-cli-installers/cf-cli-installers.tgz -C installers
    42  
    43      filename_regex="cf-cli(-installer)?([-_0-9a-z]+)?(\.[a-z]+)?"
    44      pushd installers
    45        for installer in *.deb; do
    46          [[ "${installer}" =~ $filename_regex ]]
    47          os_arch="${BASH_REMATCH[2]}"
    48          mv "${installer}" "cf-cli-installer_${release_tag}${os_arch}.deb"
    49        done
    50      popd
    51  
    52      cat >> $HOME/.gnupg/gpg.conf <<EOF
    53      personal-digest-preferences SHA256
    54      cert-digest-algo SHA256
    55      default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
    56      EOF
    57  
    58      deb-s3 upload installers/*.deb --preserve-versions --sign=${KEY_ID} --bucket=${AWS_BUCKET_NAME}
    59