-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackendBuild.js
31 lines (26 loc) · 1.05 KB
/
backendBuild.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// build.js
const { spawnSync } = require('child_process')
function buildPython() {
console.log('Creating Python distribution files...')
const app = './backend/run.py'
const options = [
'--name=dockman_server',
'--noconsole', // No shell
'--noconfirm', // Don't confirm overwrite
'--distpath=./resources', // Dist (out) path
// '--hidden-import=flask', // Ensure Flask is included
// '--hidden-import=sqlalchemy', // Ensure SQLAlchemy is included
// '--hidden-import=alembic', // Ensure Alembic is included
// '--hidden-import=flask_sqlalchemy', // Ensure Flask-SQLAlchemy is included
// '--hidden-import=flask_migrate', // Ensure Flask-Migrate is included
// '--add-data=backend/backend/migrations:./backend/migrations', // Include the migrations directory
`${app}`
]
const result = spawnSync('pyinstaller', options, { stdio: 'inherit' })
if (result.error) {
console.error('Error during build:', result.error)
} else {
console.log('Python distribution files created successfully!')
}
}
buildPython()