Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
cc2689de
Unverified
Commit
cc2689de
authored
May 25, 2021
by
Benjamin Wheeler
Committed by
GitHub
May 25, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4792 from benjiwheeler/assets-surrogate
set, purge static_assets surrogate key on deploy
parents
1a76ecf9
37a5dd93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
bin/configure-fastly.js
bin/configure-fastly.js
+5
-6
package.json
package.json
+1
-1
No files found.
bin/configure-fastly.js
View file @
cc2689de
...
...
@@ -270,12 +270,11 @@ async.auto({
fastly
.
activateVersion
(
results
.
version
,
function
(
e
,
resp
)
{
if
(
e
)
throw
new
Error
(
e
);
process
.
stdout
.
write
(
'
Successfully configured and activated version
'
+
resp
.
number
+
'
\n
'
);
if
(
process
.
env
.
FASTLY_PURGE_ALL
)
{
fastly
.
purgeAll
(
FASTLY_SERVICE_ID
,
function
(
error
)
{
if
(
error
)
throw
new
Error
(
error
);
process
.
stdout
.
write
(
'
Purged all.
\n
'
);
});
}
// purge static-assets using surrogate key
fastly
.
purgeKey
(
FASTLY_SERVICE_ID
,
'
static-assets
'
,
function
(
error
)
{
if
(
error
)
throw
new
Error
(
error
);
process
.
stdout
.
write
(
'
Purged static assets.
\n
'
);
});
});
}
});
package.json
View file @
cc2689de
...
...
@@ -27,7 +27,7 @@
"deploy"
:
"npm run deploy:s3 && npm run deploy:fastly"
,
"deploy:fastly"
:
"node ./bin/configure-fastly.js"
,
"deploy:s3"
:
"npm run deploy:s3:all && npm run deploy:s3:svg && npm run deploy:s3:js"
,
"deploy:s3cmd"
:
"s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600"
,
"deploy:s3cmd"
:
"s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
--add-header=x-amz-meta-surrogate-key:static-assets
"
,
"deploy:s3:all"
:
"npm run deploy:s3cmd -- --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$S3_BUCKET_NAME/"
,
"deploy:s3:svg"
:
"npm run deploy:s3cmd -- --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$S3_BUCKET_NAME/"
,
"deploy:s3:js"
:
"npm run deploy:s3cmd -- --exclude '*' --include '*.js' --mime-type 'application/javascript' ./build/ s3://$S3_BUCKET_NAME/"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment