Skip to content

Commit

Permalink
chore: add dev build scripts (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoopDog committed Aug 29, 2024
1 parent 8661914 commit 41a68c4
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 2 deletions.
3 changes: 3 additions & 0 deletions data-catalog/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_SITEMAP_DOMAIN='https://brc-analytics.dev.clevercanary.com'
NEXT_PUBLIC_BASE_PATH='/data'
SITEMAP_EXCLUDE='/export*,/login'
4 changes: 4 additions & 0 deletions data-catalog/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ npm-debug.log*

# favicons
/public/favicons/*


# Build Dir
/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

echo \"Deleting ./out/\"
rm -rf ./out

echo \"Deleting ./build/\"
rm -rf ./build

n 20.10.0
npm ci
export NEXT_PUBLIC_BASE_PATH="/data"

mkdir -p build/data

# Build AnVIL
rm -rf ./out
npm run build:local
mv out/* build/data

export BUCKET=s3://tik-brc-analytics.dev.data/
export SRCDIR=build/

aws s3 sync $SRCDIR $BUCKET --delete --profile excira
aws cloudfront create-invalidation --distribution-id E1OF5ESEGD5VAG --paths "/*" --profile excira
3 changes: 2 additions & 1 deletion data-catalog/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ const withMDX = nextMDX({
export default withPlugins(
[[withMDX, { pageExtensions: ["md", "mdx", "ts", "tsx"] }]],
{
basePath: "",
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "",
experimental: {
instrumentationHook: true,
},
images: {
unoptimized: true,
},
output: "export",
reactStrictMode: true,
transpilePackages: [...ESM_PACKAGES],
webpack: (config) => {
Expand Down
3 changes: 3 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ npm-debug.log*

# favicons
/public/favicons/*

# Build Dir
/build
11 changes: 10 additions & 1 deletion website/app/views/HomeView/homeView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
export const HomeView = (): JSX.Element => {
return <>Home</>;
return (
<>
<div>
<div>Home</div>
<div>
<a href="/data">Data</a>
</div>
</div>
</>
);
};
23 changes: 23 additions & 0 deletions website/cc-brc-analytics.dev.clevercanary.com-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

echo \"Deleting ./out/\"
rm -rf ./out

echo \"Deleting ./build/\"
rm -rf ./build

n 20.10.0
npm ci

mkdir -p build

# Build the website
rm -rf ./out
npm run build:local
mv out/* build

export BUCKET=s3://tik-brc-analytics.dev/
export SRCDIR=build/

aws s3 sync $SRCDIR $BUCKET --delete --profile excira
aws cloudfront create-invalidation --distribution-id E1OF5ESEGD5VAG --paths "/*" --profile excira
1 change: 1 addition & 0 deletions website/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default withPlugins(
images: {
unoptimized: true,
},
output: "export",
reactStrictMode: true,
transpilePackages: [...ESM_PACKAGES],
webpack: (config) => {
Expand Down

0 comments on commit 41a68c4

Please sign in to comment.