I'm currently trying to use Bitbucket pipelines to deploy a docker container to Kubernetes. I've read the example that's already out there, but it doesn't completely fit our needs.
The step of building the container and putting it in it's registry works fine from the pipelines, as well is the deployment step that connects to Kubernetes to create a deployment, but not yet completely.
Because the build step knows the name of the container, which is constructed by Gradle, sharing this information to the deployment step would be convenient, so the kubectl commands can be executed using this information. Is there a way of sharing information between these steps?
Thank you @davina,that certainly helped give some direction for an alternative solution, which now works. I write a little file now during the build process and pass this file on as an artifact to the deployment step.
The only issue I had was to remember that the artifacts use relative paths to be shared so "/data/**" won't work while "data/**" will work. Other than that this is a working solution.
In your bitbucket-pipelines.yaml file, use something like this example:
- npm install
- npm run fulltest
- npm run get-version --silent > ./version.txt
- VERSION=$(cat ./version.txt)
The above configuration runs npm install, runs a full set of tests (custom npm task), and then uses get-version (a custom npm task to get the version of the package) and places the SemVer number into a file called version.txt.
This file is then stored as an artifact, which allows you to open it up in the next step (via cat, for example) and store it into a variable to be used further down in the step's script.
asking for help!
Im in a weird issue where I use artifacts to export 2 file (.txt and .tar) from the 1st step and I am not being able to get the .tar in the 2nd step. I can access the .txt file but not the .tar file. In both steps I use different docker images to process the data.
Is there anything to do with the docker image and artifacts exported in the 1st step? Asking this question because, if I use some different docker image in the 2nd step I can see the .tar file available.
Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events