I have a pipeline to Heroku app cloud for nodejs based frontend app.
Dont know how to fix this...
.yml file looks like this:
# 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.5.0
pipelines:
default:
- step:
# set HEROKU_API_KEY and HEROKU_APP_NAME environment variables
# set clone `depth: full' as described here: https://confluence.atlassian.com/x/Y9-5Mw
name: Deploy Koneviesti frontend to Heroku
# deployment: test # set to test, staging or production
# trigger: manual # uncomment to have a manual step
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master
The problem comes from pipeline run:
37s
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master
<1s
+ git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master
remote:
remote: ! Push rejected, source repository is a shallow clone. Unshallow it with `git fetch --all --unshallow` and try pushing again.
remote:
To https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git
! [remote rejected] HEAD -> master (shallow update not allowed)
error: failed to push some refs to 'https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git'
Fixed same problem by adding
git filter-branch -- --all
before the git push
It's works!!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me as well.
Does this line need to stay in the pipeline.yml file or can it be removed? (not sure if it's a one-time fix or if it needs to be there long-term)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By default git clone takes only last 50 commits, so if there is more changes in pipeline since last deploy, you should set to pipelines depth to full
clone:
enabled: true
depth: full
see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/ in section `depth`
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@rich @Marko Melko
try my solution
- step:
script:
- apk add git openssh-client
- git remote add [name] <repo_url>
- git remote -v
- git pull
- git checkout [branch]
- git filter-branch -- --all
- git push -u sync [branch]
Work for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I fixed this with clean repository and all worked very nicely.
GIT has goon to the "node" :)
When creating pipelines, remember to have fundamentals right. Then add pipeline setting and needed configurations for both ends. I know now this case, so remember to i.e. email me if have problems with heroku&bitbucket - marko.melko@live.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have idea what was the problem? I encountered this and don't want to clean the repo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.