Skip to content

Commit

Permalink
Move builder to cmd/builder (open-telemetry#4307)
Browse files Browse the repository at this point in the history
* Move builder to cmd/builder

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Fix path to Makefile.Common

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Fix versions.yaml entry for the builder

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling authored Oct 29, 2021
1 parent 2981b3c commit e168df5
Show file tree
Hide file tree
Showing 34 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/builder"
directory: "/cmd/builder"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: "Inform Incompatible PRs"
on:
pull_request:
paths-ignore:
- 'builder/**'
- 'cmd/builder/**'
branches:
- main

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-and-test-windows
on:
push:
branches: [ main ]
paths-ignore:
- 'builder/**'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ on:
push:
branches: [ main ]
paths-ignore:
- 'builder/**'
- 'cmd/builder/**'
pull_request:
paths-ignore:
- 'builder/**'
- 'cmd/builder/**'

jobs:
check-links:
Expand Down
1 change: 0 additions & 1 deletion builder/Makefile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ jobs:
with:
version: latest
args: release --rm-dist
workdir: cmd/builder
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions cmd/builder/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions builder/cmd/root.go → cmd/builder/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cmd // import "go.opentelemetry.io/collector/builder/cmd"
package cmd // import "go.opentelemetry.io/collector/cmd/builder/cmd"

import (
"fmt"
Expand All @@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"go.opentelemetry.io/collector/builder/internal/builder"
"go.opentelemetry.io/collector/cmd/builder/internal/builder"
)

var (
Expand Down Expand Up @@ -76,7 +76,7 @@ func Execute() error {
cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base")
cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files")
cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH")
cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "go.opentelemetry.io/collector/builder", "The Go module for the new distribution")
cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "go.opentelemetry.io/collector/cmd/builder", "The Go module for the new distribution")

// version of this binary
cmd.AddCommand(versionCmd)
Expand Down
2 changes: 1 addition & 1 deletion builder/go.mod → cmd/builder/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

module go.opentelemetry.io/collector/builder
module go.opentelemetry.io/collector/cmd/builder

go 1.17

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package builder // import "go.opentelemetry.io/collector/builder/internal/builder"
package builder // import "go.opentelemetry.io/collector/cmd/builder/internal/builder"

import (
"errors"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package builder // import "go.opentelemetry.io/collector/builder/internal/builder"
package builder // import "go.opentelemetry.io/collector/cmd/builder/internal/builder"

import (
"errors"
Expand All @@ -23,7 +23,7 @@ import (
"text/template"
"time"

"go.opentelemetry.io/collector/builder/internal/scaffold"
"go.opentelemetry.io/collector/cmd/builder/internal/scaffold"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold"
package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold"

const Components = `
// Copyright 2020 OpenTelemetry Authors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold"
package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold"

const Gomod = `
module {{.Distribution.Module}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold"
package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold"

const Main = `
// Copyright 2020 OpenTelemetry Authors
Expand Down
2 changes: 1 addition & 1 deletion builder/main.go → cmd/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"os"

"go.opentelemetry.io/collector/builder/cmd"
"go.opentelemetry.io/collector/cmd/builder/cmd"
)

func main() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module-sets:
version: v0.38.0
modules:
- go.opentelemetry.io/collector
- go.opentelemetry.io/collector/cmd/builder
- go.opentelemetry.io/collector/model
- go.opentelemetry.io/collector/builder
excluded-modules:
- go.opentelemetry.io/collector/internal/tools

0 comments on commit e168df5

Please sign in to comment.