Some checks failed
CSGOWTF/csgowtf/pipeline/head Something is wrong with the build of this commit
58 lines
1.5 KiB
Groovy
58 lines
1.5 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
environment {
|
|
FTP_HOST = credentials('csgowtf-deploy-host')
|
|
FTP_PASSWORD = credentials('csgowtf-deploy-password')
|
|
}
|
|
|
|
stages {
|
|
stage('Prepare') {
|
|
steps {
|
|
writeFile file: '.env.prodution', text: 'VUE_APP_API_URL=https://api.csgow.tf'
|
|
}
|
|
}
|
|
stage('Install Dependencies') {
|
|
steps {
|
|
sh 'yarn install'
|
|
}
|
|
}
|
|
stage('Build') {
|
|
steps {
|
|
sh 'yarn build'
|
|
archiveArtifacts artifacts: '**/dist/**', excludes: '**/node_modules/**'
|
|
}
|
|
}
|
|
stage('Deploy') {
|
|
when {
|
|
branch 'master'
|
|
expression {
|
|
currentBuild.result == null || currentBuild.result == 'SUCCESS'
|
|
}
|
|
}
|
|
environment {
|
|
FTP_USERNAME = credentials('csgowtf-deploy-user')
|
|
}
|
|
steps {
|
|
sh 'chmod u+x ./deploy.sh'
|
|
sh './deploy.sh'
|
|
}
|
|
}
|
|
stage('Deploy Dev') {
|
|
when {
|
|
branch 'dev'
|
|
expression {
|
|
currentBuild.result == null || currentBuild.result == 'SUCCESS'
|
|
}
|
|
}
|
|
environment {
|
|
FTP_USERNAME = credentials('csgowtf-deploy-user-dev')
|
|
}
|
|
steps {
|
|
sh 'chmod u+x ./deploy.sh'
|
|
sh './deploy.sh'
|
|
}
|
|
}
|
|
}
|
|
}
|