From d17ce3ac70efc7da0f25800df2060c52a14c3ab4 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Wed, 4 May 2022 16:18:09 -0400 Subject: [PATCH] Test when --- Jenkinsfile | 79 +++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 49ede84..2e2b217 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,60 +64,61 @@ pipeline { } script { - env.MIMIC3_TAG_NAME = sh(returnStdout: true, script: "git tag --sort=-creatordate | head -n 1").trim() - env.PLUGIN_TAG_NAME = sh(returnStdout: true, script: "cd plugin-tts-mimic3 && git tag --sort=-creatordate | head -n 1").trim() + // Get individual tags + env.MIMIC3_TAG_NAME = sh( + returnStdout: true, + script: "git tag --contains --sort=-creatordate | head -n 1" + ).trim() + + env.PLUGIN_TAG_NAME = sh( + returnStdout: true, + script: "cd plugin-tts-mimic3 && git tag --contains --sort=-creatordate | head -n 1" + ).trim() } } } - stage('test') { + // Copy default voice + stage('Copy voices') { steps { - echo "${env.MIMIC3_TAG_NAME}" - echo "${env.PLUGIN_TAG_NAME}" + sh 'mkdir -p voices/${DEFAULT_VOICE}' + sh 'rsync -r --link-dest="${DEFAULT_VOICE_PATH}/${DEFAULT_VOICE}/" "${DEFAULT_VOICE_PATH}/${DEFAULT_VOICE}/" voices/${DEFAULT_VOICE}/' } } - // Copy default voice - // stage('Copy voices') { - // steps { - // sh 'mkdir -p voices/${DEFAULT_VOICE}' - // sh 'rsync -r --link-dest="${DEFAULT_VOICE_PATH}/${DEFAULT_VOICE}/" "${DEFAULT_VOICE_PATH}/${DEFAULT_VOICE}/" voices/${DEFAULT_VOICE}/' - // } - // } - // Build, test, and publish plugin distribution package to PyPI - // stage('Plugin dist') { - // steps { - // sh 'make plugin-dist' - // } - // } + stage('Plugin dist') { + steps { + sh 'make plugin-dist' + } + } // Create a new tagged Github release with source distribution for Mycroft plugin - // stage('Publish plugin') { - // environment { - // GITHUB_REPO = 'plugin-tts-mimic3' - // TAG_NAME = 'release/v0.2.0' - // PLUGIN_VERSION = readFile(file: 'plugin-tts-mimic3/mycroft_plugin_tts_mimic3/VERSION').trim() - // } + stage('Publish plugin') { + environment { + GITHUB_REPO = 'plugin-tts-mimic3' + TAG_NAME = 'release/v0.2.0' + PLUGIN_VERSION = readFile(file: 'plugin-tts-mimic3/mycroft_plugin_tts_mimic3/VERSION').trim() + } - // when { - // expression { - // env.TAG_NAME.startsWith('release/') - // } - // } + when { + expression { + return env.PLUGIN_TAG_NAME.startsWith('foo/') + } + } - // steps { - // // TODO: Publish to PyPI - // // sh 'twine upload --skip-existing --user ${PYPI_USR} ${PYPI_PSW} dist/mycroft_plugin_tts_mimic3-${PLUGIN_VERSION}.tar.gz' + steps { + // TODO: Publish to PyPI + // sh 'twine upload --skip-existing --user ${PYPI_USR} ${PYPI_PSW} dist/mycroft_plugin_tts_mimic3-${PLUGIN_VERSION}.tar.gz' - // // Delete release for tag, if it exists - // sh 'scripts/delete-tagged-release.sh ${GITHUB_OWNER} ${GITHUB_REPO} ${TAG_NAME} ${GITHUB_PSW}' + // Delete release for tag, if it exists + sh 'scripts/delete-tagged-release.sh ${GITHUB_OWNER} ${GITHUB_REPO} ${TAG_NAME} ${GITHUB_PSW}' - // // Create new tagged release and upload assets - // sh 'scripts/create-tagged-release.sh ${GITHUB_OWNER} ${GITHUB_REPO} ${TAG_NAME} ${GITHUB_PSW}' + - // ' dist/mycroft_plugin_tts_mimic3-${PLUGIN_VERSION}.tar.gz application/gzip' - // } - // } + // Create new tagged release and upload assets + sh 'scripts/create-tagged-release.sh ${GITHUB_OWNER} ${GITHUB_REPO} ${TAG_NAME} ${GITHUB_PSW}' + + ' dist/mycroft_plugin_tts_mimic3-${PLUGIN_VERSION}.tar.gz application/gzip' + } + } // Build, test, and publish source distribution packages to PyPI // stage('Dist') {