added deployment
Some checks failed
CSGOWTF/csgowtf/pipeline/head There was a failure building this commit

This commit is contained in:
2021-10-20 18:24:24 +02:00
parent 81e1bf251a
commit 67da621074
2 changed files with 39 additions and 0 deletions

27
Jenkinsfile vendored
View File

@@ -1,6 +1,11 @@
pipeline { pipeline {
agent any agent any
environment {
FTP_HOST = credentials('csgowtf-deploy-host')
FTP_PASSWORD = credentials('csgowtf-deploy-password')
}
stages { stages {
stage('Prepare') { stage('Prepare') {
steps { steps {
@@ -18,5 +23,27 @@ pipeline {
archiveArtifacts artifacts: '**/dist/**', excludes: '**/node_modules/**' archiveArtifacts artifacts: '**/dist/**', excludes: '**/node_modules/**'
} }
} }
stage('Deploy') {
when {
branch 'master'
}
environment {
FTP_USERNAME = credentials('csgowtf-deploy-user')
}
steps {
sh 'deploy.sh'
}
}
stage('Deploy Dev') {
when {
branch 'dev'
}
environment {
FTP_USERNAME = credentials('csgowtf-deploy-user-dev')
}
steps {
sh 'deploy.sh'
}
}
} }
} }

12
deploy.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
lftp -c "open -e \"set ftp:ssl-auth TLS; \
set ftp:ssl-force true; \
set ftp:ssl-protect-list yes; \
set ftp:ssl-protect-data yes; \
set ftp:ssl-protect-fxp yes; \
set ssl:verify-certificate no; \
rm -r *; \
mput dist/*; \" \
-u '$FTP_USERNAME','$FTP_PASSWORD' \
ftps://$FTP_HOST"