I used to work with Jenkins but I'm trying bitbucket pipelines now. The only thing I can not figure out is if I have the possibility to run composer install.
I have an Codeigniter application with various composer dependencies. In my repository I don't have the dependencies, only the composer.json file telling composer to install these dependencies. I want to make a pipeline to install the composer dependencies and than push it all over FTP to my server. How can I do that?
What I do now:
Everything ends up on my server but not my vendor map with the dependencies. What is going wrong?
I'm sorry if it's a dumb question, I'm new to both pipelines as to docker.
Hi @Jelle Tempelman and welcome to the community!
Just to give some context first: for every step that you define in your bitbucket-pipelines.yml file, a Docker container starts with the image you have specified, the branch of the repo that triggered the pipeline gets cloned in that Docker container (if you are running pipelines on branches), and then the script of that step runs. When this is finished, the Docker container gets destroyed.
If directories/files are generated or modified in one step and you would like to use them in one of the subsequent steps, you'll need to define them as artifacts in your bitbucket-pipelines.yml file:
Otherwise, they won't be available for the next step, since the Docker container of the first step gets destroyed, and then a new one starts with a fresh clone.
I believe that composer install writes in an existing directory, or generates a new directory, depending on the configuration.
What you can do is
1. either use the atlassian/ftp-deploy:0.3.6 pipe in the same step where you run composer install
2. or define in the first step of your bitbucket-pipelines.yml file any directories/files that are generated or altered by composer install as artifacts, so that they will be available during the second step when you do the deploy.
E.g. if the dependencies are installed in the vendor directory, you can define it as an artifact as follows:
- composer install
If there are other directories or files that are generated or modified during this step and you'd like to deploy them as well, you can add them in the artifacts section.
I hope this helps, please feel free to let me know if you have any questions!
Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...
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