Skip to content

Commit b2c7fc4

Browse files
committed
docs about fork
1 parent a020eaa commit b2c7fc4

File tree

1 file changed

+111
-16
lines changed

1 file changed

+111
-16
lines changed

readme.md

Lines changed: 111 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,119 @@
44

55
A lightweight [NuGet service](https://docs.microsoft.com/en-us/nuget/api/overview) implementation.
66

7-
## Getting Started
7+
About this fork:
8+
- we have previously created and used [LiGet](https://github.com/ai-traders/liget/), now we are moving to BaGet.
9+
- [upstream BaGet](https://github.com/loic-sharma/BaGet) has several missing pieces which we added in the fork.
10+
- added unit, integration tests and e2e tests with paket and nuget cli.
11+
- added release cycle and testing of docker image using continuous delivery practices. [PR](https://github.com/loic-sharma/BaGet/pull/108)
12+
- implements read-through cache, which [does not work upstream](https://github.com/loic-sharma/BaGet/issues/93)
13+
- uses paket and FAKE for build system. [PR](https://github.com/loic-sharma/BaGet/pull/108)
14+
- uses [Carter](https://github.com/CarterCommunity/Carter) for routing rather than bare Asp routing.
15+
- we intend to merge all this upstream, but review is slow and we need working server now.
16+
- we intend to move V2 from LiGet to BaGet.
817

9-
1. Install [.NET Core](https://www.microsoft.com/net/download)
10-
2. Run `git clone https://github.com/loic-sharma/BaGet.git`
11-
3. Navigate to `.\BaGet\src\BaGet`
12-
4. Start the service with `dotnet run`
13-
5. Open the URL `http://localhost:5000/v3/index.json` in your browser
18+
# Usage
1419

15-
For more information, please refer to [our documentation](https://loic-sharma.github.io/BaGet/).
20+
See [releases](https://github.com/ai-traders/BaGet/releases) to get docker image version.
1621

17-
## Features
22+
```
23+
docker run -ti -p 9090:9090 tomzo/baget:<version>
24+
```
1825

19-
* Cross-platform
20-
* [Dockerized](https://loic-sharma.github.io/BaGet/#running-baget-on-docker)
21-
* [Cloud ready](https://loic-sharma.github.io/BaGet/cloud/azure/)
22-
* [Supports read-through caching](https://loic-sharma.github.io/BaGet/configuration/#enabling-read-through-caching)
23-
* Can index the entirety of nuget.org. See [this documentation](https://loic-sharma.github.io/BaGet/tools/mirroring/)
24-
* Coming soon: Supports [private feeds](https://loic-sharma.github.io/BaGet/private-feeds/)
25-
* And more!
26+
For persistent data, you should mount **volumes**:
27+
- `/var/baget/packages` contains pushed private packages
28+
- `/var/baget/db` contains sqlite database
29+
- `/var/baget/cache` contains cached public packages
2630

27-
Stay tuned, more features are planned!
31+
You should change the default api key (`NUGET-SERVER-API-KEY`) used for pushing packages,
32+
by setting SHA256 into `ApiKeyHash` environment variable.
33+
34+
## On client side
35+
36+
### Usage only as private repository
37+
38+
For **dotnet CLI and nuget** you need to configure nuget config `~/.nuget/NuGet/NuGet.Config` with something like:
39+
```xml
40+
<?xml version="1.0" encoding="utf-8"?>
41+
<configuration>
42+
<packageSources>
43+
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
44+
<add key="baget" value="http://baget:9090/v3/index.json" protocolVersion="3" />
45+
</packageSources>
46+
</configuration>
47+
```
48+
49+
For paket, in `paket.dependencies`, just specify another source:
50+
```
51+
source http://baget:9090/v3/index.json
52+
```
53+
54+
### Pushing packages
55+
56+
```
57+
dotnet nuget push mypackage.1.0.0.nupkg --source http://baget:9090/v3/index.json --api-key NUGET-SERVER-API-KEY
58+
```
59+
60+
### Usage as caching proxy
61+
62+
For **dotnet CLI and nuget** you need to configure nuget config `~/.nuget/NuGet/NuGet.Config` with something like:
63+
```xml
64+
<?xml version="1.0" encoding="utf-8"?>
65+
<configuration>
66+
<packageSources>
67+
<add key="baget" value="http://baget:9090/cache/v3/index.json" protocolVersion="3" />
68+
<add key="baget" value="http://baget:9090/v3/index.json" protocolVersion="3" />
69+
</packageSources>
70+
</configuration>
71+
```
72+
73+
For paket, in `paket.dependencies`, just specify baget as the 2 only sources
74+
```
75+
source http://baget:9090/cache/v3/index.json
76+
# public packages...
77+
78+
source http://baget:9090/v3/index.json
79+
# private packages...
80+
```
81+
82+
# Development
83+
84+
We rely heavily on docker to create reproducible development environment.
85+
This allows to execute entire build process on any machine which has:
86+
- local docker daemon
87+
- docker-compose
88+
- `ide` script on path. It is a [CLI toolIDE](https://github.com/ai-traders/ide)
89+
wrapper around docker and docker-compose which deals with issues such as ownership of files,
90+
mounting proper volumes, cleanup, etc.
91+
92+
You can execute entire build from scratch to e2e tests (like [travis](.travis.yml)).
93+
- Install docker daemon if you haven't already
94+
- Install docker-compose
95+
- Install IDE
96+
```
97+
sudo bash -c "`curl -L https://raw.githubusercontent.com/ai-traders/ide/master/install.sh`"
98+
```
99+
100+
Then to execute entire build:
101+
```
102+
./tasks.sh all
103+
```
104+
105+
This will pull `dotnet-ide` [docker image](https://github.com/ai-traders/docker-dotnet-ide) which
106+
has all build and test dependencies: dotnet SDK, mono, paket CLI, FAKE, Node.js.
107+
108+
## Release cycle
109+
110+
Releases are automated from the master branch, executed by GoCD pipeline, release is published only if all tests have passed.
111+
[Travis](https://travis-ci.com/ai-traders/BaGet) executes the same tasks in the same environment and is for reference to the public community.
112+
If there is `- Unreleased` note at the top of [Changelog](CHANGELOG.md),
113+
then release is a preview, tagged as `<version>-<short-commit-sha>`.
114+
Otherwise it is a full release, tagged as `<version>`.
115+
116+
### Submitting patches
117+
118+
1. Fork and create branch.
119+
2. Commit your changes.
120+
3. Submit a PR, travis will run all tests.
121+
4. Address issues in the review and build failures.
122+
5. Before merge rebase on master `git rebase -i master` and possibly squash some of the commits.

0 commit comments

Comments
 (0)