Moved scripts to other repo, CI setup

This commit is contained in:
simon987
2019-05-08 20:58:13 -04:00
parent 0acffff609
commit 0e998eaf9b
49 changed files with 597 additions and 905 deletions

41
jenkins/Jenkinsfile vendored
View File

@@ -0,0 +1,41 @@
def remote = [:]
remote.name = 'remote'
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'
remote.allowAnyHosts = true
remote.retryCount = 3
remote.retryWaitSec = 3
logLevel = 'FINER'
pipeline {
stages {
stage('Build') {
agent {
docker {
image 'node:10-alpine'
args '--network "host"'
}
}
steps {
sh 'cd music_graph/ && npm install && npm audit fix && npm run build'
sh 'mv music_graph/dist webroot'
stash includes: 'webroot/', name: 'webdist'
}
}
stage('Deploy') {
agent none
steps {
node('master') {
unstash 'webdist'
sshCommand remote: remote, command: "cd simon987 && rm -rf webroot/* deploy.sh"
sshPut remote: remote, from: 'webroot/', into: 'music-graph'
sshPut remote: remote, from: 'jenkins/deploy.sh', into: 'music-graph/'
sshCommand remote: remote, command: 'chmod +x music-graph/deploy.sh && ./music-graph/deploy.sh'
}
}
}
}
}

View File

@@ -1,4 +1 @@
#!/usr/bin/env bash
git submodule init
git submodule update --remote

View File

@@ -1 +1,5 @@
#!/usr/bin/env bash
export MGROOT="music-graph"
chmod 755 -R "${MGROOT}/webroot"