Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Issues when removing files/folders from repo #1

Open
ghost opened this issue Dec 27, 2018 · 25 comments
Open

Issues when removing files/folders from repo #1

ghost opened this issue Dec 27, 2018 · 25 comments

Comments

@ghost
Copy link

ghost commented Dec 27, 2018

Hello, thank you so much for making this shell script available it really helped me set up a great CI pipeline for my WordPress themes. However, I am running into an issue when I try to remove folders/files from my repo and push it to my site hosted on WP Engine.

The push fails because codeship believes that everything is up to date. This is the error I get when I remove folders/files from my local site and push to github.

Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
@aaronware
Copy link
Contributor

I can take look to see if anything jumps out at me with the master version or the build and deploy version. It may be a side effect of having files on the server that already existed prior to doing your initial git deploy.

Below is a link from the official writeup https://wpengine.com/git/#toc_2

HOW DO I KNOW GIT PUSH WON’T DELETE FILES FROM MY LIVE SITE?
The deployment end of the Git push process will only remove files from your application that you have removed from your repository. For example:

You add a file to your application, commit and push it to WP Engine,
You later decide this file is no longer needed,
You remove this file from your application, commit and push back to WP Engine,
The file is now removed from your live application.
If a file never existed in your repository at all, it won’t be removed from either your live or staging application.

You can try to edit 1 file and utilize #force in your commit message. This will force the repo to reset. It doesn't actually delete anything from the server but it does set the repo to be a fresh version based on our last commit.

@aaronware aaronware pinned this issue Dec 27, 2018
@ghost
Copy link
Author

ghost commented Apr 17, 2019

Hello, thank you for helping me out with issues in the past. It looks like I am running into a new one.

I haven't pushed to my server in a few months (been working on a large project). Now I am trying to push my wp theme to wp engine via codeship and running into this error.

Warning: Permanently added 'git.wpengine.com,52.44.207.96' (ECDSA) to the list of known hosts.
FATAL: R any shlaw Codeship-attorneybio DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I haven't changed anything. So I'm not sure why this error is being generated?

Any assistance is greatly appreciated.

Thank you,

Peter

@aaronware
Copy link
Contributor

aaronware commented Apr 17, 2019

Hey @s1100h Are you trying to push to master or to staging. WP Engine has changed up how their environments work. They are now setup as 3 separate installs instead of just Production and "Legacy" Staging. Do you recall if you updated your environments in your WP Engine Portal?

In the last few months there have been a bunch of major changes to the deployments script to work with the new process. We've done a lot of work to keep it backwards compatible but it all depends on what version of the deployment you've been using

@aaronware
Copy link
Contributor

@fischfood I think just had to adjust this for one of our installs.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

I am trying to push to staging. I started fresh with a new plugin and followed these instructions. https://github.com/linchpin/wpengine-codeship-continuous-deployment

I figure if I can get the process down with a new plugin I'll know what's wrong and go back and fix my main theme, and a few other plugins I have running this CI process.

@aaronware
Copy link
Contributor

Wait though, that doesn't answer my first question. Are you using legacy staging? Or did you make a new staging "install" environment? example to look at it are you visiting install.staging.wpengine.com. That will help me, help you debug.

@aaronware
Copy link
Contributor

aaronware commented Apr 17, 2019

Things I would look at regardless. Are your git user public keys still good? Do they match what is in EP Engine for your install(s). That message leads me to believe that you do not have a git push user setup on your install. Or the public key for your CI/CD solution has changed

@ghost
Copy link
Author

ghost commented Apr 17, 2019

I'm pretty sure I am still using legacy staging. I haven't done anything to update it. I think there might be some confusion with my public keys and git push user set up. Any good documentation on setting that up? I think I'm so far down the rabbit hole it might be better to burn and rebuild.

@aaronware
Copy link
Contributor

Well it's not Your public key really. You'd grab the public key from Codeship (or the CI/CD you use) for the specific project you are deploying. That public key then gets copied and added as a Git Push User in the WP Engine portal.

@aaronware
Copy link
Contributor

You could also convert the install to the new way WP Engine wants, and then just create a new staging environment as well. You'd still need walk through the process, copy the Codeship public key, add the key as a new Git Push User in WP Engine. make sure you setup the environment variables.

The ReadMe.MD walks through the entire process. We haven't had any specific feedback about needed clarity. If you have any suggestions or have gotten lost anywhere let us know.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

Yep that's weird because I definitely did that.

FATAL: R any shlaw Codeship-attorneybio DENIED by fallthru

I created a new project in codeship, linked it to my github repo, copied the ssh key after the project was set up, then I added the ssh key to wp engine creating a new developer, and named that developer Codeship-attorneybio

The failure comes with either it doesn't know who the developer or I misspelled my repo-name.

@ghost
Copy link
Author

ghost commented Apr 17, 2019

should the username in the environment variables be the username/reponame?

@aaronware
Copy link
Contributor

How long did you wait to do it? It can take a few minutes for the permissions to be set. 10 -15 min or so. No username is stored in the environment variables. It's only the WPE_INSTALL, REPO_NAME (which really just becomes a folder name) and the PROJECT_TYPE

@ghost
Copy link
Author

ghost commented Apr 17, 2019

ah gotcha. It's been about 30 mins now

@aaronware
Copy link
Contributor

Yeah it shouldn't take that long for permissions. And you tried to deploy again since then?

@aaronware
Copy link
Contributor

just to confirm your WPE Install is shlaw

@aaronware
Copy link
Contributor

Trying to rule out install typos

@ghost
Copy link
Author

ghost commented Apr 17, 2019

yep

@ghost
Copy link
Author

ghost commented Apr 17, 2019

I'm pushing again now

@ghost
Copy link
Author

ghost commented Apr 17, 2019

It failed again. I'm going to call it a night on this task. Thank you so much for your help!!

@aaronware
Copy link
Contributor

Going to try it real quick using the "old way" and see if it throws me any errors

@ghost
Copy link
Author

ghost commented Apr 18, 2019

Great! What were the results?

@aaronware
Copy link
Contributor

So it still works on legacy as well (at least pushing to master). I didn't try staging but the rules still apply. The git user in WP Engine is the same on legacy staging and master. If you use the newer way the git push users need to be added to each install

@aaronware
Copy link
Contributor

Are you positive you have the proper WPE_INSTALL environment variable setup
And you are positive you copied and pasted the public key from CodeShip and NOT from your local environment

@ghost
Copy link
Author

ghost commented Apr 18, 2019

Yep those are all corrrect. Sorry for the delay but I was on the chat with WP engine all morning. Still no solution :/

But it did set up staging remote to the project based on this article https://wpengine.com/support/using-git-on-sites-with-legacy-staging/

In hopes that would help, but it didn't.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant