Get started with Nightwatch on Vapor
Setting | Value |
---|---|
Type | Worker Server |
Region | Same as your Vapor application |
Server Size | t3.micro (the Nightwatch Agent is lightweight, and should not require a large instance) |
Private Network | The Vapor network to which your Vapor application is connected |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
is your Nightwatch token, and 10.0.0.x
is the private IP address of your worker server (you can find this under the server’s name above the Environment dialogue).
Setting | Value |
---|---|
Command | php artisan nightwatch:agent |
Directory | /home/forge/YOUR_SITE_NAME (where YOUR_SITE_NAME is the name of the site you created in Step 2) |
2407
10.0.0.0/21
Allow
10.0.0.x
is the private IP address of your worker server
vapor.yml
file ensure that the network:
directive matches the Vapor network which you specified when creating your Forge worker server. This ensures that your Vapor application can communicate with the Nightwatch Agent running on that worker.
curl
to ping the Deployment Trigger URL during the deploy step in the vapor.yml
:
network:
directive in your vapor.yml
file matches the network specified when creating your Forge worker server. This ensures that the Vapor application can communicate with the Nightwatch Agent running on your Forge worker.
You must also ensure that the firewall rule created in the Forge worker allows traffic from the Vapor network to the Nightwatch Agent port (default 2407
).
NIGHTWATCH_INGEST_URI
environment variables in Forge/Vapor, and adding the respective firewall rules in Forge. Remember also to ensure that the NIGHTWATCH_TOKEN
specified in each Forge Site is correct for the corresponding Vapor application/environment.