amoeba commented on code in PR #49788:
URL: https://github.com/apache/arrow/pull/49788#discussion_r3105576240


##########
dev/release/07-flightsqlodbc-upload.sh:
##########
@@ -0,0 +1,190 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# FlightSQL ODBC Release Signing Script
+#
+# This script handles the signing of FlightSQL ODBC Windows binaries and MSI
+# installer. It requires jsign to be configured with ASF code signing
+# credentials. Keep reading below:
+#
+# Required environment variables:
+#
+#   ESIGNER_STOREPASS - The ssl.com credentials in "username|password" format
+#   ESIGNER_KEYPASS   - The ssl.com eSigner secret code (not the PIN)
+#
+# How to get ESIGNER_KEYPASS:
+#
+# 1. Log into ssl.com
+# 2. In your Dashboard, under "invitations", click the link under the order. Or
+#    go to Orders, find the order, expand the order, and click "certificate
+#    details"
+# 3. Enter your PIN to get your OTP. This is ESIGNER_KEYPASS.
+#
+# If you don't have access, see https://infra.apache.org/code-signing-use.html.
+
+set -e
+set -u
+set -o pipefail
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <version> <rc-num>"
+  exit 1
+fi
+
+if [ -z "${ESIGNER_STOREPASS:-}" ]; then
+  echo "ERROR: ESIGNER_STOREPASS is not set" >&2
+  exit 1
+fi
+if [ -z "${ESIGNER_KEYPASS:-}" ]; then
+  echo "ERROR: ESIGNER_KEYPASS is not set" >&2
+  exit 1
+fi
+
+. "${SOURCE_DIR}/utils-env.sh"
+
+version=$1
+rc=$2
+
+version_with_rc="${version}-rc${rc}"
+tag="apache-arrow-${version_with_rc}"
+
+dll_unsigned="arrow_flight_sql_odbc_unsigned.dll"
+dll_signed="arrow_flight_sql_odbc.dll"
+
+: "${GITHUB_REPOSITORY:=apache/arrow}"
+
+: ${PHASE_DEFAULT=1}
+: ${PHASE_SIGN_DLL=${PHASE_DEFAULT}}
+: ${PHASE_BUILD_MSI=${PHASE_DEFAULT}}
+: ${PHASE_SIGN_MSI=${PHASE_DEFAULT}}
+
+if [ ${PHASE_SIGN_DLL} -eq 0 ] && [ ${PHASE_BUILD_MSI} -eq 0 ] && [ 
${PHASE_SIGN_MSI} -eq 0 ]; then
+  echo "No phases specified. Exiting."
+  exit 1
+fi
+
+# Utility function to use jsign to check if a file is signed or not
+is_signed() {
+  local file="$1"
+  local output
+  local exit_code
+  output=$(jsign extract --format PEM "${file}" 2>&1)
+  exit_code=$?
+  # jsign writes a PEM file even though it also prints to stdout. Clean up 
after
+  # it. Use -f since so it still runs on unsigned files without error.
+  rm -f "${file}.sig.pem"
+
+  return ${exit_code}
+}
+
+# All work with release artifacts happens in a temp dir
+tmp_dir="$(mktemp -d)"

Review Comment:
   Good point. Changed in 92a8ae8860c2267c804ceac62c18f47726e093fd.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to