rcloadenv

command module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

rcloadenv

rcloadenv is a tool for loading configuration from the Runtime Config API.

CircleCI Build Status

Installation

The language-specific implementations all load configurations from the Runtime Config API. Choose the one that best fits your development environment.

Go package
go get -u github.com/GoogleCloudPlatform/rcloadenv
Python package
pip install rcloadenv

For more information on using rcloadenv with Python, see python/README.rst.

Node.js package

Using npm:

npm install -g @google-cloud/rcloadenv

Using yarn:

yarn global add @google-cloud/rcloadenv

For more information on using rcloadenv with Node.js, see nodejs/README.md.

Ruby package

Install the gem:

gem install rcloadenv

Or include "rcloadenv" in your application's Gemfile.

For more information on using rcloadenv with Ruby, see ruby/README.md.

Usage

First, create a configuration using the Google Cloud SDK.

gcloud beta runtime-config configs create my-config

Then set the variables you wish to load. Variable names will be transformed from lowercase to uppercase, separated by underscores.

gcloud beta runtime-config configs variables set \
    my-variable-name my-value \
    --is-text --config-name my-config

To specify the project, set the GOOGLE_CLOUD_PROJECT environment variable.

export GOOGLE_CLOUD_PROJECT=my-project-id

Use the rcloadenv command to launch your process.

rcloadenv my-config -- bash -c 'echo $MY_VARIABLE_NAME'

Disclaimer

This is not an official Google product, experimental or otherwise.

Contributing changes

Licensing

Documentation

Overview

rcloadenv reads environment variables from the Google Cloud RuntimeConfig API.

It outputs environment variables as separate lines (e.g. export VARIABLE_NAME=value) so that the output can be sourced to set the variables in a shell.

If an environment variable is already set, it does not override it. The config name is set via the environment variable GOOGLE_RUNTIME_CONFIG_NAME If not set, the command exits without outputting.

See https://cloud.google.com/deployment-manager/runtime-configurator/create-and-delete-runtimeconfig-resources for how to create a config and set variable values with the Cloud SDK.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL