Skip to content

Commit 99f54a8

Browse files
committed
Move Fastly purge into release script and use fastly CLI
1 parent 478def2 commit 99f54a8

2 files changed

Lines changed: 6 additions & 27 deletions

File tree

RELEASE.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,11 @@ This document simply outlines the release process:
2020

2121
9. Run the `scripts/release_hex.sh` script and set the path to the private key for Elixir `ELIXIR_PEM=path/to/elixir.pem ./scripts/release_hex.sh VERSION` where `VERSION` is the Hex version being released without a `v` prefix
2222

23-
10. Purge the `installs` surrogate key on the "Hex Builds Compute prod" Fastly service:
23+
10. Increment version and add `-dev` extension to versions (see below for all files)
2424

25-
```
26-
fastly purge --service-id GbeDoh1ZO7MEM3zut4K2fR --key installs
27-
sleep 5
28-
fastly purge --service-id GbeDoh1ZO7MEM3zut4K2fR --key installs
29-
```
25+
11. Commit changes above with title "Bump to vVERSION-dev"
3026

31-
11. Increment version and add `-dev` extension to versions (see below for all files)
32-
33-
12. Commit changes above with title "Bump to vVERSION-dev"
34-
35-
13. Push main
27+
12. Push main
3628

3729
## All builds
3830

scripts/release_hex.sh

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# Usage:
44
#
55
# $ ELIXIR_PEM=/path/to/elixir.pem \
6-
# HEX_FASTLY_KEY=... \
7-
# HEX_FASTLY_BUILDS_SERVICE_ID=... \
6+
# FASTLY_API_TOKEN=... \
87
# release_hex.sh HEX_VERSION
98
#
109
# Pass --dry-run to build archives without uploading:
@@ -86,9 +85,9 @@ function main {
8685
s3up "${path}" "${path}"
8786
done
8887

89-
purge_key "${HEX_FASTLY_BUILDS_SERVICE_ID}" "installs"
88+
fastly service purge --service-id GbeDoh1ZO7MEM3zut4K2fR --key installs
9089
sleep 5
91-
purge_key "${HEX_FASTLY_BUILDS_SERVICE_ID}" "installs"
90+
fastly service purge --service-id GbeDoh1ZO7MEM3zut4K2fR --key installs
9291
else
9392
echo "ELIXIR_PEM is empty, skipping"
9493
exit 1
@@ -162,16 +161,4 @@ function s3down {
162161
aws s3 cp "s3://s3.hex.pm/installs/${1}" "${2}"
163162
}
164163

165-
# $1 = service
166-
# $2 = key
167-
function purge_key() {
168-
curl \
169-
--fail \
170-
-X POST \
171-
-H "Fastly-Key: ${HEX_FASTLY_KEY}" \
172-
-H "Accept: application/json" \
173-
-H "Content-Length: 0" \
174-
"https://api.fastly.com/service/$1/purge/$2"
175-
}
176-
177164
main $*

0 commit comments

Comments
 (0)