]>
git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/dev/release/utils-binary.sh
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
18 docker_image_name
=apache-arrow
/release-binary
19 gpg_agent_extra_socket
="$(gpgconf --list-dirs agent-extra-socket)"
20 if [ $
(uname
) = "Darwin" ]; then
27 docker_ssh_key
="${SOURCE_DIR}/binary/id_rsa"
29 if [ ! -f "${docker_ssh_key}" ]; then
30 ssh-keygen
-N "" -f "${docker_ssh_key}"
36 local known_hosts_file
=$
(mktemp
-t "arrow-binary-gpg-ssh-known-hosts.XXXXX")
39 -o StrictHostKeyChecking
=no \
40 -o UserKnownHostsFile
=${known_hosts_file} \
41 -i "${docker_ssh_key}" \
43 -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
50 rm -f ${known_hosts_file}
55 local container_id_dir
=$
(mktemp
-d -t "arrow-binary-gpg-container.XXXXX")
56 local container_id_file
=${container_id_dir}/id
59 --cidfile ${container_id_file} \
63 --volume "$PWD":/host \
64 ${docker_image_name} \
66 if [ \$(id -u) -ne ${docker_uid} ]; then
67 usermod --uid ${docker_uid} arrow
68 chown -R arrow: ~arrow
72 local container_id
=$
(cat ${container_id_file})
73 local ssh_port
=$
(docker port
${container_id} |
grep -E -o '[0-9]+$' |
head -n 1)
74 # Wait for sshd available
75 while ! docker_gpg_ssh
${ssh_port} : > /dev
/null
2>&1; do
78 gpg
--export ${GPG_KEY_ID} | docker_gpg_ssh
${ssh_port} gpg
--import
79 docker_gpg_ssh
${ssh_port} "$@"
80 docker
kill ${container_id}
81 rm -rf ${container_id_dir}
84 docker build
-t ${docker_image_name} "${SOURCE_DIR}/binary"
86 chmod go-rwx
"${docker_ssh_key}"