Skip to content

Commit

Permalink
Merge pull request #76 from SIkebe/develop
Browse files Browse the repository at this point in the history
v0.6.0
  • Loading branch information
SIkebe authored May 5, 2019
2 parents 8e3568a + 39a9f30 commit 919bd0f
Show file tree
Hide file tree
Showing 37 changed files with 1,230 additions and 618 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
/**/bin
/**/obj
/packages
/tools
!/tools/packages.config
/tools
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project>

<PropertyGroup>
<LangVersion>7.3</LangVersion>
<VersionPrefix>0.5.0</VersionPrefix>
<LangVersion>8.0</LangVersion>
<NullableContextOptions>enable</NullableContextOptions>
<VersionPrefix>0.6.0</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down
13 changes: 7 additions & 6 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project>
<ItemGroup>
<PackageReference Update="CommandLineParser" Version="2.4.3" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="2.2.1" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
<PackageReference Update="CommandLineParser" Version="2.5.0" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.2" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
<PackageReference Update="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Update="Moq" Version="4.10.1" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
<PackageReference Update="octokit" Version="0.32.0" />
<PackageReference Update="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions GbUtil.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Rule Id="CA1308" Action="None" />
<Rule Id="CA1707" Action="None" />
<Rule Id="CA2007" Action="None" />
<Rule Id="SA0001" Action="None" />
<Rule Id="SA1008" Action="None" />
<Rule Id="SA1009" Action="None" />
<Rule Id="SA1012" Action="None" />
Expand All @@ -22,10 +23,12 @@
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1402" Action="None" />
<Rule Id="SA1408" Action="None" />
<Rule Id="SA1413" Action="None" />
<Rule Id="SA1500" Action="None" />
<Rule Id="SA1501" Action="None" />
<Rule Id="SA1503" Action="None" />
<Rule Id="SA1516" Action="None" />
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1649" Action="None" />
<Rule Id="SA1652" Action="None" />
<Rule Id="SA1633" Action="None" />
Expand Down
1 change: 0 additions & 1 deletion GbUtil.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
Directory.Build.targets = Directory.Build.targets
global.json = global.json
install.bat = install.bat
nuget.config = nuget.config
tools\packages.config = tools\packages.config
README.md = README.md
EndProjectSection
Expand Down
File renamed without changes.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Utilities for GitBucket
[![Build status](https://ci.appveyor.com/api/projects/status/q1hfisqpa09662l5/?svg=true)](https://ci.appveyor.com/project/SIkebe/gitbucket-utility/)

## Requirements
* [.NET Core 2.2 SDK](https://www.microsoft.com/net/download/windows)
* GitBucket 4.30.0+ (using PostgreSQL as backend DB)
* [.NET Core 2.1.X SDK](https://www.microsoft.com/net/download/windows)
* GitBucket 4.31.X+ (using PostgreSQL as backend DB)

## Preparation
```cmd
dotnet tool install --global gbutil --version 0.5.0
dotnet tool install --global gbutil --version 0.6.0
setx ConnectionStrings:GitBucketConnection Host=host;Username=username;Password=password;Database=gitbucket
setx GitBucketUri http://localhost:8080/gitbucket/api/v3/
```
Expand All @@ -18,13 +18,13 @@ setx GitBucketUri http://localhost:8080/gitbucket/api/v3/
### `gbutil issue -t move`

```powershell
gbutil issue -t move [-s|--source] [-d|--destination] [-n|--number]
gbutil issue -s|--source -d|--destination -n|--number [-t move]
```

Move issues between repositories.

```
> gbutil issue -t move -s root/test1 -d root/test2 -n 1
> gbutil issue -s root/test1 -d root/test2 -n 1 -t move
Enter your Username: root
Enter your Password: ****
The issue has been successfully moved to http://localhost:8080/gitbucket/root/test2/issues/35.
Expand All @@ -37,15 +37,14 @@ Close the original one manually.
|`-t`|`--type`|`false`|The type of issue options. Default value is "move".|
|`-s`|`--source`|`true`|The source owner and repository to move from. Use "/" for separator like "root/repository1".|
|`-d`|`--destination`|`true`|The destination owner and repository to move to. Use "/" for separator like "root/repository2".|
|`-n`|`--number`|`false`|The issue numbers to move. Use ":" for separator.|
|`-n`|`--number`|`true`|The issue numbers to move. Use ":" for separator.|

-----


### `gbutil issue -t copy`

```powershell
gbutil issue -t copy [-s|--source] [-d|--destination] [-n|--number]
gbutil issue -t copy -s|--source -d|--destination -n|--number
```

Copy issues between repositories.
Expand All @@ -63,13 +62,13 @@ The issue has been successfully copied to http://localhost:8080/gitbucket/root/t
|`-t`|`--type`|`true`|The type of issue options. Default value is "move".|
|`-s`|`--source`|`true`|The source owner and repository to copy from. Use "/" for separator like "root/repository1".|
|`-d`|`--destination`|`true`|The destination owner and repository to copy to. Use "/" for separator like "root/repository2".|
|`-n`|`--number`|`false`|The issue numbers to copy. Use ":" for separator.|
|`-n`|`--number`|`true`|The issue numbers to copy. Use ":" for separator.|

-----

### `gbutil milestone`
```powershell
gbutil milestone [-o|--owner] [-r|--repository] [-c|--includeClosed]
gbutil milestone -o|--owner -r|--repository [-c|--includeClosed]
```
Show unclosed (by default) milestones.

Expand All @@ -92,10 +91,12 @@ There are 3 open milestones.
-----

### `gbutil release`

```powershell
gbutil release [-o|--owner] [-r|--repository] [-m|--miliestone] [-t|--target]
gbutil release -o|--owner -r|--repository -m|--miliestone [--from-pr] [--create-pr]
```
Output a release note in markdown which lists issues or pull requests of the repository related to the milistone.
Output a release note in markdown which lists issues of the repository related to the milistone.
If `--create-pr` option is specified, gbutil automatically creates Pull Request instead of console output.

```powershell
> gbutil release -o ikebe -r RepeatableTimer -m v0.1.0
Expand All @@ -109,6 +110,9 @@ The highest priority among them is "very high".
### Enhancement
* Allow one time/repeat options #1
* Add validation #3
> gbutil release -o ikebe -r RepeatableTimer -m v0.1.0 --create-pr
A new pull request has been successfully created!
```

### Options
Expand All @@ -117,4 +121,8 @@ The highest priority among them is "very high".
|`-o`|`--owner`|`true`|The owner name of the repository.|
|`-r`|`--repository`|`true`|The repository name.|
|`-m`|`--milestone`|`true`|The milestone to publish a release note.|
|`-t`|`--target`|`false`|The switch whether publish a release note based on issues or pull requests.<br>Predefined values are "issues" or "pullrequests".<br> Default value is "issues".|
|-|`--from-pr`|`false`|If specified, gbutil publish a release note based on pull requests.|
|-|`--create-pr`|`false`|If specified, gbutil automatically creates a pull request.|
|`-b`|`--base`|`false`|The name of the branch you want the changes pulled into. Default value is "master".|
|`-h`|`--head`|`false`|The name of the branch where your changes are implemented. Default value is "develop".|
|`-t`|`--title`|`false`|The title of the new pull request. Default value is the same as milestone.|
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ init:

# Build script
build_script:
- ps: .\build.ps1 -target Run-Unit-Tests
- ps: .\build.ps1 --target="Run-Unit-Tests"

# Tests
test: off
Expand All @@ -23,4 +23,4 @@ branches:

# Build cache
cache:
- tools -> build.cake
- tools -> build.cake, build.config
11 changes: 5 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#addin nuget:?package=Cake.Incubator&version=3.0.0
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -32,10 +31,10 @@ Task("Restore")

Task("Build")
.IsDependentOn("Clean")
.DoesForEach(GetFiles("./src/**/*.csproj"), (project) =>
.Does(() =>
{
DotNetCoreBuild(
project.FullPath,
"./GbUtil.sln",
new DotNetCoreBuildSettings
{
Configuration = configuration
Expand All @@ -44,10 +43,10 @@ Task("Build")

Task("Run-Unit-Tests")
.IsDependentOn("Clean")
.DoesForEach(GetFiles("./src/*.Tests/*.csproj"), (project) =>
.Does(() =>
{
DotNetCoreTest(
project.FullPath,
"./GbUtil.sln",
new DotNetCoreTestSettings
{
Configuration = configuration
Expand Down Expand Up @@ -78,7 +77,7 @@ Task("Publish")
}
DotNetCoreNuGetPush(
"./packages/GbUtil.0.5.0.nupkg",
"./packages/GbUtil.0.6.0.nupkg",
new DotNetCoreNuGetPushSettings
{
ApiKey = apiKey,
Expand Down
3 changes: 3 additions & 0 deletions build.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
CAKE_VERSION=0.33.0
DOTNET_VERSION=3.0.100-preview4-011223
Loading

0 comments on commit 919bd0f

Please sign in to comment.