github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/ci/cli-release/tasks/sign-redhat-installers.yml (about)

     1  ---
     2  platform: linux
     3  
     4  image_resource:
     5    type: docker-image
     6    source:
     7      repository: cfcli/cli-package
     8  
     9  params:
    10    GPG_KEY_LOCATION:
    11    TARGET_V7:
    12  
    13  inputs:
    14  - name: certificates
    15  - name: cli
    16  - name: edge-redhat-installer-32
    17  - name: edge-redhat-installer-64
    18  
    19  outputs:
    20  - name: signed-redhat-installer
    21  
    22  run:
    23    path: bash
    24    args:
    25    - -c
    26    - |
    27      set -ex
    28      cat<<EOF >sign-rpm
    29      #!/usr/bin/expect -f
    30      spawn rpmsign --addsign {*}\$argv
    31      expect -exact "Enter pass phrase: "
    32      send -- "\r"
    33      expect eof
    34      EOF
    35      chmod 700 sign-rpm
    36  
    37      if [ "$TARGET_V7" == "true" ]; then
    38        VERSION=$(cat cli/BUILD_VERSION_V7)
    39        SUFFIX="7"
    40      else
    41        VERSION=$(cat cli/BUILD_VERSION)
    42        SUFFIX=""
    43      fi
    44  
    45      cat<< EOF >~/.rpmmacros
    46      %_gpg_name CF CLI Team <cf-cli-eng@pivotal.io>
    47      EOF
    48  
    49      mkdir gpg-dir
    50      export GNUPGHOME=$PWD/gpg-dir
    51      chmod 700 $GNUPGHOME
    52      trap "rm -rf $GNUPGHOME" 0
    53  
    54      gpg --import certificates/$GPG_KEY_LOCATION
    55  
    56      ./sign-rpm edge-redhat-installer-32/cf${SUFFIX}-cli-installer_edge_i686.rpm
    57      ./sign-rpm edge-redhat-installer-64/cf${SUFFIX}-cli-installer_edge_x86-64.rpm
    58  
    59      mv edge-redhat-installer-32/cf${SUFFIX}-cli-installer_edge_i686.rpm signed-redhat-installer/cf${SUFFIX}-cli-installer_${VERSION}_i686.rpm
    60      mv edge-redhat-installer-64/cf${SUFFIX}-cli-installer_edge_x86-64.rpm signed-redhat-installer/cf${SUFFIX}-cli-installer_${VERSION}_x86-64.rpm