mirror of
https://github.com/simon987/music-graph-ui.git
synced 2025-12-16 08:09:03 +00:00
Moved scripts to other repo, CI setup
This commit is contained in:
41
jenkins/Jenkinsfile
vendored
41
jenkins/Jenkinsfile
vendored
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
git submodule init
|
||||
git submodule update --remote
|
||||
@@ -1 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export MGROOT="music-graph"
|
||||
|
||||
chmod 755 -R "${MGROOT}/webroot"
|
||||
|
||||
Reference in New Issue
Block a user