Roots Discourse

What is correct way to upload existing sage theme on Kinsta after editing some files on local machine?

Hi I am new to Trellis/Bedrock Sage. I have setup Trellis/Bedrock on local machine and then deploy on my Kinsta Server using ansible. Than I created sage theme in my local machine. I again ran same ansible command to deploy on my Kinsta staging server. Its uploaded successfully but now its showing an error when I open up staging URL in browser. It says:
Sage › Error
Autoloader not found
You must run composer install from the Sage directory.

So my questions are:

  1. Should I ssh to Kinsta and run composer install from Sage directory? or What?

  2. Also I am developing theme on my local machine but wanted to keep my client in loop? What is best way to do this?

  3. I also want my other team members to work on it. I have configured Git already? So what is the best way to manage it. or what should be the workflow?

  4. Also what if there are some cases when need to make small/quick changes on live server, in such cases how things need to do in better way?

  5. Please pardon me if I asked dumb questions above. As I mentioned I am new to Trellis but familiar with normal wordpress development.

Thanks for your help and time.

OK, I ran Composer Install there on Kinsta Server > web/app/themes/mytheme
Now error is gone but styles are not loaded at all?
When I see files and folders on server, I found out “dist” folder is missing up there.
So does that mean I need to yarn && yarn-build over there?
If so this takes too much time every time I make a change and deploy?

You can configure the build-before hook to do this for you.

1 Like

Thanks this satisfy my questions: 1 and 2 You are awesome. How about question number 3 and 4?

  1. We have one repo for each project, containing Trellis, Bedrock, and Sage. That way any team member can pull down the repo and be able to make any necessary changes and deploy.

  2. Don’t make changes on the live server. Make changes locally, test them, commit them, and deploy them. If you break this workflow you lose its benefits.

2 Likes

I am using it but something strange happened or may be its normal, I am new so I do not know. After doing some work on my machine all plugins from staging server gone? Why?