Compare commits

..

No commits in common. "47162644837b3f03765f59b573159a1bc0c9a012" and "447504667f74d5d23080e34e56f5578dbfcb397d" have entirely different histories.

5 changed files with 10 additions and 16 deletions

4
.gitignore vendored
View File

@ -38,7 +38,3 @@ next-env.d.ts
#secret #secret
.env .env
#build
/pack
subman.tar.gz

7
Jenkinsfile vendored
View File

@ -9,6 +9,13 @@ agent any
steps{ steps{
sh 'npm install' sh 'npm install'
sh 'npm run build' 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'){ stage('deploy'){

View File

@ -5,7 +5,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build && ./package.sh", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"tailwind": "npx tailwindcss -i ./src/app/globals.css -o ./src/app/tailwind.css --watch" "tailwind": "npx tailwindcss -i ./src/app/globals.css -o ./src/app/tailwind.css --watch"

View File

@ -1,9 +0,0 @@
#!/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

View File

@ -17,7 +17,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
const url = request.nextUrl.clone() const url = request.nextUrl.clone()
url.pathname = "/login" url.pathname = "subman/login"
url.searchParams.set('from', request.nextUrl.pathname) url.searchParams.set('from', request.nextUrl.pathname)
if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) { if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) {
const token = request.cookies.get('token') 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 //TODO - TEST THIS BECAUSE IT PROBABLY DOESN'T WORK
//redirect from login if already logged in //redirect from login if already logged in
let redirectToApp = false let redirectToApp = false
if (request.nextUrl.pathname === "/login") { if (request.nextUrl.pathname === "subman/login") {
const token = request.cookies.get("token") const token = request.cookies.get("token")
if (token) { if (token) {
try { try {