Published 1 week ago by spyrosjeva
I was testing the functionality of bibucket pipelines and im looking to do the following, install the default enviroment and on every commit/push have laravel update itself with the composer update command and then if no error come from the test's upload to the production server with git ftp.
The problem im facing is with composer update, even if there is no new downloads from it afther its done git ftp gives me a message of "dirty repository" meaning that there are uncommited changes.
Is there a way to configure pipelines to commit and push those changes from the update?
Here is my .yml file
image: php:7.1.1 pipelines: default: - step: script: - apt-get update && apt-get install -y unzip - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - composer -V - composer install - composer update - apt-get -qq install git-ftp - git ftp init --user $ftp_username --passwd $ftp_password ftp://****/****/
@spyrosjeva You can’t do this, as it means your application is changing versions.
If you try and deploy one version, but then run
composer update, then bugs may be introduced by an updated package. This is what a composer.lock file is for: it locks dependencies at known versions. Therefore, you should manually run
composer update in your local environment, commit (so the new composer.lock file is committed), and then deploy.
@bashy Possibly a timestamp or something is updated. But either way, an update should not be ran on deployment, otherwise you’re no deploying the code—and library versions—defined in your source repository. And if you’re deployment process updates a dependency from version A to version B, how do you get that back in to your repository? Your repository is still going to have version A committed in the lock file.
@martinbean yeap you where right is not possible after all so i need to do it manually thanks for the info, also is there a way or a server setup where i can update multiple apps at the same time, lets say i have updated or extended my base with more features (tested and ready) and i want to push this to all my multiple productions, is there a way?