-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
30 lines (29 loc) · 1.05 KB
/
Jenkinsfile
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
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'YTD-ssh', url: '[email protected]:ZeroNiki/Youtube-Downloader-Bot.git']])
}
}
stage('Build') {
steps {
git branch: 'main', credentialsId: 'YTD-ssh', url: '[email protected]:ZeroNiki/Youtube-Downloader-Bot.git'
sh 'touch .env'
sh 'rm .env'
sh 'mkdir -p output/video output/mp3 output/jpg'
sh 'ls -ld /var/lib/YTD-db/'
sh 'echo "TOKEN=6029591492:AAGpbHWKlTCYegMipoNqBHkfi6YhCWo2UYQ" >> .env'
sh 'echo "ADMIN=664884438" >> .env'
sh 'python3 -m venv venv'
sh '. venv/bin/activate'
sh 'pip install -r requirements.txt'
}
}
stage('Deploy') {
steps {
sh 'nohup python3 main.py > logfile.log &2>&1 &'
}
}
}
}