Skip to content

Commit

Permalink
fix pathes without package prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Dec 3, 2019
1 parent adbf9da commit 401ed35
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions dev/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ func buildPackage(packagesBasePath string, p util.Package) error {
}

if tarGz {
err = os.MkdirAll("../epr/package/"+p.Name, 0755)
err = os.MkdirAll("../epr/"+p.Name, 0755)
if err != nil {
return err
}

err = sh.RunV("tar", "cvzf", "../epr/package/"+p.Name+"/"+p.GetPath()+".tar.gz", filepath.Base(p.GetPath())+"/")
err = sh.RunV("tar", "cvzf", "../epr/"+p.Name+"/"+p.GetPath()+".tar.gz", filepath.Base(p.GetPath())+"/")
if err != nil {
return fmt.Errorf("Error creating package: %s: %s", p.GetPath(), err)
}
Expand Down
4 changes: 2 additions & 2 deletions docs/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"ingest_pipeline": "pipeline-entry"
}
],
"download": "/package/example-1.0.0.tar.gz",
"path": "/package/example/example-1.0.0"
"download": "/epr/example/example-1.0.0.tar.gz",
"path": "/package/example-1.0.0"
}
4 changes: 2 additions & 2 deletions docs/api/search-category-logs.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
Expand Down
8 changes: 4 additions & 4 deletions docs/api/search-category-metrics.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
},
{
"description": "This is the foo integration",
"download": "/package/foo-1.0.0.tar.gz",
"download": "/epr/foo/foo-1.0.0.tar.gz",
"name": "foo",
"path": "/package/foo/foo-1.0.0",
"path": "/package/foo-1.0.0",
"title": "Foo",
"type": "solution",
"version": "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions docs/api/search-kibana652.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"description": "This is the example integration.",
"download": "/package/example-0.0.2.tar.gz",
"download": "/epr/example/example-0.0.2.tar.gz",
"name": "example",
"path": "/package/example/example-0.0.2",
"path": "/package/example-0.0.2",
"title": "Example",
"type": "integration",
"version": "0.0.2"
Expand Down
8 changes: 4 additions & 4 deletions docs/api/search-kibana721.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
},
{
"description": "This is the foo integration",
"download": "/package/foo-1.0.0.tar.gz",
"download": "/epr/foo/foo-1.0.0.tar.gz",
"name": "foo",
"path": "/package/foo/foo-1.0.0",
"path": "/package/foo-1.0.0",
"title": "Foo",
"type": "solution",
"version": "1.0.0"
Expand Down
8 changes: 4 additions & 4 deletions docs/api/search-package-example.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"description": "This is the example integration.",
"download": "/package/example-0.0.2.tar.gz",
"download": "/epr/example/example-0.0.2.tar.gz",
"name": "example",
"path": "/package/example/example-0.0.2",
"path": "/package/example-0.0.2",
"title": "Example",
"type": "integration",
"version": "0.0.2"
},
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
Expand Down
12 changes: 6 additions & 6 deletions docs/api/search-package-internal.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
},
{
"description": "This is the foo integration",
"download": "/package/foo-1.0.0.tar.gz",
"download": "/epr/foo/foo-1.0.0.tar.gz",
"name": "foo",
"path": "/package/foo/foo-1.0.0",
"path": "/package/foo-1.0.0",
"title": "Foo",
"type": "solution",
"version": "1.0.0"
},
{
"description": "Internal package",
"download": "/package/internal-1.2.0.tar.gz",
"download": "/epr/internal/internal-1.2.0.tar.gz",
"internal": true,
"name": "internal",
"path": "/package/internal/internal-1.2.0",
"path": "/package/internal-1.2.0",
"title": "Internal",
"type": "integration",
"version": "1.2.0"
Expand Down
8 changes: 4 additions & 4 deletions docs/api/search.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"description": "This is the example integration",
"download": "/package/example-1.0.0.tar.gz",
"download": "/epr/example/example-1.0.0.tar.gz",
"name": "example",
"path": "/package/example/example-1.0.0",
"path": "/package/example-1.0.0",
"title": "Example Integration",
"type": "integration",
"version": "1.0.0"
},
{
"description": "This is the foo integration",
"download": "/package/foo-1.0.0.tar.gz",
"download": "/epr/foo/foo-1.0.0.tar.gz",
"name": "foo",
"path": "/package/foo/foo-1.0.0",
"path": "/package/foo-1.0.0",
"title": "Foo",
"type": "solution",
"version": "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions testdata/public/package/example-0.0.2/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"/package/example-0.0.2/kibana/visualization/ab48c3f0-5ca6-11e9-8477-077ec9664dbd.json"
],
"format_version": "1.0.0",
"download": "/package/example-0.0.2.tar.gz",
"path": "/package/example/example-0.0.2"
"download": "/epr/example/example-0.0.2.tar.gz",
"path": "/package/example-0.0.2"
}
4 changes: 2 additions & 2 deletions testdata/public/package/example-1.0.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"ingest_pipeline": "pipeline-entry"
}
],
"download": "/package/example-1.0.0.tar.gz",
"path": "/package/example/example-1.0.0"
"download": "/epr/example/example-1.0.0.tar.gz",
"path": "/package/example-1.0.0"
}
4 changes: 2 additions & 2 deletions testdata/public/package/foo-1.0.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"/package/foo-1.0.0/manifest.yml"
],
"format_version": "1.0.0",
"download": "/package/foo-1.0.0.tar.gz",
"path": "/package/foo/foo-1.0.0"
"download": "/epr/foo/foo-1.0.0.tar.gz",
"path": "/package/foo-1.0.0"
}
4 changes: 2 additions & 2 deletions testdata/public/package/internal-1.2.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
],
"internal": true,
"format_version": "1.0.0",
"download": "/package/internal-1.2.0.tar.gz",
"path": "/package/internal/internal-1.2.0"
"download": "/epr/internal/internal-1.2.0.tar.gz",
"path": "/package/internal-1.2.0"
}
4 changes: 2 additions & 2 deletions util/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ func (p *Package) GetPath() string {
}

func (p *Package) GetDownloadPath() string {
return "/package/" + p.Name + "-" + p.Version + ".tar.gz"
return "/epr/" + p.Name + "/" + p.Name + "-" + p.Version + ".tar.gz"
}

func (p *Package) GetUrlPath() string {
return "/package/" + p.Name + "/" + p.Name + "-" + p.Version
return "/package/" + p.Name + "-" + p.Version
}

0 comments on commit 401ed35

Please sign in to comment.