MWDelaney/trellis-github-deployment

Setup command fails, deploy fails

Closed this issue · 6 comments

Hi. I followed the instructions in the documentation to generate and add the keys. A key was generated and stored in the ~/.ssh/ folder but the provisioning of the key failed. The error message received was:

Running command => ansible-playbook server.yml -e env=staging
ERROR! couldn't resolve module/action 'community.general.alternatives'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/media/username/Work/example.com/trellis/roles/php/tasks/main.yml': line 17, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Ensure correct PHP version selected
  ^ here
exit status 4

however, running trellis provision --tags users staging completed successfully. I believe when I ran the trellis key generate && gh secret set ANSIBLE_VAULT_PASSWORD -b $(cat trellis/.vault_pass) && gh secret set TRELLIS_SITE_SLUG -b example.com command, it did not load the correct ansible version from my trellis virtualenv.

Anyway, I went ahead and committed the actions to the repository. However, deployment fails.

When the action runs, during the Post Deploy to production flow, the error is:

Prepare all required actions
Getting action download info
Download action repository 'bobheadxi/deployments@v1' (SHA:88ce5600046c8[2](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:2)542f8246ac287d0a5[3](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:3)c[4](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:4)61bca3)
Download action repository 'actions/setup-node@v3' (SHA:64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c)
Download action repository 'andstor/file-existence-action@v2' (SHA:20b4d2e[5](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:5)9[6](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:6)410855db8f9ca21e96fbe18e12930b)
Download action repository 'shimataro/ssh-key-action@v2' (SHA:685d0f20da72e4b53cc81d373a2ed0a867770e46)
Download action repository 'webfactory/ssh-agent@v0.8.0' (SHA:d4b9b8ff[7](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:7)295[8](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:8)532804b70bbe600ad43b36d5f2e)
Download action repository 'roots/setup-trellis-cli@v1' (SHA:917fd0e4aa272d0aad42410455062f0ebff1d653)
Download action repository 'godaddy-wordpress/setup-wp-cli@1' (SHA:80c[9](https://github.com/thirdwaveco/psychedelic-coaching-institute/actions/runs/5121999102/jobs/9210462960#step:3:9)a89bd347082429795c0f12acf567e2c390d4)
Run ./.github/actions/trellis-cli
Run bobheadxi/deployments@v1
targeting thirdwaveco/psychedelic-coaching-institute
initializing new deployment for production @ production
created deployment 924970607 for production @ production
created deployment status 2034063925 with status "in_progress"
Run actions/setup-node@v3
Found in cache @ /opt/hostedtoolcache/node/16.20.0/x64
Environment details
Run andstor/file-existence-action@v2
These files don't exist: trellis/deploy.yml
Run shimataro/ssh-key-action@v2
**Error: Error: Input required and not supplied: key**

Hi, thanks for posting. The first error your deployment is running into is this:

These files don't exist: trellis/deploy.yml

This is the first check trellis-github-deployment runs, to confirm (at least a little) that there's a Trellis instance to be deployed.

Does trellis/deploy.yml exist in your repository?

Hi @MWDelaney, thanks for responding. No, the file doesn't exist. I read "Copy the .github directory from this repository to your Trellis-based WordPress site's repository." and assumed the .github folder needs to go into the Bedrock (site) folder repo. Should it go into the trellis repo instead? I should mention I'm running trellis/bedrock in separate repos.

This set of workflows will probably need some modification to work with your setup, since it presumes you're working with a relatively simple Trellis setup, like as described in the Trellis docs.

The good news is that this project is designed as a boilerplate to be modified to fit your needs!

@MWDelaney , I am using trellis as described in the docs though. I spin up my projects using trellis-cli and running trellis new, and I keep them organized as two git repos instead of a single one with subrepos. Is that the issue, is it set up right now for a single repository?

If you happen to have an example project I can look at to adapt, it would help a lot 🙏

What is your typical deployment process? Do you have a script or a series of commands that you run to clone the repo and its subrepos and then execute a deployment with Trellis CLI?

Hi @MWDelaney . I set up projects using trellis new domain.com, then separatelygit init each repo and store them in github as site and trellis. Then with them set up I trellis init the project and then trellis provision && trellis deploy. I kind of assumed that was the vanilla way.