forked from colinhoglund/docker-fpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_python.sh
More file actions
executable file
·25 lines (25 loc) · 1.31 KB
/
build_python.sh
File metadata and controls
executable file
·25 lines (25 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set -ex
apt-get -y install reprepro
echo "pulling encrypted gpg key from s3"
aws s3 cp s3://sp-deploy-repo/sp_sec.gpg /tmp
echo "building python package version $PYTHON_VERSION"
BUILD_VERSION=${PythonVersion} BUILD_ITERATION=${BUILD_ITERATION} BUILD_OUTPUT_DIR=${BUILD_OUTPUT_DIR:-/tmp} /opt/build_scripts/build_python
echo "Building SP apt repo locally"
curl http://apt.singleplatform.co/Release.key | gpg --import
echo use-agent >> ~/.gnupg/gpg.conf
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
echo allow-preset-passphrase >> ~/.gnupg/gpg-agent.conf
echo no-tty >> ~/.gnupg/gpg.conf
echo RELOADAGENT | gpg-connect-agent
echo ${gpgpassphrase} | gpg --no-tty --passphrase-fd 0 --import /tmp/sp_sec.gpg
echo "personal-digest-preferences SHA256" > ~/.gnupg/gpg.conf
gpg-connect-agent 'keyinfo --list' /bye | awk '{print $3}' > /tmp/keygrips
sed -i '/^$/d' /tmp/keygrips
while read keygrip; do echo ${gpgpassphrase} | /usr/lib/gnupg/gpg-preset-passphrase --preset $keygrip; done </tmp/keygrips
mkdir /repo
aws s3 sync --delete s3://apt.singleplatform.co/ /repo/
echo "Adding python package to apt repo"
LSB_RELEASE=`lsb_release -cs`
GNUPGHOME=~/.gnupg reprepro -b /repo/ includedeb ${LSB_RELEASE} /tmp/python-*
aws s3 sync --delete --acl public-read /repo/ s3://apt.singleplatform.co/