thisbythem / stag

The Statamic CLI
36 stars 4 forks source link

Help with setting up Stag #9

Closed alehandrof closed 9 years ago

alehandrof commented 9 years ago

I'm sure I'm doing something silly, but I can't get Stag to work.

Here's my the server part of stag.yaml:

servers:
  staging:
    host: xyz.org
    webroot: /xyz
    user: xyz
    strategy: rsync

    deploy:
      pull_content_before: true
      clear_cache_after: true
      set_permissions_after: true
      ignore_files:
        - .git
        - _cache
        - _logs

    pull_content:
      content_directories:
        - _content
        - assets

And here's the error I get when trying to deploy:

alex@tosh:~/xyz/statamic$ stag deploy staging

Checking configuration:

PHP Warning:  array_key_exists() expects parameter 2 to be array, string given in /home/alex/xyz/statamic/_add-ons/stag/commands/command.deploy.php on line 102
No configuration for environment: staging. Please check your settings and
try again.

Ideas?

nobodyiscertain commented 9 years ago

Hmmm... That looks good. I even copied in your config, and it tried to deploy.

Make sure there's not another servers: key in there that is overwriting your config, as stag isn't able to read the config you have listed above for some reason.

If you want to copy in your full config here, I'm happy to take a look.

alehandrof commented 9 years ago

I'll have to take a raincheck. For the moment, I've cobbled together something in Grunt that works adequately. For the record how does Stag handle merge conflicts when deploying with git? I.e., if what happens if I've edited the same file on the live server and on my development machine?

alehandrof commented 9 years ago

Also, thanks for looking into this... I forget my manners sometimes :)

nobodyiscertain commented 9 years ago

Yeah no problemo. I'll close this issue and just re-open if need be.

Stag doesn't handle merge conflicts. If a merge conflict happens that git can't resolve itself, you'll need to manually SSH in and fix whatever needs fixing. This has really only been an issue for us with content. Usually, once a site goes live, we don't edit any content in any other environment except production, and this keeps the conflicts to a minimum.

alehandrof commented 9 years ago

Cool.

I'm planning to be editing content both locally and on the production server and, if I'm feeling exceptionally self-flagellating, on the staging server, as well. Sigh.

So it's possible that Stag wouldn't have been a good fit; though maybe the issue is with my workflow :)