wp-trigger-netlify-build icon indicating copy to clipboard operation
wp-trigger-netlify-build copied to clipboard

Deploy doesn't trigger on article update

Open robinmetral opened this issue 5 years ago • 20 comments

Hey @iamtimsmith, I've stumbled on this plugin from your Gatsby and WordPress series. Thanks for building it!

I've successfully installed it on my WordPress endpoint and configurated my Netlify hook & status links.

However I've tried to update one of my existing articles, but the build wasn't triggered on the Netlify endpoint.

Am I doing it wrong?

robinmetral avatar May 09 '19 15:05 robinmetral

@robinmetral What are you putting in for your settings within the WordPress admin?

iamtimsmith avatar May 09 '19 15:05 iamtimsmith

Thanks for your blazing fast reply :wink:

I'm using the URL from my Netlify site settings (I created a hook), which looks like this in the console:

netlify-console-screenshot-with-hook-url

(the end of the endpoint is cropped)

And I'm using the image URL and status URL for the Netlify status badge. I think these are OK, they're for status not for triggering the build, right?

robinmetral avatar May 09 '19 15:05 robinmetral

There might be a small bug: I've been getting this update on my Admin panel since I updated the plugin settings. It's not going away, even after signing out and in again.

wordpress-admin-screenshot-saying-your-settings-have-been-updated

robinmetral avatar May 09 '19 15:05 robinmetral

@robinmetral No, the statuses shouldn't have any bearing on the build. I'll take a look into that message and see if I can figure out what's going on.

iamtimsmith avatar May 09 '19 15:05 iamtimsmith

Thanks a lot @iamtimsmith! Let me know if I can do anything to help (although I'm not very familiar with the WordPress ecosystem).

Also I just made sure that my hook works with a curl request from my CLI: it does :heavy_check_mark:

robinmetral avatar May 09 '19 15:05 robinmetral

It seems like I am having the same issue here. I too followed all instructions and curl works as excepted.

re1 avatar May 12 '19 11:05 re1

Thanks @re1, good to know this was reproduced

robinmetral avatar May 12 '19 18:05 robinmetral

@robinmetral @re1 Okay, so I've been looking into this. As far as the notice is concerned, this is a problem within WordPress so this will take some work to function as expected.

I did a fresh install in a local docker environment, pasted in the webhook URL and the urls for badge and link. I'm seeing it trigger a build when I update a blog post. While it fails (I think because it's a local docker environment), it does trigger the build. My followup questions are:

  • Are you seeing it fail or not seeing it trigger anything at all?
  • Are you updating blog posts, pages, or a custom content type?

iamtimsmith avatar May 13 '19 02:05 iamtimsmith

Thanks @iamtimsmith for looking into this!

When I first opened this issue, updating a blog post didn't trigger anything (no error message, nothing).

BUT I tested things again today and:

  • Updating a page triggered a build :tada:
  • Updating a post triggered a build :tada:

So as far as I'm concerned, this issue is solved. I'm thinking it might have been the hooks taking some time to get set up on either the WordPres or Netlify end.

The only problem that remains for me is this:

I've been getting this update on my Admin panel since I updated the plugin settings. It's not going away, even after signing out and in again.

wordpress-admin-screenshot-saying-your-settings-have-been-updated

I'm still getting this message at all times, where I think I should instead get notifications saying a build was triggered.

Do you want me to open a new issue for this?

robinmetral avatar May 13 '19 07:05 robinmetral

Awesome! I'm glad it's working for you. @re1 Is this working for you now as well?

iamtimsmith avatar May 13 '19 13:05 iamtimsmith

Hi @iamtimsmith. Sadly it still does not work for me. I am running WordPress on latest version using the following docker compose file:

version: '3.7'

services:
  db:
    image: mysql:5.7
    container_name: mysql
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
    volumes:
      - db:/var/lib/mysql

  wordpress:
    depends_on:
      - db
    image: wordpress
    container_name: wordpress
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
      WORDPRESS_DB_NAME: wordpress
      VIRTUAL_HOST: ${WP_URL}
      LETSENCRYPT_HOST: ${WP_URL}
      LETSENCRYPT_EMAIL: ${WP_EMAIL}
    volumes:
      - ./wp-content:/var/www/html/wp-content/
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.conf:/etc/nginx/nginx.conf
      - nginx-vhosts:/etc/nginx/vhost.d
      - nginx-certs:/etc/nginx/certs
      - nginx-html:/usr/share/nginx/html

  letsencrypt-nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-proxy-letsencrypt
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - nginx-vhosts:/etc/nginx/vhost.d
      - nginx-certs:/etc/nginx/certs
      - nginx-html:/usr/share/nginx/html
    environment:
      NGINX_PROXY_CONTAINER: nginx-proxy

volumes:
  db: {}
  nginx-certs: {}
  nginx-vhosts: {}
  nginx-html: {}

re1 avatar May 15 '19 14:05 re1

I'm also having problems getting the plugin to trigger a new build. Clean WordPress install on DigitalOcean using the Ubuntu WordPress on 18.04 droplet. Tested the build hook using curl just like @robinmetral and @re1 — works for me also.

lukebennett88 avatar May 18 '19 08:05 lukebennett88

@lukebennett88 @re1 I'm still looking into this. @lukebennett88 Are you also using docker within the droplet? I'm wondering if it's a problem with docker containers and webhooks. I can't get mine to work when using it in a docker container either, but I've tried it from a live WordPress site and it works no problem.

iamtimsmith avatar May 20 '19 16:05 iamtimsmith

@iamtimsmith I don't believe so (unless it uses Docker under the hood) just the WordPress droplets here: https://marketplace.digitalocean.com/apps/wordpress

lukebennett88 avatar May 20 '19 23:05 lukebennett88

I also tested https://github.com/lightstrike/wp-gatsby and https://github.com/lukethacoder/wp-webhook-deploy-netlify without success. As WordPress deploys are not my main concern at the moment it might take a while for me to actually do some in-depth tests..

re1 avatar May 25 '19 14:05 re1

@re1 @lukebennett88 Sorry I haven't gotten back to this sooner. I have come up with a possible solution. I've created a separate branch called WPTNB-2 with the change in WordPress hooks. It needs to be tested further. If you could give the code in that branch a try and let me know how it works, that'd be great!

iamtimsmith avatar Jun 03 '19 15:06 iamtimsmith

Hey @iamtimsmith just installed the plugin from the WPTNB-2, but unfortunately it's still not triggering a new build for me 😭

lukebennett88 avatar Jun 04 '19 00:06 lukebennett88

@iamtimsmith @lukebennett88 Same here. Also downloaded the plugin from WPTNB-2 branch. I might be able to work on this myself next week.

re1 avatar Jun 07 '19 11:06 re1

@re1 I've ended up being pretty busy over the last few weeks, so it may be a bit before I can dedicate time to this. If you want to take a look and see if you can figure it out, that would be awesome!

iamtimsmith avatar Jun 07 '19 15:06 iamtimsmith

Yep, can confirm it's not working for me either.

CHEWX avatar Jun 13 '19 18:06 CHEWX