Hello, I followed the instructions here and here to get a bitbucket pipelines yaml file set up, create a SSH key for the private repo running the build and setting that SSH key as an access token on the private repo being included in the build but I am unable to authenticate successfully. Is this a limitation with the node image or is my configuration incorrect?
bitbucket-pipelines.yml
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.1
pipelines:
pull-requests:
develop:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test
package.json
{
...,
"dependencies": {
...,
"private-package": "git+https://bitbucket.org/{projectName}/{repoName}.git#v0.7.3",
npm install
+ npm install
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://bitbucket.org/{projectName}/{repoName}.git
npm ERR!
npm ERR! remote: Invalid username or password
npm ERR! fatal: Authentication failed for 'https://bitbucket.org/{projectName}/{repoName}.git'
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-08T14_12_45_712Z-debug.log
repo running pipeline build
private repo being included in pipeline build
It looks like you're using the https version of the git url - you need to go into Bitbucket and select "clone" and then select the "ssh" url and use that in your package.json.
that was the issue, it's working now. thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks so much! I am finally able to npm pull & install from pipeline.
I had another problem, if I replace the https url on package.json with a ssh one... then I wont be able to do npm install on my local computer ( access denied error )... any thoughs? thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
"dependencies": {
"private-package": "bitbucket:<owner>/<repo>"
}
Source: https://mskutta.github.io/2018/05/25/private-npm-packages-in-bitbucket/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.