11
11
<a href="https://github.com/bytecodealliance/registry/actions?query=workflow%3ACI"><img src="https://github.com/bytecodealliance/registry/workflows/Rust/badge.svg" alt="build status" /></a>
12
12
<a href="https://crates.io/crates/warg-cli"><img src="https://img.shields.io/crates/v/warg-cli.svg?style=flat-square" alt="Crates.io version" /></a>
13
13
<a href="https://crates.io/crates/warg-cli"><img src="https://img.shields.io/crates/d/warg-cli.svg?style=flat-square" alt="Download" /></a>
14
- <a href="https://bytecodealliance.github.io /warg-cli /"><img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="docs.rs docs" /></a>
14
+ <a href="https://docs.rs /warg-client/latest/warg_client /"><img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="docs.rs docs" /></a>
15
15
</p >
16
16
</div >
17
17
18
18
## Overview
19
19
20
- This repository contains the reference implementation of the Warg protocol, a client,
20
+ This repository contains the reference implementation of the Warg protocol, a client library ,
21
21
server, and CLI.
22
22
23
23
A Warg client and server can be used to distribute WebAssembly components to
@@ -27,21 +27,20 @@ See the [introduction](docs/README.md) for the design decisions and scope.
27
27
28
28
## Prerequisites
29
29
30
- - The latest [ stable Rust] ( https://www.rust-lang.org/tools/install ) .
30
+ - Install the latest [ stable Rust] ( https://www.rust-lang.org/tools/install ) .
31
31
32
32
## Installation
33
33
34
- To install ` warg ` , first you'll want to install
35
- [ the latest stable Rust] ( https://www.rust-lang.org/tools/install ) and then
36
- you'll execute to install the subcommand:
34
+ To install or upgrade the ` warg ` CLI:
35
+ ```
36
+ cargo install warg-cli
37
+ ```
37
38
39
+ To install or upgrade the ` warg ` reference implmentation server:
38
40
```
39
- cargo install --git https://github.com/bytecodealliance/registry
41
+ cargo install warg-server
40
42
```
41
43
42
- The [ currently published crate] ( https://crates.io/crates/warg-cli )
43
- on crates.io is a nonfunctional placeholder and these instructions will be
44
- updated to install the crates.io package once a proper release is made.
45
44
46
45
## Getting Started
47
46
@@ -156,22 +155,12 @@ warg publish revoke --name example:hello sha256:abc...
156
155
157
156
### Resetting and clearing local data
158
157
159
- To reset local data for the home registry :
158
+ To reset local package log data for registries :
160
159
```
161
160
warg reset
162
161
```
163
162
164
- To reset local data for a specific registry, such as ` registry.example.com ` :
165
- ```
166
- warg reset --registry registry.example.com
167
- ```
168
-
169
- To reset local data for all registries:
170
- ```
171
- warg reset --all
172
- ```
173
-
174
- To clear local content for all registries:
163
+ To clear downloaded package content for all registries:
175
164
```
176
165
warg clear
177
166
```
@@ -193,15 +182,29 @@ git clone https://github.com/bytecodealliance/registry
193
182
194
183
### Testing Changes
195
184
196
- Ideally, there should be tests written for all changes. Test can be run via:
185
+ Ideally, there should be tests written for all changes.
186
+
187
+ Run the tests of the in-memory implementation of the ` warg-server ` :
188
+
189
+ ```
190
+ cargo test --workspace
191
+ ```
192
+
193
+ Run the tests of the Postgres implementation of the ` warg-server ` :
197
194
198
195
```
199
- cargo test --all
196
+ docker run -d --name postgres-test -e POSTGRES_PASSWORD=password -p 5433:5432 postgres
197
+ diesel database setup --database-url postgres://postgres:password@localhost:5433/test-registry --migration-dir crates/server/src/datastore/postgres/migrations
198
+ WARG_DATABASE_URL=postgres://postgres:password@localhost:5433/test-registry cargo test --features postgres -- --nocapture
200
199
```
201
200
202
- ### Testing with Containers
201
+ You may need to install [ Docker] ( https://www.docker.com/get-started/ ) and the
202
+ [ Diesel CLI] ( https://diesel.rs/guides/getting-started ) first with the Postgres feature.
203
+
204
+ ```
205
+ cargo install diesel_cli --no-default-features --features postgres
206
+ ```
203
207
204
- See the [ local infra documentation] ( infra/local/README.md ) on how to develop and test with locally running containers.
205
208
206
209
### Submitting Changes
207
210
0 commit comments