Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Remove packages as master is not production anymore (#116)
Browse files Browse the repository at this point in the history
As part of #86 the master branch will not be used anymore. By now, all packages have been moved over to the production branch and it is ready to be deployed under `epr.elastic.co`. All future contributions of packages should go to the production branch or as soon as staging and snapshot deployment are fully available + promotion script, follow the new process.

This PR removes all packages and big junk of the code. Further cleanup will be needed. The goal of this PR is to make sure this registry is not used anymore moving forward.
  • Loading branch information
ruflin authored Jul 3, 2020
1 parent 6a6fac0 commit d036619
Show file tree
Hide file tree
Showing 2,859 changed files with 9 additions and 180,162 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

# Package Storage
This is a storage repository for the packages served through the [package registry](https://github.com/elastic/package-registry) service.

It contains 3 branches with the packages for the different environments:

* production
* staging
* snapshot
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/elastic/package-storage
go 1.12

require (
github.com/elastic/package-registry v0.4.1-0.20200702132954-41c150c8020e
github.com/elastic/package-registry v0.4.1-0.20200702132954-41c150c8020e // indirect
github.com/magefile/mage v1.9.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.4.0
github.com/pkg/errors v0.9.1 // indirect
github.com/stretchr/testify v1.4.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
116 changes: 0 additions & 116 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import (
"path/filepath"

"github.com/magefile/mage/sh"
"github.com/pkg/errors"

"github.com/elastic/package-registry/util"
)

var (
Expand All @@ -24,111 +21,6 @@ var (
)

func Build() error {
err := os.RemoveAll(publicDir)
if err != nil {
return err
}

err = os.MkdirAll(publicDir, 0755)
if err != nil {
return err
}

err = buildPackages()
if err != nil {
return err
}

err = dryRunPackageRegistry()
if err != nil {
return err
}
return nil
}

func buildPackages() error {
packagePaths, err := findPackages()
if err != nil {
return err
}

for _, packagePath := range packagePaths {
srcDir := packagePath + "/"
p, err := util.NewPackage(srcDir)
if err != nil {
return err
}
dstDir := filepath.Join(publicDir, "package", p.Name, p.Version)

err = copyPackageFromSource(srcDir, dstDir)
if err != nil {
return err
}
}
return nil
}

func findPackages() ([]string, error) {
var matches []string
for _, sourceDir := range packagePaths {
err := filepath.Walk(sourceDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

f, err := os.Stat(path)
if err != nil {
return err
}

if !f.IsDir() {
return nil // skip as the path is not a directory
}

manifestPath := filepath.Join(path, "manifest.yml")
_, err = os.Stat(manifestPath)
if os.IsNotExist(err) {
return nil
}
matches = append(matches, path)
return filepath.SkipDir
})
if err != nil {
return nil, err
}
}
return matches, nil
}

func copyPackageFromSource(src, dst string) error {
err := os.MkdirAll(dst, 0755)
if err != nil {
return err
}
err = sh.RunV("rsync", "-a", src, dst)
if err != nil {
return err
}

return nil
}

func dryRunPackageRegistry() error {
currentDir, err := os.Getwd()
if err != nil {
return errors.Wrap(err, "reading current directory failed")
}
defer os.Chdir(currentDir)

err = os.Chdir(buildDir)
if err != nil {
return errors.Wrapf(err, "can't change directory to %s", buildDir)
}

err = sh.Run("go", "run", "github.com/elastic/package-registry", "-dry-run=true")
if err != nil {
return errors.Wrap(err, "package-registry dry-run failed")
}
return nil
}

Expand Down Expand Up @@ -169,11 +61,3 @@ func Vendor() error {
}
return nil
}

func TestIntegration() error {
err := Build()
if err != nil {
return err
}
return sh.RunV("go", "test", "testing/main_integration_test.go", "-v", "-tags=integration", "2>&1", "|", "go-junit-report", ">", "junit-report.xml")
}
23 changes: 0 additions & 23 deletions packages/aws/0.0.3/dataset/billing/agent/stream/stream.yml.hbs

This file was deleted.

33 changes: 0 additions & 33 deletions packages/aws/0.0.3/dataset/billing/fields/base-fields.yml

This file was deleted.

50 changes: 0 additions & 50 deletions packages/aws/0.0.3/dataset/billing/fields/ecs.yml

This file was deleted.

10 changes: 0 additions & 10 deletions packages/aws/0.0.3/dataset/billing/fields/fields.yml

This file was deleted.

19 changes: 0 additions & 19 deletions packages/aws/0.0.3/dataset/billing/fields/package-fields.yml

This file was deleted.

15 changes: 0 additions & 15 deletions packages/aws/0.0.3/dataset/billing/manifest.yml

This file was deleted.

34 changes: 0 additions & 34 deletions packages/aws/0.0.3/dataset/cloudtrail/agent/stream/s3.yml.hbs

This file was deleted.

Loading

0 comments on commit d036619

Please sign in to comment.