Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

repository with git lfs, and pipeline attempting to push a tag

Jason Harrison June 17, 2021

We have a bitbucket repository with a custom pipeline to tag the repo with the current version. I have had to add steps to install git-lfs. Why is git-lfs not already installed in the pipeline image (python 3.6.9) and is there a better way to perform this installation?

 

custom: # Pipelines that can only be triggered manually 
deployment-to-prod:
- step:
name: Tag git
script:
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
-
apt-get -y install git-lfs zip
- package_version=$(cat VERSION)
- git_tag="v$package_version"echo "Git tag=$git_tag"
- git tag --force --annotate --message "$git_tag from ${BITBUCKET_BUILD_NUMBER}" $git_tag
- git push --tags --force

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2021

Hi Jason,

Bitbucket Pipelines supports any public and private Docker images hosted on Docker Hub, AWS, GCP, Azure, and self-hosted registries accessible on the internet. Atlassian has built a Docker image that can be used for Pipelines builds if it suits your needs (https://hub.docker.com/r/atlassian/default-image/), however, we don't own every Docker image hosted in each of the above registries, like e.g. the python one. The owner of each Docker image decides what tools/applications are pre-installed in that image.

Checking the documentation on the Git LFS repo, the instructions for installing Git LFS in Debian and Ubuntu seem to be the ones you are using in your yml file as well:

One thing you can do is look if there is a publicly available Docker image that has all the tools you need pre-installed. If you cannot find one, you can also create your own custom Docker image that has all the tools you need for your build (including Git LFS) and use that instead. If you'd be interested in that, you can check the links we have in our documentation:

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Jason Harrison July 12, 2021

Thank you. I have copied the script into my repository to avoid foreign script execution attacks.

I will consider building a docker image. The trade offs between downloading a custom docker image vs download and installing a smaller set of code are worth exploring.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2021

You are welcome, Jason. Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events