项目作者: arnaud-dezandee

项目描述 :
Vagrant plugin to download boxes from Google GCS.
高级语言: Ruby
项目地址: git://github.com/arnaud-dezandee/vagrant-box-gcs.git
创建时间: 2020-05-25T12:52:52Z
项目社区:https://github.com/arnaud-dezandee/vagrant-box-gcs

开源协议:MIT License

下载


Vagrant Box Google Cloud Storage (GCS)

Gem Version

This is a Vagrant 2.2.0+ plugin that adds the ability to download boxes from
Google Compute Storage (GCS).

Installation

  1. $ vagrant plugin install vagrant-box-gcs

Usage

Only the gs:// protocol shorthand is supported

The plugin supports fetching compatible manifest file of versioned boxes repository. See packer-vagrant-box-gcs to create one.

From versioned box:

  1. $ vagrant box add gs://my-bucket/my-org/my-box-manifest.json

The box update command line is available when using manifest

  1. $ vagrant box update --box my-org/my-box
  1. # Vagrantfile
  2. Vagrant.configure('2') do |config|
  3. config.vm.box = 'my-org/my-box'
  4. config.vm.box_url = 'gs://my-bucket/my-org/my-box-manifest.json'
  5. end

From simple box:

  1. $ vagrant box add gs://my-bucket/my-org/my-box/virtualbox.box
  1. # Vagrantfile
  2. Vagrant.configure('2') do |config|
  3. config.vm.box_url = 'gs://my-bucket/my-org/my-box/virtualbox.box'
  4. end

Authentication

Authenticating with Google Cloud services requires at most one JSON file.
Vagrant will look for credentials in the following places, preferring the first location found:

  1. A JSON file (Service Account) whose path is specified by the
    GOOGLE_APPLICATION_CREDENTIALS environment variable.

  2. A JSON file in a location known to the gcloud command-line tool.
    (gcloud auth application-default login creates it)

    On Windows, this is:

    1. %APPDATA%/gcloud/application_default_credentials.json

    On other systems:

    1. $HOME/.config/gcloud/application_default_credentials.json
  3. On Google Compute Engine and Google App Engine Managed VMs, it fetches
    credentials from the metadata server. (Needs a correct VM authentication
    scope configuration)

Auto-install

Auto-install with some shell in your Vagrantfile:

  1. # Vagrantfile
  2. unless Vagrant.has_plugin?('vagrant-box-gcs')
  3. system('vagrant plugin install vagrant-box-gcs') || exit!
  4. exit system('vagrant', *ARGV)
  5. end
  6. Vagrant.configure('2') do |config|
  7. config.vm.box_url = 'gs://my-bucket/my-org/my-box/virtualbox.box'
  8. # ...
  9. end