Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

canonical-web-and-design/layer-untar-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Charm layer: untar-resources

No longer maintained

We created this layer for use in the wsgi-app charm, but we never actually started using that app in production. We have now moved most of our hosted environments over to Kubernetes, so we don't need to maintain that charm going forward.

However, I do believe that both the charm and this layer could be generally useful, so please let me, @nottrobin, know if you would like to take over this project.


A charm layer for extracting gzipped tarballs attached to the charm as Juju resources.

Usage

Include this layer in your charm by adding it to layer.yaml in your charm root:

includes: ['layer:untar-resources', ...]

Configuration

First, make sure your charm is specifying each of the resources you wish to manage in its metadata.yaml:

resources:
    {resource_name}:
        type: file
        filename: {filename}.tar.gz
        description: "{description}"

Now create a untar-resources.yaml file in your charm root to configure each .tar.gz resource you wish to extract:

resources:
    {resource_name}:
        username: {username}
        destination_path: {destination_path}
    {resource_name_2}:
        ...

Behaviour

When the charm is built and deployed, resources can be attached using Juju:

juju attach {service_name} {resource_name}={path_to_file}.tar.gz

The untar-resources layer will:

  • detect the new resource
  • extract it into the configured {destination_path}
  • change ownership on the extracted files to {username}

If a newer resource is attached the contents of {destination_path} will be replaces, and a backup of the previous resource will be kept in {destination_path}.previous. Older versions of resources will be descarded.

Example

For an example implementation, see the Webteam's wsgi-app charm.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages