-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbitbucket-pipelines.yml
121 lines (117 loc) · 6.21 KB
/
bitbucket-pipelines.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
pipelines:
options:
max-time: 20
default:
- step:
name: Test udpate_installer_urls.py
image: python:2.7
script:
- pip install pytest
- python -m pytest scripts/update_installer_urls.py
custom:
appveyor-trigger:
- step:
# NOTE: this step should not normally be needed if hooks are running
# as expected with appveyor. It's added here in case we need to retrigger
# an appveyor build after-the-fact.
name: "Retrigger AppVeyor"
image: atlassian/default-image:2
script:
- |
curl --fail --header "Authorization: Bearer $APPVEYOR_API_KEY" \
--header "Content-Type: application/json" \
--data "{'accountName': '$APPVEYOR_ACC_NAME',
'projectSlug': '$APPVEYOR_PROJ_SLUG',
'branch': '$(hg branch)',
'commitID': '$(hg log -r . -T \"{node}\")'}" \
"https://ci.appveyor.com/api/builds"
- echo "Build history at "
- echo " https://ci.appveyor.com/project/$APPVEYOR_ACC_NAME/$APPVEYOR_PROJ_SLUG/history"
win32-installer:
- parallel:
- step:
name: User's Guide
image: natcap/userguide-build:fba743220031e1ba99b528a8939a86c8201da949
script:
# If setup.py --version fails, we'll get bad version
# info in the UG build.
- python setup.py --version
- make userguide
artifacts:
- dist/userguide/**
- dist/*.pdf
- dist/*.zip
- step:
name: Sample Data
image: debian:9.7
script:
- |
apt-get update &&
apt-get install -y git curl mercurial build-essential \
zip python-setuptools python-numpy python-setuptools-scm \
cython
- |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash &&
apt-get install -y git-lfs && git lfs install
- make sampledata
artifacts:
- dist/data/*
- data/invest-sample-data/*.json
- step:
name: Python Binaries
image: natcap/py27-wine-build:88e34494b14387af9bb66bf00232340848b5f996
caches:
- pip
script:
# The Atlassian image assumes that the pip cache is at ~/.cache/pip.
# Since we're using pip under WINE, we need to tell the WINE pip to
# use the cache directory (which speeds up this step by about 4
# minutes per run.
- export PIP_CACHE_DIR=$HOME/.cache/pip
- wine make env
- wine env/scripts/python.exe -m pip --cache-dir=$PIP_CACHE_DIR install --upgrade .
- wine env/scripts/python.exe -m pip --cache-dir=$PIP_CACHE_DIR install
-r requirements-gui.txt
-r requirements-dev.txt
-r requirements.txt
- wine make PYTHON=env/scripts/python.exe binaries python_packages
artifacts:
- dist/invest/**
- dist/natcap.invest*.whl
- dist/natcap.invest*.zip
- step:
name: NSIS Installer
image: natcap/py27-wine-build:3177b8530b70035d10ee75b9a52bf9085c797300
script:
# First, need to put the vcredist into the right place (no powershell under WINE)
- make build
- wget -nv -O build/vcredist_x86.exe
https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe
# Make relies on timestamps to check whether the targets need to be rebuilt,
# so touching the needed artifacts will make sure that Make uses these
# artifacts instead of rebuilding.
- mkdir doc/users-guide
- touch dist/*.pdf dist/userguide data/invest-sample-data
# Now we can run make.
# Need to set PYTHON_ARCH because for some reason the
# string isn't being correctly set.
- wine make PYTHON_ARCH=x86 windows_installer
# Code-signing
# Authenticate with the service account key to get certificate from bucket.
- echo ${GOOGLE_SERVICE_ACC_KEY} > client-secret.json
- gcloud auth activate-service-account --key-file=client-secret.json
- export INSTALLER=$(find dist -name 'InVEST*.exe')
- make CERT_KEY_PASS=${STANFORD_CERT_KEY_PASS} BIN_TO_SIGN=$INSTALLER signcode
artifacts:
- dist/*.exe
- step:
name: Deploy to bucket
image: google/cloud-sdk:latest
script:
# Build tools needed for running setup.py
- apt-get update && apt-get install -y make python-numpy cython python-pip mercurial
- pip install setuptools_scm
# Authenticate with the service account key and upload files to bucket.
- echo ${GOOGLE_SERVICE_ACC_KEY} > client-secret.json
- gcloud auth activate-service-account --key-file=client-secret.json
- make PYTHON_ARCH=x86 deploy