27 lines
		
	
	
		
			958 B
		
	
	
	
		
			Groovy
		
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			958 B
		
	
	
	
		
			Groovy
		
	
	
	
pipeline {
 | 
						|
agent any
 | 
						|
	environment{
 | 
						|
	JWT_SECRET=credentials('JWT_SECRET')
 | 
						|
	DATABASE_URL=credentials('DATABASE_URL')
 | 
						|
	}
 | 
						|
	stages{
 | 
						|
		stage('build'){
 | 
						|
			steps{
 | 
						|
				sh 'npm install'
 | 
						|
				sh 'npm run build'
 | 
						|
				sh 'mkdir  stagingDir'
 | 
						|
				sh 'cp -r public  stagingDir/'
 | 
						|
				sh 'cp -r prisma  stagingDir/'
 | 
						|
				sh 'cp -r .next/static  stagingDir/.next/'
 | 
						|
				sh 'cp -r .next/standalone/ stagingDir/'
 | 
						|
				sh ' tar -cf subman.tar.gz app '
 | 
						|
			}
 | 
						|
		}
 | 
						|
		stage('deploy'){
 | 
						|
			steps{
 | 
						|
				sshPublisher(publishers: [sshPublisherDesc(configName: 'Demos', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'ssh-uploads/subman/upgrade.sh', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'ssh-uploads/subman/', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'subman.tar.gz')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 |