Skip to content

Commit

Permalink
Trying to fix the Jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
alecszaharia committed Sep 25, 2019
1 parent 65daebb commit b6c6c12
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pipeline {
agent any
environment {
GITHUB_TOKEN = credentials('git-token')
SUBVERSION_TOKEN = credentials('svn-secret')
}
stages {
stage('Version Update') {
Expand All @@ -119,21 +120,17 @@ pipeline {
sh "sed -i 's/Version:\\s.\\{1,\\}\\..\\{1,\\}\\..\\{1,\\}/Version: ${params.buildVersion}/' brizy.php"
sh "sed -i 's/^Stable tag:\\s.\\{1,\\}\\..\\{1,\\}\\..\\{1,\\}/Stable tag: ${params.buildVersion}/' readme.txt"
sh "sed -i 's/^Stable tag:\\s.[^<]*/Stable tag: ${params.buildVersion}/' README.md"
sh "sed -i \"s/'BRIZY_VERSION',\\s'.\\{1,\\}\\..\\{1,\\}\\..\\{1,\\}'/'BRIZY_VERSION', '${params.buildVersion}'/\" brizy.php"
sh "sed -i \"s/'BRIZY_VERSION',\\s'.*'/'BRIZY_VERSION', '${params.buildVersion}'/\" brizy.php"
sh "sed -i \"s/'BRIZY_EDITOR_VERSION',\\s'.*'/'BRIZY_EDITOR_VERSION', '${params.editorVersion}'/\" brizy.php"
sh "sed -i \"s/'BRIZY_DEVELOPMENT',.[^\\)]*/'BRIZY_DEVELOPMENT', false /\" brizy.php"
sh "sed -i \"s/'BRIZY_EDITOR_VERSION',\\s'.\\{1,\\}\\..\\{1,\\}\\..\\{1,\\}'/'BRIZY_EDITOR_VERSION', '${params.editorVersion}'/\" brizy.php"
sh "sed -i \"s/'BRIZY_LOG',.[^\\)]*/'BRIZY_LOG', false /\" brizy.php"

sh "sed -i \"s/== Changelog ==/== Changelog ==\\n\\n= ${params.buildVersion} - "+currentDate+" =\\n${changeLogs}/\" readme.txt"
sh "sed -i \"s/## Changelog/## Changelog\\n\\n### ${params.buildVersion} - "+currentDate+" ###\\n${changeLogs}/\" README.md"


}
}

stage('Prepare SVN') {
steps {

sh 'cd ' + params.brizySvnPath + ' && svn cleanup && svn revert . -R && svn up'
sh 'cd ' + params.brizySvnPath + ' && rm -rf trunk/*'
sh 'cp -r * '+ params.brizySvnPath + '/trunk/'
Expand Down Expand Up @@ -163,7 +160,17 @@ pipeline {
}
}

stage('Git Merge') {
stage('Publish') {
when {
expression { return params.svnCommit }
}
steps {
sh 'cd ' + params.brizySvnPath + ' && svn cp trunk tags/' + params.buildVersion
sh "cd " + params.brizySvnPath + " && svn commit --non-interactive --trust-server-cert --username themefusecom --password '$SUBVERSION_TOKEN' -m \"Version "+params.buildVersion+"\""
}
}

stage('Git Merge') {
when {
expression { return params.gitMerge }
}
Expand All @@ -180,16 +187,6 @@ pipeline {
}
}
}

stage('Publish') {
when {
expression { return params.svnCommit }
}
steps {
sh 'cd ' + params.brizySvnPath + ' && svn cp trunk tags/' + params.buildVersion
sh 'cd ' + params.brizySvnPath + ' && svn commit --non-interactive --trust-server-cert --username themefusecom --password \''+params.svnPassword+'\' -m "Version '+params.buildVersion+'"'
}
}
}

post {
Expand Down

0 comments on commit b6c6c12

Please sign in to comment.