forked from crossbario/crossbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-wheels.sh
executable file
·63 lines (49 loc) · 2.52 KB
/
deploy-wheels.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set +o verbose -o errexit
# AWS_DEFAULT_REGION : must be set in CI build context!
# AWS_S3_BUCKET_NAME : must be set in CI build context!
# AWS_ACCESS_KEY_ID : must be set in CI build context!
# AWS_SECRET_ACCESS_KEY : must be set in CI build context!
# WAMP_PRIVATE_KEY : must be set in CI build context!
echo 'AWS env vars (should be 4):'
env | grep AWS_ | wc -l
echo 'WAMP_PRIVATE_KEY env var (should be 1):'
env | grep WAMP_PRIVATE_KEY | wc -l
# set up awscli package
echo 'installing aws tools ..'
pip install awscli
which aws
aws --version
# build python source dist and wheels
echo 'building package ..'
python setup.py sdist bdist_wheel --universal
ls -la ./dist
# upload to S3: https://s3.eu-central-1.amazonaws.com/crossbarbuilder/wheels/
echo 'uploading package ..'
# "aws s3 ls" will return -1 when no files are found! but we don't want our script to exit
aws s3 ls ${AWS_S3_BUCKET_NAME}/wheels/crossbar- || true
# aws s3 cp --recursive ./dist s3://${AWS_S3_BUCKET_NAME}/wheels
aws s3 rm s3://${AWS_S3_BUCKET_NAME}/wheels/crossbar-${CROSSBAR_VERSION}-py2.py3-none-any.whl
aws s3 rm s3://${AWS_S3_BUCKET_NAME}/wheels/crossbar-latest-py2.py3-none-any.whl
aws s3 cp --acl public-read ./dist/crossbar-${CROSSBAR_VERSION}-py2.py3-none-any.whl s3://${AWS_S3_BUCKET_NAME}/wheels/crossbar-${CROSSBAR_VERSION}-py2.py3-none-any.whl
aws s3 cp --acl public-read ./dist/crossbar-${CROSSBAR_VERSION}-py2.py3-none-any.whl s3://${AWS_S3_BUCKET_NAME}/wheels/crossbar-latest-py2.py3-none-any.whl
#aws s3api copy-object --acl public-read \
# --copy-source wheels/crossbar-${CROSSBAR_VERSION}-py2.py3-none-any.whl --bucket ${AWS_S3_BUCKET_NAME} \
# --key wheels/crossbar-latest-py2.py3-none-any.whl
aws s3 ls ${AWS_S3_BUCKET_NAME}/wheels/crossbar-
echo ''
echo 'package uploaded to:'
echo ''
echo ' https://crossbarbuilder.s3.eu-central-1.amazonaws.com/wheels/crossbar-'${CROSSBAR_VERSION}'-py2.py3-none-any.whl'
echo ' https://crossbarbuilder.s3.eu-central-1.amazonaws.com/wheels/crossbar-latest-py2.py3-none-any.whl'
echo ''
# tell crossbar-builder about this new wheel push
# get 'wamp' command, always with latest autobahn master
pip install -q -I https://github.com/crossbario/autobahn-python/archive/master.zip#egg=autobahn[twisted,serialization,encryption]
# use 'wamp' to notify crossbar-builder
wamp --max-failures 3 \
--authid wheel_pusher \
--url ws://office2dmz.crossbario.com:8008/ \
--realm webhook call builder.wheel_pushed \
--keyword name crossbar \
--keyword publish true