This service deploys new changes to the website repo to the live site!
You must have these things installed:
You will also need an AWS account with credentials set up on your machine, and shell access to the remote server (wics@aviary.cs.umanitoba.ca
in this case).
The server must have rsync
installed.
Deploy the service like so (these steps assume Linux or MacOS):
- Generate an SSH key:
mkdir -p ssh; yes | ssh-keygen -f ssh/wics
. Then, log intowics@aviary.cs.umanitoba.ca
(using your own key or password) and add the contents ofssh/wics.pub
to~/.ssh/authorized_keys
. - Generate a secure secret.
You can do this with something like
head -c256 /dev/urandom | md5sum | cut -d' ' -f1
(justmd5
on MacOS) or you can mash your keyboard. Save this secret somewhere. Then, runexport WEBHOOK_SECRET=<the-secret>
- Run
build.sh
. This will take quite a while, especially the first time. - Run
serverless deploy --stage prod
. This will also take a while the first time. At the end, a URL should appear that ends in/prod/deploy
. - Go to the create webhook page to create a new webhook.
Set the payload URL to the URL you saw in the last step.
Set the secret to your
WEBHOOK_SECRET
. Press "Add webhook", and you're done!
You can test the synchronization step by running serverless invoke --function deploy --log
.
If everything is set up properly, you should see the message "Successfully synchronized site".