isn/README.md

93 lines
2.2 KiB
Markdown

# ISN
[![pipeline status](http://gitlab.pschneider.fr/Paul/nuget-host/badges/main/pipeline.svg)](http://gitlab.pschneider.fr/Paul/nuget-host/-/commits/main)
## Usage
````sh
dotnet user-secrets set ConnectionStrings:DefaultConnection "Server=<lame-pgserver>;Port=<lame-pgport>;Database=<lame-dbname>;Username=<lame-dbusername>;Password=<lame-dbpass>;"
isnd&
# get an api-key from <http://localhost:5000/ApkKeys>
isn push -k <lame-api-key> -s http://localhost:5000/index.json your-lame-versionned.nupkg
wget http://localhost:5000/package/index.json?q=your&prerelease=true&semVerLevel=2.0.0
````
## Installation
Depuis le dossier de la solution, compiler la solution :
````bash
dotnet build /restore -c Release
dotnet publish -c Release
````
### Déployer le serveur
````bash
sudo mkdir -p /srv/www/isnd
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
sudo cp contrib/isnd /etc/init.d/isnd
sudo chmod +x /etc/init.d/isnd
sudo chown -R www-data.www-data /srv/www/isnd
sudo systemctl daemon-reload
````
* Créer une base de donées Postgresql,
* ajuster un fichier de configuration `/srv/www/isnd/appsettings.Production.json`
* Démarrer le serveur :
````bash
sudo systemctl start isnd
````
* Activer le serveur :
````bash
sudo systemctl enable isnd
````
### Installer le client
````bash
sudo mkdir /usr/local/lib/isn
sudo cp -a src/isn/bin/Release/net472/* /usr/local/lib/isn
sudo chown -R root.root /usr/local/lib/isn
sudo chmod +x /usr/local/lib/isn/isn.exe
sudo rm -f /usr/local/bin/isn
sudo cp contrib/isn /usr/local/bin/isn
sudo chmod +x /usr/local/bin/isn
sudo chown root.root /usr/local/bin/isn
````
### Mises à jour
````bash
# compiler tout
dotnet publish -c Release
# MAJ du serveur
sudo systemctl stop isnd
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
sudo systemctl start isnd
# MAJ du client
sudo cp -a src/isn/bin/Release/net472/* /usr/local/lib/isn
sudo chmod +x /usr/local/lib/isn/isn.exe
````
## TODO
````bash
Failed to retrieve information about 'Yavsc.Abstract' from remote source 'http://isn.pschneider.fr/package/FindPackagesById()?id='Yavsc.Abstract'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
isn set-api-key
isn add
isn sources
````