Compare commits
	
		
			No commits in common. "47162644837b3f03765f59b573159a1bc0c9a012" and "447504667f74d5d23080e34e56f5578dbfcb397d" have entirely different histories.
		
	
	
		
			4716264483
			...
			447504667f
		
	
		| 
						 | 
				
			
			@ -38,7 +38,3 @@ next-env.d.ts
 | 
			
		|||
#secret
 | 
			
		||||
.env
 | 
			
		||||
 | 
			
		||||
#build
 | 
			
		||||
/pack
 | 
			
		||||
subman.tar.gz
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,13 @@ 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 && ./package.sh",
 | 
			
		||||
    "build": "next build",
 | 
			
		||||
    "start": "next start",
 | 
			
		||||
    "lint": "next lint",
 | 
			
		||||
    "tailwind": "npx tailwindcss -i ./src/app/globals.css -o ./src/app/tailwind.css --watch"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
	const url = request.nextUrl.clone()
 | 
			
		||||
	url.pathname = "/login"
 | 
			
		||||
	url.pathname = "subman/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 === "/login") {
 | 
			
		||||
		if (request.nextUrl.pathname === "subman/login") {
 | 
			
		||||
			const token = request.cookies.get("token")
 | 
			
		||||
			if (token) {
 | 
			
		||||
				try {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue