Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOP-5023: Netlify Integration Calls Mut-Redirects #8

Merged
merged 48 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
720f6e8
DOP-5023 initialize integration
anabellabuckvar Sep 24, 2024
52d7d0c
DOP-5023 recreate integration
anabellabuckvar Sep 25, 2024
78dda6e
DOP-5023 small build script in build.sh
anabellabuckvar Sep 25, 2024
2573967
DOP-5023 add build.sh
anabellabuckvar Sep 25, 2024
af0c989
DOP-5023 small change to snooty-cache integration
anabellabuckvar Sep 25, 2024
e8baa4b
DOP-5023 logging
anabellabuckvar Sep 25, 2024
553c330
DOP-5023 logging
anabellabuckvar Sep 25, 2024
ec52b9a
DOP-5023 logging
anabellabuckvar Sep 25, 2024
865ab01
DOP-5023 logging
anabellabuckvar Sep 25, 2024
674c386
DOP-5023 run mut redirects
anabellabuckvar Sep 25, 2024
d022d2c
DOP-5023 hardcode mut version
anabellabuckvar Sep 25, 2024
688d0de
DOP-5023 logging
anabellabuckvar Sep 25, 2024
145263e
DOP-5023 logging
anabellabuckvar Sep 25, 2024
1f23e77
DOP-5023 run mut
anabellabuckvar Sep 25, 2024
f03ba92
DOP-5023 run mut
anabellabuckvar Sep 25, 2024
f291c1e
DOP-5023 run mut
anabellabuckvar Sep 25, 2024
9b21943
DOP-5023 run mut
anabellabuckvar Sep 25, 2024
4a7ef8a
DOP-5023 logging
anabellabuckvar Sep 25, 2024
0efdf5d
DOP-5023 logging
anabellabuckvar Sep 25, 2024
2c73ee6
DOP-5023 logging
anabellabuckvar Sep 25, 2024
9aa93fc
DOP-5023 logging
anabellabuckvar Sep 25, 2024
1a28184
DOP-5023 logging
anabellabuckvar Sep 25, 2024
855f1b4
DOP-5023 logging
anabellabuckvar Sep 25, 2024
06d0250
DOP-5023 logging
anabellabuckvar Sep 25, 2024
744df28
DOP-5023 logging
anabellabuckvar Sep 25, 2024
f0b5f13
DOP-5023 modify mut redirects command
anabellabuckvar Sep 26, 2024
69be4a3
DOP-5023 modify mut redirects command
anabellabuckvar Sep 26, 2024
bfec7e5
DOP-5023 modify mut redirects command
anabellabuckvar Sep 26, 2024
ca4219d
DOP-5023 modify mut redirects command
anabellabuckvar Sep 26, 2024
db825a8
DOP-5023 change where output file lives
anabellabuckvar Sep 26, 2024
ebf9cf7
DOP-5023 check for mut dir exists
anabellabuckvar Sep 26, 2024
ebed845
DOP-5023 clean
anabellabuckvar Sep 26, 2024
1d7c014
DOP-5023 clean
anabellabuckvar Sep 26, 2024
0ecbeba
DOP-5023 clean
anabellabuckvar Sep 26, 2024
9333445
DOP-5023 cleaning
anabellabuckvar Sep 26, 2024
5e4b39c
DOP-5023 last change
anabellabuckvar Sep 26, 2024
8ef63d5
DOP-5023 cleaning
anabellabuckvar Sep 26, 2024
926bc8b
Merge branch 'main' into DOP-5023
anabellabuckvar Sep 26, 2024
bfe90d1
DOP-5023 add try catch block
anabellabuckvar Sep 27, 2024
41f5b5e
DOP-5023 add try catch block
anabellabuckvar Sep 27, 2024
ff307e4
DOP-5023 fix close bracket
anabellabuckvar Sep 27, 2024
22c71d3
DOP-5023 show mut redirect errors
anabellabuckvar Sep 27, 2024
1f9bdbb
DOP-5023 show mut redirect errors
anabellabuckvar Sep 27, 2024
b8f26f3
DOP-5023 show mut redirect errors
anabellabuckvar Sep 27, 2024
da87b7f
DOP-5023 show mut redirect errors
anabellabuckvar Sep 27, 2024
5eb1ad2
DOP-5023 show mut redirect errors
anabellabuckvar Sep 27, 2024
c15fcc0
DOP-5023 change run command
anabellabuckvar Sep 27, 2024
9fbb8b1
DOP-5023 change run command
anabellabuckvar Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ dev-model.gql
documents

# Local Netlify folder
.netlify

.netlify
17 changes: 17 additions & 0 deletions snooty-cache/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import { NetlifyIntegration } from '@netlify/sdk';


import { readdir } from 'fs';

import { promisify } from 'util';
import { checkForNewSnootyVersion } from './snooty-frontend-version-check';


const readdirAsync = promisify(readdir);

const MUT_VERSION = "0.11.4";

const getCacheFilePaths = (filesPaths: string[]): string[] =>
filesPaths.filter((filePath) => filePath.endsWith('.cache.gz'));

Expand Down Expand Up @@ -54,6 +58,19 @@ integration.addBuildEventHandler(
},
);

integration.addBuildEventHandler("onSuccess", async ({ utils: { run } }) => {
console.log("Downloading Mut...");
await run.command(
`curl -L -o mut.zip https://github.com/mongodb/mut/releases/download/v${MUT_VERSION}/mut-v${MUT_VERSION}-linux_x86_64.zip`
);
await run.command("unzip -d . mut.zip");

console.log("Running mut-redirects...");
await run.command(
`${process.cwd()}/mut/mut-redirects config/redirects -o snooty/public/.htaccess`
);
});

integration.addBuildEventHandler(
'onEnd',
async ({ utils: { run, status } }) => {
Expand Down
Loading