The Ymir command-line tool.
- PHP >= 7.2.5
Install the Ymir CLI in your project using composer:
$ composer require ymirapp/cli
Or globally:
$ composer global require ymirapp/cli
Install dependencies using composer:
$ composer install
Ymir command-line tool
License: MIT License
The Ymir command-line tool.
Install the Ymir CLI in your project using composer:
$ composer require ymirapp/cli
Or globally:
$ composer global require ymirapp/cli
Install dependencies using composer:
$ composer install
If I do ymir network:list
and then ymir network:delete 7
where 7
is the Id
shown in the list output, I get:
Unable to find a network with "7" as the ID or name
Deleting with the Name
works, and calling ymir network:delete
and then choosing from the list also works.
Hi!
First of all, I think this project is quite awesome. I already use bref for some laravel projects, and I am quite excited to have the same possibility with wp.
Sadly, I get some errors with the cli. Was able to init the project, but cannot setup either dns zone or ssl. I get this error, though domain is indeed specified (ymir certificate:request mydomain.com
)
The Ymir API responded with errors:
* The domains field is required.
I also have a warning saying a new version is available, but I just installed globally using composer (in the container).
ymir --version
returns Ymir 1.6.2
Here is my dockerfile for development:
# Use an official PHP runtime as a parent image
FROM php:8.3-apache
# Set the working directory
WORKDIR /var/www/html
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Install system dependencies
RUN apt-get clean && apt-get update && apt-get install -y \
git \
zip \
unzip \
curl \
default-mysql-client
RUN install-php-extensions gd xdebug zip mysqli
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
# Install Ymir CLI
RUN composer global require ymirapp/cli
RUN export PATH="$PATH:$HOME/.composer/vendor/bin"
# Enable Apache mod_rewrite
RUN a2enmod rewrite
#install wordpress cli
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
# create dev user
RUN useradd -m -s /bin/bash dev
# Copy the current directory contents into the container at /var/www/html
COPY . /var/www/html
# Make port 80 available to the world outside this container
EXPOSE 80
# Start Apache in the foreground
CMD ["apache2-foreground"]
Here is the docker-compose file :
version: '3.8'
services:
web:
build: ./docker
volumes:
- .:/var/www/html
ports:
- "8080:80"
depends_on:
- db
environment:
- DB_HOST=db
- DB_USER=root
- DB_PASSWORD=secret
- DB_NAME=wordpress
command: /bin/bash -c "apache2-foreground"
db:
image: mysql:8.3
restart: always
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: wordpress
volumes:
- db_data:/var/lib/mysql
volumes:
db_data:
Any insight would be appreciated, thanks!
Works:
ymir wp "user list"
Does not work:
ymir wp user list
ymir wp -- user list
Having to quote the WordPress command is incredibly awkward. Imagine commands which themselves have to be quoted.
When I use Pantheon's Terminus tool (a CLI for interacting with their hosting platform) I can do terminus remote:wp sitename.live -- user list
. The --
there signifies "I'm done passing options to terminus
, and the rest of everything should be passed to wp
on the remote host" and is quite handy.
It would be good to have a setting to turn off Cloudwatch logging if we use different services like Axiom to send logs.
I've tried to remove the permissions manually from the Role that the Lambda function uses, i.e.:
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
But they are added back at each new deployment.
It'd be great to be able to do AWS changes (e.g. CDN config, domain/certs config, cron on/off, warmup) without a full build and deploy.
I'm aware it's not trivial but thought i'd leave the comment here!
If you fumble your AWS credentials (or expire them), you'll be stuck with an unusable provider. Would be nice to be able to update the credentials.
Seems like when the image deployment is used, and if we have a .dockerignore file on the project root, that file is not copied to the .ymir/build
directory where the build is happening.
The .dockerignore file is useful to add files that can be ignored on the builded image. It might be similar to #16 but is not related to s3 upload and to the resulting build image.
That would make things super easy to easily publish a local site to its ymir environment.
As discussed in #6, need to wait until next release of flysystem
hello,
I have carried out multiple tests: changing the region, installing WordPress from scratch, etc., but always after running ymir init it shows that CDN failed, but I have no way to see why and when I check the AWS account I actually see that I don't believe it, nothing in CloudFront, despite this I have tried to continue with the deployment but some type of error always appears that I consider has to do with this.
$ ymir info
---------- -------------------
Name inspreb
Provider Ymir Web Insp Reb
Region us-east-1
---------- -------------------
Listing information on all environments found in ymir.yml file
--------------- ------------------------------------------------------------
Name production
Domain calm-badlands-qy9w2btfsz03.ymirsites.com
HTTP Gateway xtqb5234v0.execute-api.us-east-1.amazonaws.com
CDN Failed
Public assets ymir-inspreb-production-assets-1705407277.s3.amazonaws.com
Database Provisioning
--------------- ------------------------------------------------------------
--------------- ---------------------------------------------------------
Name staging
Domain ancient-cove-oynxdhurfhqz.ymirsites.com
HTTP Gateway lao205yoa9.execute-api.us-east-1.amazonaws.com
CDN Failed
Public assets ymir-inspreb-staging-assets-1705407277.s3.amazonaws.com
Database Provisioning
--------------- ---------------------------------------------------------
To save some time (and costs!) it'd be great if ymir was ignoring files that are not necessary for to go the S3 and unfortunately included in some plugins.
Including:
When using sftp import:uploads
parses a url, sends it to League\Flysystem\PhpseclibV2\SftpConnectionProvider
PhpseclibV2
doesn't support ed25519 keys. The logic in SftpConnectionProvider
is to use an agent unless opt'd out (7th parameter of SftpConnectionProvider
).
I suggest two workarounds:
1.) if password is specified set useAgent = false
.
2.) add an additional cli argument to disable agent.
PhpseclibV3
support is also available. I haven't looked into it (unsure about backwards compat).
I'll open a PR for workaround 1 as it seems sane to me. Of course both of these only handle the case where password access is available!
I have 18 domains mapped to this environment. I am attempting to deploy it, but it can't find a SSL cert. Well... I don't know which of the 18 domains it's having a fit about. This error message should be more clear about what is failing.
➜ garman git:(ymir) ✗ ymir deploy production
A new version of the Ymir CLI is available: 1.39.1 → 1.42.0
Project ymir.yml file is valid
Building project
> Copying WordPress files
> Downloading WP-CLI
> Executing build commands
> Ensuring Ymir plugin is installed
> Copying Ymir must-use plugin
> Extracting asset files
> Compressing build files
Project built successfully
Uploading build (100%)
Processing assets
> Getting signed asset URLs
> Uploading new asset files (2954/2954)
Deployment starting
> Ensuring cache table exists
> Ensuring email domains exist
> Ensuring environment role exists
> Ensuring functions exist
> Configuring environment image processing function
> Configuring network
> Preparing domain names
> Assigning SSL certificate
Deployment failed with error message:
No certificate found on cloud provider
It would be handy to have the RDS endpoint in the database:server:info
for quick reference rather than having to jump into AWS console
Since Ymir already knows the domains (ymirsites or not) for a given environment, it'd be great if we could have a shortcut that allows for search replace in the target database.
Added a thumbnail size, which means I need to regenerate thumbnails. I tried running the CLI command, but it failed, and the logs aren't really that enlightening.
➜ garman git:(ymir) ✗ ymir wp --environment staging
A new version of the Ymir CLI is available: 1.39.1 → 1.42.0
Please enter the WP-CLI command to run:
> --url=mindsize.staging.garman.dev media regenerate --only-missing --yes
Running "wp --url=mindsize.staging.garman.dev media regenerate --only-missing --yes" on "staging" environment
Running the command failed
wp [--environment ENVIRONMENT] [--async] [--] [<wp-command>...]
A useful enhancement for Ymir would be to automatically add tags to resources based on the project and environment names. This feature would enable easy filtering of resources in the AWS cost explorer, allowing for more granular cost analysis by the project.
Considering the following file structure and contents.
.gitignore
web/app/themes/*/
!web/app/themes/theme
node_modules
ymir.yml
...
build:
include:
- web/app/themes/theme
When the copy is being done, if the theme folder has a node_modules folder, this is being added to the deployment, despite the fact the folder is being ignored on .gitignore.
I think this is happening because we include the build.include on the last step. https://github.com/ymirapp/cli/blob/main/src/Build/CopyWordPressFilesStep.php which copy over the gitignored files.
A possible solution that I see is to apply the $finder->ignoreVCSIgnored(true);
at the very end.
This is currently causing the copy of thousands of node_modules files to s3.
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.