mirror of
https://github.com/simon987/task_tracker_drone.git
synced 2025-04-19 10:16:42 +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 = [:]
|
def remote = [:]
|
||||||
remote.name = 'remote'
|
remote.name = 'remote'
|
||||||
remote.host = 'localhost'
|
remote.host = env.DEPLOY_HOST
|
||||||
remote.user = 'simon'
|
remote.user = env.DEPLOY_USER
|
||||||
remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa'
|
remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa'
|
||||||
remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts'
|
remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts'
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ pipeline {
|
|||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh './jenkins/build.sh'
|
sh './jenkins/build.sh'
|
||||||
stash includes: 'env/', name: 'env'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
@ -21,9 +20,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
steps {
|
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: 'jenkins/deploy.sh', into: 'task_tracker_drone/deploy.sh'
|
||||||
sshPut remote: remote, from: 'src', into: 'task_tracker_drone'
|
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'
|
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
|
virtualenv env --download --clear -p python3.7
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
deactivate
|
deactivate
|
||||||
|
|
||||||
|
@ -2,8 +2,15 @@
|
|||||||
|
|
||||||
export DRONEROOT="task_tracker_drone"
|
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
|
screen -S tt_drone -X quit
|
||||||
echo "starting drone"
|
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
|
sleep 1
|
||||||
screen -list
|
screen -list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user