a new way to pre-fill disk storage (#1747)

* a new way to pre-fill disk storage
* changed a headline to a bold'ed text
This commit is contained in:
Alex
2021-12-23 00:46:16 +03:00
committed by GitHub
parent 567c939ac4
commit 6da5568081
@@ -18,7 +18,9 @@ You'll need to produce the following assets from module source code:
The `source.zip` file has a specific directory structure and the `$VERSION.info` has a JSON structure, both of which you'll need to get right in order for Athens to serve up the right dependency formats that the Go toolchain will accept.
>We don't recommend that you create these assets yourself. Instead, use [pacmod](https://github.com/plexsystems/pacmod)
>We don't recommend that you create these assets yourself. Instead, use [pacmod](https://github.com/plexsystems/pacmod) or [gopack](https://github.com/alex-user-go/gopack)
## Using pacmod
To install the `pacmod` tool, run `go get` like this:
@@ -28,7 +30,7 @@ $ go get github.com/plexsystems/pacmod
This command will install the `pacmod` binary to your `$GOPATH/bin/pacmod` directory, so make sure that is in your `$PATH`.
# Next, run `pacmod` to create assets
**Next, run `pacmod` to create assets**
After you have `pacmod`, you'll need the module source code that you want to package. Before you run the command, set the `VERSION` variable in your environment to the version of the module you want to generate assets for.
@@ -52,6 +54,28 @@ Once this command is done, you'll notice three new files in the same same direct
- `$VERSION.info`
- `$VERSION.zip`
## Using gopack
>To use this method you need docker-compose installed.
Fork gopack project and clone it to your local machine (or just download files to your computer)
Edit <code>goget.sh</code> with a list of go modules you want to download:
```bash
#!/bin/bash
go get github.com/my/module1;
go get github.com/my/module2;
```
Run
```bash
docker-compose up --abort-on-container-exit
```
Once this command is done, you'll notice in the ATHENS_STORAGE folder all modules ready to be moved to your Athens disk storage.
# Next, move assets into Athens storage directory
Now that you have assets built, you need to move them into the location of the Athens disk storage. In the below commands, we'll assume `$STORAGE_ROOT` is the environment variable that points to the top-level directory that Athens uses for its on-disk.