32 lines
810 B
Python
32 lines
810 B
Python
import subprocess
|
|
|
|
def run_command(command):
|
|
"""Run a shell command."""
|
|
try:
|
|
subprocess.run(command, check=True, shell=True)
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"Error executing command: {command}")
|
|
print(e)
|
|
exit(1)
|
|
|
|
def main():
|
|
# Define the commands you want to run
|
|
commands = [
|
|
# 'git clone https://github.com/yourusername/yourproject.git',
|
|
'cd vue-project && git pull',
|
|
'cd vue-project && npm install',
|
|
'cd vue-project && npm run build',
|
|
|
|
'git pull',
|
|
'npm install',
|
|
'cp -r vue-project/dist/* ./dist'
|
|
'npm start'
|
|
]
|
|
|
|
# Run each command in sequence
|
|
for cmd in commands:
|
|
print(f"Executing: {cmd}")
|
|
run_command(cmd)
|
|
|
|
if __name__ == '__main__':
|
|
main() |