@@ -50,6 +50,23 @@ commands:
50
50
- /home/circleci/.nix-channels
51
51
- /home/circleci/.nix-defexpr
52
52
- /home/circleci/.config/nix
53
+ setup_python :
54
+ description : Set up Python
55
+ steps :
56
+ - run :
57
+ name : setup_python
58
+ command : |
59
+ set -euo pipefail
60
+ . /home/circleci/.nix-profile/etc/profile.d/nix.sh
61
+ nix-shell shell.nix \
62
+ --pure \
63
+ --run bash \<<'EOF'
64
+ set -euo pipefail
65
+
66
+ python3 -m venv .python-env
67
+ source .python-env/bin/activate
68
+ python -m pip install -r requirements.txt
69
+ EOF
53
70
54
71
jobs :
55
72
build_docs :
@@ -60,11 +77,11 @@ jobs:
60
77
steps :
61
78
- checkout
62
79
- setup_nix
80
+ - setup_python
63
81
- run :
64
82
name : build
65
83
command : |
66
84
set -euo pipefail
67
-
68
85
. /home/circleci/.nix-profile/etc/profile.d/nix.sh
69
86
70
87
mkdir -p /tmp/workspace
75
92
--keep ARTIFACTORY_PASSWORD \
76
93
--run bash \<<'EOF'
77
94
set -euo pipefail
78
- docs/download.sh
79
- docs/build.sh
80
- mv docs/workdir/target/html-docs-*.tar.gz /tmp/workspace/
95
+ source .python-env/bin/activate
96
+ PATH="$(pwd)/.python-env/bin:$PATH"
97
+ prefix=$(jq -r '.prefix' versions.json)
98
+ if [[ ${#prefix} -lt 5 ]]; then
99
+ echo "Pushhing to $prefix is not currently supported."
100
+ exit 1
101
+ fi
102
+ bin/build
103
+ mv workdir/target/html-docs-*.tar.gz /tmp/workspace/
81
104
EOF
82
105
- store_artifacts :
83
106
path : /tmp/workspace
@@ -109,11 +132,16 @@ jobs:
109
132
--run bash \<<'EOF'
110
133
set -euo pipefail
111
134
112
- prefix=$(jq -r '.prefix' LATEST)
113
- sdk_version=$(jq -r '.daml' LATEST)
135
+ prefix=$(jq -r '.prefix' versions.json)
136
+ sdk_version=$(jq -r '.daml' versions.json)
137
+ if [[ ${#prefix} -lt 5 ]]; then
138
+ echo "Pushhing to $prefix is not currently supported."
139
+ exit 1
140
+ fi
114
141
115
142
upload=$(mktemp -d)
116
143
tar xf /tmp/workspace/html-docs-$sdk_version.tar.gz -C $upload --strip-components=1
144
+ aws s3 rm s3://docs-daml-com/$prefix --recursive --region us-east-1
117
145
aws s3 cp $upload s3://docs-daml-com/$prefix --recursive --acl public-read --region us-east-1
118
146
aws cloudfront create-invalidation --distribution-id E1U753I56ERH55 --paths "/$prefix/*"
119
147
EOF
@@ -126,6 +154,7 @@ jobs:
126
154
steps :
127
155
- checkout
128
156
- setup_nix
157
+ - setup_python
129
158
- run :
130
159
name : push
131
160
command : |
@@ -141,6 +170,8 @@ jobs:
141
170
--keep AWS_SECRET_ACCESS_KEY \
142
171
--run bash \<<'EOF'
143
172
set -euo pipefail
173
+ source .python-env/bin/activate
174
+ PATH="$(pwd)/.python-env/bin:$PATH"
144
175
145
176
snapshots=$(curl -sf https://docs.daml.com/snapshots.json \
146
177
| jq -r '
@@ -189,7 +220,8 @@ jobs:
189
220
if curl -Ifs https://docs.daml.com/$version/index.html &> /dev/null
190
221
then echo "-> Nothing to do."
191
222
elif [ "$version" = "2.0.1-snapshot.20220419.9374.0.44df8f12" ] \
192
- || [ "$version" = "2.1.0-snapshot.20220411.9707.0.f6fed6ea" ]
223
+ || [ "$version" = "2.1.0-snapshot.20220411.9707.0.f6fed6ea" ] \
224
+ || [ "$version" = "2.5.0-snapshot.20221010.10736.0.2f453a14" ]
193
225
then echo "-> Skipping, known broken."
194
226
else
195
227
echo "-> Getting Canton version"
@@ -203,20 +235,21 @@ jobs:
203
235
| grep canton \
204
236
| head -1 \
205
237
| sed 's/canton-open-source-\(.*\)\.tar\.gz/\1/')
206
- echo "-> Building daml $version with canton $canton."
238
+ finance=$(git show origin/main:versions.json | jq -r '.daml_finance')
239
+ echo "-> Building daml $version with canton $canton & finance $finance."
207
240
jq -n \
208
241
--arg daml $version \
209
242
--arg canton $canton \
210
- '{daml: $daml, canton: $canton, prefix: $daml}' \
211
- > LATEST
243
+ --arg finance $finance \
244
+ '{daml: $daml, canton: $canton, prefix: $daml, daml_finance: $finance}' \
245
+ > versions.json
212
246
213
- docs/download.sh
214
- docs /build.sh
247
+ bin/clean
248
+ bin /build
215
249
upload=$(mktemp -d)
216
- tar xf docs/ workdir/target/html-docs-$version.tar.gz -C $upload --strip-components=1
250
+ tar xf workdir/target/html-docs-$version.tar.gz -C $upload --strip-components=1
217
251
aws s3 cp $upload s3://docs-daml-com/$version --recursive --acl public-read --region us-east-1
218
252
aws cloudfront create-invalidation --distribution-id E1U753I56ERH55 --paths "/$version/*"
219
- rm -rf docs/workdir
220
253
echo "-> Done."
221
254
fi
222
255
echo
0 commit comments