Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

itowlson
Copy link
Collaborator

Fixes #2955.

$ rm -rf ~/.local/share/spin/templates/
$ spin templates install --tar https://github.com/fermyon/spin/archive/refs/tags/v3.0.0.tar.gz
Copying remote template source
Installing template http-go...
Installing template redis-go...
Installing template http-grain...
Installing template http-empty...
Installing template redis-rust...
Installing template static-fileserver...
Installing template http-rust...
Installing template http-zig...
Installing template redirect...
Installing template http-c...
Installing template http-php...
Installed 11 template(s)

+------------------------------------------------------------------------+
| Name                Description                                        |
+========================================================================+
| http-c              HTTP request handler using C and the Zig toolchain |
| http-empty          HTTP application with no components                |
| http-go             HTTP request handler using (Tiny)Go                |
| http-grain          HTTP request handler using Grain                   |
| http-php            HTTP request handler using PHP                     |
| http-rust           HTTP request handler using Rust                    |
| http-zig            HTTP request handler using Zig                     |
| redirect            Redirects a HTTP route                             |
| redis-go            Redis message handler using (Tiny)Go               |
| redis-rust          Redis message handler using Rust                   |
| static-fileserver   Serves static files from an asset directory        |
+------------------------------------------------------------------------+

Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some nits that I'd love to see addressed, but nothing is blocking.

}
}

async fn download_untar_local(url: &Url) -> anyhow::Result<LocalTemplateSource> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this make sense as a function on LocalTemplateSource? Like LocalTemplateSource::from_remote_tarball? Then you can leave a doc comment outlining that it downloads the tarball to a temp dir.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other "pull down a remote source" functions are free, so I've followed the same pattern for now. We can change them all to methods in a separate refactoring pass if we prefer that. In the meantime I've added the doc comment.

@itowlson itowlson force-pushed the templates-install-from-remote-tar branch from a9da922 to d3247ba Compare December 16, 2024 18:43
@itowlson itowlson force-pushed the templates-install-from-remote-tar branch from d3247ba to a6c2f94 Compare December 16, 2024 22:04
@itowlson itowlson enabled auto-merge December 16, 2024 22:06
@itowlson itowlson merged commit 6e9883e into spinframework:main Dec 16, 2024
17 checks passed
jandubois added a commit to jandubois/rancher-desktop that referenced this pull request Dec 19, 2024
jandubois added a commit to jandubois/rancher-desktop that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install templates from a remote tarball
2 participants