Compare commits
3 Commits
447504667f
...
4716264483
Author | SHA1 | Date |
---|---|---|
|
4716264483 | |
|
5fb913b6a3 | |
|
19109b2b35 |
|
@ -38,3 +38,7 @@ next-env.d.ts
|
|||
#secret
|
||||
.env
|
||||
|
||||
#build
|
||||
/pack
|
||||
subman.tar.gz
|
||||
|
||||
|
|
|
@ -9,13 +9,6 @@ agent any
|
|||
steps{
|
||||
sh 'npm install'
|
||||
sh 'npm run build'
|
||||
sh 'mkdir standalone'
|
||||
sh 'cp -r public standalone/'
|
||||
sh 'cp -r prisma standalone/'
|
||||
sh 'cp -r .next/static standalone/.next/'
|
||||
sh 'cp -r .next/standalone/** standalone/'
|
||||
sh ' tar -cf subman.tar.gz standalone '
|
||||
sh 'rm -r standalone'
|
||||
}
|
||||
}
|
||||
stage('deploy'){
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"build": "next build && ./package.sh",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"tailwind": "npx tailwindcss -i ./src/app/globals.css -o ./src/app/tailwind.css --watch"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
mkdir pack
|
||||
cp -r public pack/
|
||||
cp -r prisma pack/
|
||||
cp -r .next/standalone/. pack/
|
||||
cp -r .next/static pack/.next/
|
||||
tar -cf subman.tar.gz pack
|
||||
rm -r pack
|
|
@ -17,7 +17,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
|
|||
|
||||
|
||||
const url = request.nextUrl.clone()
|
||||
url.pathname = "subman/login"
|
||||
url.pathname = "/login"
|
||||
url.searchParams.set('from', request.nextUrl.pathname)
|
||||
if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) {
|
||||
const token = request.cookies.get('token')
|
||||
|
@ -47,7 +47,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
|
|||
//TODO - TEST THIS BECAUSE IT PROBABLY DOESN'T WORK
|
||||
//redirect from login if already logged in
|
||||
let redirectToApp = false
|
||||
if (request.nextUrl.pathname === "subman/login") {
|
||||
if (request.nextUrl.pathname === "/login") {
|
||||
const token = request.cookies.get("token")
|
||||
if (token) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue