Develop code locally
Develop code locally with remote dependencies
Velocity creates your environment in the cloud while enabling you to "replace" parts of it during development.
Just as you run your service locally, wrap your command with
veloctl env develop:
veloctl env develop --service serviceName -- <command>
# Running a node.js application:
$ veloctl env develop --service website -- yarn start
[VELOCTL] Developing service 'website' in the environment 'almighty-wednesday-51'...
[VELOCTL] Executing command: yarn start
[VELOCTL] Service 'website' is also accessible via https://website-almighty-wednesday-51.awesomedev.com
This stops the remotely running service
website, starts the service locally, and establishes network connectivity between the local and remote environments.
If your service runs inside a docker container (via
docker run), that's fine, we support that too! Just pass the same command to
veloctl env develop:
veloctl env develop --service serviceName -- docker run [...]
If you're into the details, you can also pass the
--verboseflag to see exactly what environment variables are injected and which ports are forwarded into your environment.
veloctl env develop -v --service worker -- go run ./
[VELOCTL] Developing service 'worker' in environment 'glorious-saturday-15'...
[VELOCTL] Forwarding: localhost:54416 => rabbitmq:5672
[VELOCTL] Forwarding: localhost:52950 => analytics:3000
[VELOCTL] Injecting environment variables:
[VELOCTL] RABBITMQ_URL=amqp://PtYS0Qfl:[email protected]:54416/queue1
[VELOCTL] Executing command: go run ./
In some cases, you might want to test how your command would execute if you run it through Velocity. To do so, use the
--dry-runflag (which also invokes the
veloctl env develop --dry-run --service website -- yarn start
[VELOCTL] Will develop service 'website' in environment 'almighty-wednesday-51'...
[VELOCTL] Will forward: localhost:3002 => backend:3002
[VELOCTL] Will inject the environment variables:
[VELOCTL] Will execute command: yarn start
[VELOCTL] Service 'website' will also be accessible via https://website-almighty-wednesday-51.awesomedev.com