Skip to main content

update data-image

Overview#

You can update your data images to enable or disable sharing with others, and add or remove Tags by using the update command.

Team sharing currently only works with GitHub authentication. Microsoft authentication is not supported.

Lifetime#

You can specify a lifetime for a data image via the lifetime flag. This will automatically delete your data image after the time specified, in time duration format (number followed by a unit suffix. Valid units are "h", "m", "s").

If no value is provided, your data image will have an unlimited lifetime, and will only be deleted if you explicitly request it.

If there are data containers running for the expired data image, the data image will not be removed.

Organisations#

If you are an admin of your organisation, you can use the --org command to update data-images that are part of your organisation.

Commands#

spawnctl update data-image <ImageName[:Tag]_Or_ImageID> --team <GitHub_Team1> --team <GitHub_Team2>
spawnctl update data-image <ImageName[:Tag]_Or_ImageID> --team <GitHub_Team1> --remove
spawnctl update data-image <ImageName[:Tag]_Or_ImageID> --tag <Tag1> --tag <Tag2>
spawnctl update data-image <ImageName[:Tag]_Or_ImageID> --tag <Tag1> --remove
spawnctl update data-image <ImageName[:Tag]_Or_ImageID> --lifetime 2h

To rename an existing data image use the --name option:

spawnctl update data-image <OldImageName[:Tag]_Or_ImageID> --name <NewImageName>

Tutorial#

In this tutorial we will create a data image, then share the data image with a GitHub team and add a Tag.

As a prerequisite you should've followed the instructions to install spawnctl

  1. Create a file development.yaml with your data image specifications.

    sourceType: empty
    name: dev
    engine: postgresql
    version: 11.0

    In this case we want to create a PostgreSQL data image that is completely empty and is named dev.

  2. Run the following command to create a data image.

    $ spawnctl create data-image -f ./development.yaml
    Data image 'dev' (10986) created!
  3. You can verify your data image was properly created by running the following command.

    $ spawnctl get data-images
    ID Name Tags Engine SourceType Status CreatedAt Teams Owner
    10986 dev PostgreSQL Empty Completed 2019-03-26T11:50:35Z true

Notice that both the tags and teams columns have no values.

  1. Run the following command to share the image with a specified team and add a tag.

    $ spawnctl update data-image dev --team red-gate:spawn-developers --tag v1.0
    Image : 'dev' updated
  2. You can now verify that the image is shared with the specified team

    $ spawnctl get data-images
    ID Name Tags Engine SourceType Status CreatedAt Teams Owner
    10986 dev v1.0 PostgreSQL Empty Completed 2019-03-26T11:50:35Z red-gate:spawn-developers true

Providing the --remove flag will remove the specified teams and/or tags from the data image.