thisbythem / stag Goto Github PK
View Code? Open in Web Editor NEWThe Statamic CLI
The Statamic CLI
Hi all, loving Stag!
One thing I can't work out though: when configuring servers such as 'staging' and 'production', is there a way to specify that the "master" branch is deployed to 'production', while another branch such as "testing" is deployed to 'staging'?
I'm guessing this is potentially something that Stag can't do at the moment, but feel it would be a nice feature to add. Would allow teams to play with new ideas/features and add them to a staging area for review by the client without impacting any work going on with the master branch.
Loving your work of Stag, it's one of the best beta tools I've ever come across. It's been a breath of fresh air for my deployment strategy!
Cheers,
Jamie.
Are there any plans for making this work with Statamic 2?
I'm trying out stag, using MAMP 3.
I have this config file:
servers:
production: production
host: {my site url is here}
webroot: /home/{dir_name}/public
user: forge
port: 22
forward_agent: false
strategy: rsync
pull_content:
commit_message: "Content update from production"
content_directories:
- _content
- assets
- _forms
When I run any command, I receive php errors, but the command does eventually run. Is there any way to get this to run without showing the errors?
This is what outputs:
jeremy$ stag clear_cache
PHP Strict standards: Static function Command::helpSummary() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 6
PHP Stack trace:
PHP 1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
PHP 2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
PHP 3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
PHP 4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
PHP 5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0
Strict standards: Static function Command::helpSummary() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 6
Call Stack:
0.0002 235712 1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
0.0196 2083056 2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
0.0196 2083168 3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
0.0203 2156592 4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
0.0205 2156656 5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0
PHP Strict standards: Static function Command::helpDetail() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 7
PHP Stack trace:
PHP 1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
PHP 2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
PHP 3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
PHP 4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
PHP 5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0
Strict standards: Static function Command::helpDetail() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 7
Call Stack:
0.0002 235712 1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
0.0196 2083056 2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
0.0196 2083168 3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
0.0203 2156592 4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
0.0205 2156656 5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0
_cache/_app has been cleared.
_cache/_add-ons has been cleared.
I have followed the instructions step by step on how to Install Stag but it won't work. This is what I have done so far:
I get the following error: zsh: command not found: stag
NOTE: I am using Oh My ZSH as my shell
Using the command-line for deploying and clearing cache is great. However, the one issue that I am having is that no matter what command I run it will always ask for my password. For example, I setup a sample deployment to sites staging environment and ran into some issues because it will request that I type my password for each step in the process which is upwards of 10+ times for each deployment I have tried to run.
I figured it might be my configuration file (structure is below), but no matter how many times I have tried to mess with the configuration file it will continually request my password to be typed at each and every step. The deployment works flawlessly when I check the files after it is complete, but having to type my password that many times seems to defeat the purpose of using the command-line.
Any ideas on what it happening? I am currently on Dreamhost now, but I haven't had issues before using rsync over ssh before.
servers:
staging:
host: example.com
webroot: /var/www/example.com
user: ******
password: ******
port: 22
forward_agent: false
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
Stag only checks for the directory presence to know if it should clone or not, but not if the directory itself is actually empty. Update check and clone if empty as well.
Is it possible to hash/encrypt the server password in the stag.yaml file?
Thx
Rudy
Stag cli addon breaks after 1.9.1.
Fatal error: Class 'ResourceNotFoundException' not found in /statamic_site/_app/core/api/resource.php on line 177
When I pull the content down, and reference a sub directory, for instance: '_config/users', the users folder will end up in the root directory.
Pulling the users folder is handy to keep users that are added on the server.
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?
Add ability to deploy different branches, specified in the server config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.