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