-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run on Jenkins #329
Comments
@kreck the issue arises from the fact that jenkins checks out the head commit directly and the tree is in a "detatched HEAD state". You can resolve this in jenkins by just running |
@zakhenry you saved my Friday evening. It is working. Thank you very much! |
Hi @kreck! Could you share your semantic-release configuration integrated with jenkins? I do not find enough information about that. Many thanks |
@janppires Sure, first you add the relevant tokens (GiHub/npm) to the credentials keychain in Jenkins. Then you simply set up a build task (in my case triggered via GitHub Webhooks). Make sure node is available in your PATH and simply run a "Shell" build script: git checkout master
set +x
export NPM_TOKEN=${NPM_TOKEN}
export GH_TOKEN=${GH_TOKEN}
set -x
npm prune
npm install
npm run cover
npm run check-coverage
npm run build
npm run semantic-release Hope that helps.... |
Thanks @kreck ! That seems easy! Another problem I have is the fact that I do not want to use the default npm repo. I need to figure out how to setup artifactory instead. |
Hi guys! what about the
And can make it work on Jenkins I have found this https://github.com/krux/condition-jenkins but not sure if it will be needed/required Thanks, |
* chg: add Jenkinsfile At the minute it will just run the tests * chg: add semantic-release-cli * chg: add missed npm install * Use correct semantic-release commands * fix: command to be exec inside the docker image * fix: semantic-release-cli command * fix: misunderstanding with -cli (๑˃̵ᴗ˂̵)و * chg: use G/H token instead of ssh key * fix: checkout master Following semantic-release/semantic-release#329 * fix: change approach and use sh command for docker for the semantic command * Add release block to package.json for semantic-release configuration * chg: add check for master branch * chg: improve slack message * fix: run tests on any branch not just master
We kind of fix part of the problem using the project mention before and adding this to our
And our Jenkins command that will run the
However still getting an error this time a different one
Any ideas? Thanks, |
It's have to be something related with how Jenkisfile process the commands, some kind of encoding error I think because the command it self works perfectly if you run it manually from the shell either local or from the Jenkins server host |
Problem solve it behaved different because the way I was getting the token on the Jenkinsfile was different that when I execute the command from the host, check for more info npm/npm-registry-client#159 ta If it does helps someone this is how our Jenkinsfile looks like https://github.com/moltin/js-sdk/blob/master/Jenkinsfile |
Closing as the problem seems to be solved. Please reopen if it's not the case |
I prefer using Jenkins instead of Travis but i am unable to get semantic-release running on the Jenkins Server.
This the error thrown when running on Jenkins:
It does however run locally on my machine without any problem.
Things i tried:
I'd be glad for any hints that point me in the right direction....
The text was updated successfully, but these errors were encountered: