Search…
⌃K

Feature collaboration

We often encounter situations where a few different developers or teams are collaborating on a new feature and they work on different components at the same time. As you don't want to release something which isn't fully ready and tested yet, you keep all these branches live until you are able to test them all together.
Velocity can help you work against components in different versions without having to request the other team to deploy them for you.
In this tutorial, we will show how to create an environment in which we develop the website against a future version (v1.1) of the backend:

Installation

If you already followed the Setup, feel free to skip directly into creating your environment.
macOS
Linux
Windows
# via Homebrew
brew install techvelocity/tap/veloctl
# or with a script
curl -fsSL https://releases.velocity.tech/veloctl/latest.sh | sh -s
# Via snapcraft
sudo snap install veloctl --classic
# or with a script
curl -fsSL https://releases.velocity.tech/veloctl/latest.sh | sh -s

Authenticate to Velocity

veloctl auth login
Attempting to automatically open the login page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:
https://login.velocity.tech/activate?user_code=ABCD-EFGH
and verify the following code appears:
ABCD-EFGH
* Fetching underlying Kubernetes cluster configuration...
* Stored context 'velocity-VELOACME' locally (`/Users/Marty/.kube/config`).
Welcome Marty McFly ([email protected])!

Creating your environment

In our example, we will be developing the frontend app named website against a specific version of the backend app.
Use veloctl env create to create an isolated environment for you, In this case, we've chosen to develop the website service:
veloctl env create --service website --service backend:v1.1
Watching environment freaky-tuesday-66 status... /
Point in time: 2015-10-21T19:28:00Z
Service Status Version Public URI
database In Progress mysql:5.7
backend Pending v1.1 (pending)
worker Pending ...91698f97536e95126
website Pending (pending)
Overall status: In Progress
Once the environment is ready, the CLI will show its up-to-date status:
Watching environment freaky-tuesday-66 status...
Point in time: 2015-10-21T19:28:00Z
Service Status Version Public URI
database Ready mysql:5.7
backend Ready v1.1 https://backend-freaky-tuesday-66.awesomedev.com
worker Ready ...91698f97536e95126
website Ready https://website-freaky-tuesday-66.awesomedev.com
Overall status: Ready
Your environment is ready! To develop on your services with command <CMD>, please run:
veloctl env develop --service website -- <CMD>

Running your website app

Using veloctl env develop , I can wrap my run command to start developing the application:
yarn
npm
veloctl env develop --service website -- yarn start
veloctl env develop --service website -- npm start
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!
veloctl env develop --service website -- yarn start
[VELOCTL] Developing service 'website' in environment 'freaky-tuesday-66'...
[VELOCTL] Executing command: yarn start
[VELOCTL] Service 'website' is also accessible via https://website-freaky-tuesday-66.awesomedev.com
yarn run v1.22.10
$ react-scripts start
ℹ 「wds」: Project is running at http://10.100.1.3/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /Users/Marty/website/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
Compiled successfully!
You can now view website in the browser.
Local: http://localhost:3000
On Your Network: http://10.100.1.3:3000
Note that the development build is not optimized.
To create a production build, use yarn build.
Your app is now available on http://localhost:3000 and also on https://website-freaky-friday-66.awesomedev.com !

Cleaning up

When you are done developing and ready to clean up the resources, use:
veloctl env destroy
? Are you sure you want to destroy the 'freaky-friday-66' environment? Yes
Destroying environment freaky-friday-66... \
Environment successfully destroyed

What's next?