Deployment failure due to local modifications on production server

There are some issues with the version of Gravity Forms that I’m using. In order to get things running, I needed to make a few changes to both the plugin file and some of my page templates both locally and again on the live server after deployment (since, as I understand it, the plugin files aren’t copied but are pulled down by composer from wp-packagist, for instance).

I’m wondering if this might be why I’m getting the following failure when I’ve tried to deploy since editing those files on the production server:

TASK: [deploy | Clone project files] ****************************************** 
failed: [my-ip] => {"failed": true}
msg: Local modifications exist in repository (force=no).

I’d like to try and force it, but don’t know the correct flag for the ansible-playbook command and am worried about breaking the live site if something goes wrong. I don’t have a staging environment set up on my server.

Any help would be great!

Yes that’s exactly why you’re getting that error message.

You should never make manual changes on remote servers that you care about/that you want to persist. Setting force=yes would just overwrite all your manual changes anyway. You can always fork that plugin with your changes and reference your fork in composer.json.

Anyway, if you really want to set force=yes. Just add it in here: https://github.com/roots/trellis/blob/429b3bdd9da79334e2ddaf321190710138359bc0/roles/deploy/tasks/update.yml#L24-L28

1 Like