Confetti is a new extremely simple and flexible CD (continuous deployment) tool. 🎉
Tools like Jenkins are extremely complicated to use even for the most basic use case. It's very heavyweight and it utilizes a complicated web interface. Confetti aims to make CD super simple, but flexible enough for just about any situation.
You'll need Node.js installed. Then simply install with:
npm install -g confetti-cd
You'll now have access to the confetti
command line tool.
On your server, add a /etc/confetti-conf.yml
file. Under repositories
add the url of your repository.
# /etc/confetti-conf.yml
repositories:
- https://github.com/username/webservice:
directory: /var/www/webservice
Now lets do a manual deployment
confetti deploy
If all went well, the repository should have been cloned to the directory
.
Let's add a webhook. Navigate to https://github.com/username/webservice/settings/hooks/new. Enter the URL of the server with port 4385 (this can be changed later) e.g. https://1.2.3.4:4385/ and click "Add webhook".
Note: For security reasons, in real environments you should use a secret.
Now start the webserver
services start confetti
Whenever the repo is pushed to, Confetti will redeploy it.
Inside your repository create a .confetti.yml
file. Let's add some build steps.
# /etc/confetti-conf.yml
build:
- npm install
- npm run build
- npm run start
Commit and push this file. Now confetti will run those build steps after cloning your repository.
Now celebrate your deployment with some confetti!
- Webhook received
- Repository is cloned to a temp directory
prepare
steps are randirectory
is cleared keeping onlysafeFiles
files- Repository is copied to
directory
build
steps are randeploy
steps are rancleanup
steps are ran- Temporary directory is removed
Many options can be defined globally, locally, and/or in the confetti file (inside the repository).
- Repository Options (
confetti-conf.yml.repository
) - Confetti File (
.confetti.yml
) - Global (
confetti-conf.yml
)
These options are defined at the top-level of the configuration file.
A list of URLs of your repositories. (e.g. https://github.com/jbis9051/confetti
)
Port for the webhook service
Path for the webhook service. (e.g /payload
)
These options are defined at either the repository level or the global level.
Highly Recommended: Webhook secret for security purposes. More information on GitHub Developer Docs.
Environment variables to be passed to run steps.
Note: If env
is specified in Global and Repository options, it will be combined. If there is a key conflict, repository will take precedence.
Branch to be used for deployment.
Used to choose a runnerEnvironment. Usually either production
or development
. See confetti file options below.
The options can be defined under a URL in the repository
section.
These files will not be removed. Helpful for configuration files or .env
files.
Directory where to deploy the repository to. If not specified, you can add manual deploy steps in the deploy
hook.
Add hooks for specific environments such as production
and deployment.
runnerEnvironment` will be matched. For example:
# .confetti.yml
production: # used if runnerEnvironment matches this
build:
- npm install
- npm run build
deploy:
- npm run start
development:
build:
- npm install
deploy:
- npm run dev