Jenkins build

This commit is contained in:
simon987 2019-04-14 09:40:24 -04:00
parent 69af3ba908
commit 5bcb671356
3 changed files with 11 additions and 7 deletions

7
jenkins/Jenkinsfile vendored
View File

@ -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'
}
}

View File

@ -3,7 +3,5 @@
virtualenv env --download --clear -p python3.7
source env/bin/activate
python --version
pip install -r requirements.txt
deactivate

View File

@ -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