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. The double dash (
--
) is important to separate any arguments you pass to your command from the commands passed to veloctl
. But don't worry, we'll let you know if you forget it!Velocity automatically adds the relevant environment variables to your environment and routes any dependency from your local computer to the remote environment, so you won't have to worry about your dependencies and how to connect to them! To see what we are doing, check the Verbosity section.
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
-v
/--verbose
flag 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] ANALYTICS_URL=http://127.0.0.1:52950
[VELOCTL] RABBITMQ_URL=amqp://PtYS0Qfl:[email protected]:54416/queue1
[VELOCTL] Executing command: go run ./
veloctl
merges your current environment variables with those that were injected during execution. Locally defined environment variables, such as
RABBITMQ_URL,
will be overwritten with the value defined in your environment.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-run
flag (which also invokes the --verbose
flag).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] REACT_APP_SERVICE_URL=http://127.0.0.1:3002
[VELOCTL] Will execute command: yarn start
[VELOCTL] Service 'website' will also be accessible via https://website-almighty-wednesday-51.awesomedev.com
Last modified 1mo ago