Hello everyone, I’m new to this community, so I apologize if there is something I missed before I start posting.
Project URL: https://github.com/TeamSTEP/glitch-deploy-tool
I built a CLI tool that allows you to deploy your local files or Github repository directly.
My personal issues with Glitch as a production server
From my experience, if you don’t program directly from Glitch, creating a consistent and clean CI workflow is kinda difficult, not to mention the overhead that it comes with for a small wrapped Docker.
There are tools that allow you to automatically import your Github repository to your project via the
/project/githubImport endpoint, which was the method I used to deploy my apps. However, despite this allows you to specify a subdirectory in your Github repo, it does not allow you to specify a branch (at least, not from what I know). So you can’t do something like Github Pages where you can have a production build branch (usually named
gh-pages) separate from the main branch. People online told me to just create another Github repo and push the production build there, but that seemed too ugly. There are also tools that use
puppeteer to access Glitch for more control, but that just sounds horrible and potentially bad for security. Although I would like to see a project that can control a Glitch project terminal using that method.
What I did
I found out that all Glitch projects use Git as their SCM and they also support direct access to it as well. This was great news.
So during my free time, I decided to quickly prototype a Git automation script that pulls from the origin, wipes its content, and replaces it with content from another folder using the
simple-git package. After about two days of work, I was able to make something that “works.” Considering that this was impulsive development, I’m actually happy with the result. It’s not perfect and there are a lot of parts I can improve on, but within a controlled environment, it works exactly the way I wanted to.
Because now I’m able to upload local files to Glitch, this allows me to build everything from Github Action and only serve the optimized binary from Glitch. Plus, I can create a custom build script that can wrap Glitch-specific settings (such as
glitch.json) on the fly without having to bloat my Github repository. This means I can deploy the same project for multiple servers given the right build scripts and make it all work in one go.
This is a small project that I created in my free time, and I thought I would share it with the community and hear what you guys think about.
At the moment, there are no proper unit tests or a great CLI tooltip (mostly because
node-cmdln doesn’t have type defs, which makes it hard for me to create subcommands) so I tagged it as a pre-release alpha.
For information regarding the usage of the tool, please visit the project URL for details.
Once all the major bugs are fixed and proper unit testing has been added, I think it’ll get out of its alpha stage.
I want to hear what everyone thinks about this project. Will this help you? Or is it really an unnecessary tool?
Any contributions are welcomed.
Thank you for reading this post.