mirror of
https://github.com/simon987/task_tracker_drone.git
synced 2025-04-10 14:06:46 +00:00
Jenkins build
This commit is contained in:
parent
69af3ba908
commit
5bcb671356
7
jenkins/Jenkinsfile
vendored
7
jenkins/Jenkinsfile
vendored
@ -1,7 +1,7 @@
|
||||
def remote = [:]
|
||||
remote.name = 'remote'
|
||||
remote.host = 'localhost'
|
||||
remote.user = 'simon'
|
||||
remote.host = env.DEPLOY_HOST
|
||||
remote.user = env.DEPLOY_USER
|
||||
remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa'
|
||||
remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts'
|
||||
|
||||
@ -11,7 +11,6 @@ pipeline {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './jenkins/build.sh'
|
||||
stash includes: 'env/', name: 'env'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
@ -21,9 +20,9 @@ pipeline {
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sshPut remote: remote, from: 'env', into: 'task_tracker_drone'
|
||||
sshPut remote: remote, from: 'jenkins/deploy.sh', into: 'task_tracker_drone/deploy.sh'
|
||||
sshPut remote: remote, from: 'src', into: 'task_tracker_drone'
|
||||
sshPut remote: remote, from: 'requirements.txt', into: 'task_tracker_drone'
|
||||
sshCommand remote: remote, command: 'chmod +x task_tracker_drone/deploy.sh && ./task_tracker_drone/deploy.sh'
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,5 @@
|
||||
virtualenv env --download --clear -p python3.7
|
||||
source env/bin/activate
|
||||
python --version
|
||||
|
||||
pip install -r requirements.txt
|
||||
deactivate
|
||||
|
||||
|
@ -2,8 +2,15 @@
|
||||
|
||||
export DRONEROOT="task_tracker_drone"
|
||||
|
||||
cd ${DRONEROOT}
|
||||
virtualenv env --download --clear -p python3.7
|
||||
source env/bin/activate
|
||||
python --version
|
||||
pip install -r requirements.txt
|
||||
deactivate
|
||||
|
||||
screen -S tt_drone -X quit
|
||||
echo "starting drone"
|
||||
screen -S tt_drone -d -m bash -c "cd ${DRONEROOT} && source env/bin/activate && python src/drone.py"
|
||||
screen -S tt_drone -d -m bash -c "source env/bin/activate && python src/drone.py"
|
||||
sleep 1
|
||||
screen -list
|
||||
|
Loading…
x
Reference in New Issue
Block a user