Skip to content

Commit

Permalink
Removed cmd/otelcol, removed Make targets and github actions workfl…
Browse files Browse the repository at this point in the history
…ow (open-telemetry#4200)

* removed cmd/otelcol, removed Make targets and github actions workflow

* Added make run target back in

* change to Makefile run target

* removed docker-otelcol make rule

* removed docker-component make rule

* added back in build-binary-cmd-otelcol make rule
  • Loading branch information
erichsueh3 authored Nov 17, 2021
1 parent 7dbf1b8 commit 733ad58
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 316 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,41 +152,3 @@ jobs:
file: ./coverage.txt
fail_ci_if_error: true
verbose: true
cross-compile:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Build Collector for All Architectures
run: make binaries-all-sys
- name: Create Collector Binaries Archive
run: tar -cvf bin.tar ./bin
- name: Upload Collector Binaries
uses: actions/[email protected]
with:
name: collector-binaries
path: ./bin.tar
- name: Build Unstable Collector for All Architectures
run: make binaries-all-sys-unstable
- name: Create Unstable Collector Binaries Archive
run: tar -cvf bin-unstable.tar ./bin/*unstable
- name: Upload Unstable Collector Binaries
uses: actions/[email protected]
with:
name: collector-binaries-unstable
path: ./bin-unstable.tar
89 changes: 3 additions & 86 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ version:
@echo ${VERSION}

.PHONY: all
all: checklicense checkdoc misspell goimpi golint gotest otelcol
all: checklicense checkdoc misspell goimpi golint gotest

all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort
Expand Down Expand Up @@ -140,26 +140,9 @@ install-tools:
cd $(TOOLS_MOD_DIR) && go install github.com/jcchavezs/porto/cmd/porto
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/build-tools/multimod

.PHONY: otelcol
otelcol:
go generate ./...
$(MAKE) build-binary-internal

.PHONY: otelcol-unstable
otelcol-unstable:
go generate ./...
$(MAKE) build-binary-internal-unstable

.PHONY: run
run:
GO111MODULE=on go run --race ./cmd/otelcol/... --config ${RUN_CONFIG} ${RUN_ARGS}

.PHONY: docker-component # Not intended to be used directly
docker-component: check-component
GOOS=linux $(MAKE) $(COMPONENT)
cp ./bin/$(COMPONENT)_linux_amd64 ./cmd/$(COMPONENT)/$(COMPONENT)
docker build -t $(COMPONENT) ./cmd/$(COMPONENT)/
rm ./cmd/$(COMPONENT)/$(COMPONENT)
run: build-binary-cmd-otelcol
./bin/cmd-otelcol --config ${RUN_CONFIG} ${RUN_ARGS}

.PHONY: for-all
for-all:
Expand Down Expand Up @@ -207,72 +190,6 @@ delete-tag:
git tag -d "$${dir:2}/$${TAG}" ); \
done

.PHONY: docker-otelcol
docker-otelcol:
COMPONENT=otelcol $(MAKE) docker-component

# build collector binaries with different OS and Architecture
.PHONY: binaries-all-sys
binaries-all-sys: binaries-darwin_amd64 binaries-darwin_arm64 binaries-linux_amd64 binaries-linux_arm64 binaries-windows_amd64

.PHONY: binaries-all-sys-unstable
binaries-all-sys-unstable: binaries-darwin_amd64-unstable binaries-darwin_arm64-unstable binaries-linux_amd64-unstable binaries-linux_arm64-unstable binaries-windows_amd64-unstable

.PHONY: binaries-darwin_amd64
binaries-darwin_amd64:
GOOS=darwin GOARCH=amd64 $(MAKE) build-binary-internal

.PHONY: binaries-darwin_arm64
binaries-darwin_arm64:
GOOS=darwin GOARCH=arm64 $(MAKE) build-binary-internal

.PHONY: binaries-linux_amd64
binaries-linux_amd64:
GOOS=linux GOARCH=amd64 $(MAKE) build-binary-internal

.PHONY: binaries-linux_arm64
binaries-linux_arm64:
GOOS=linux GOARCH=arm64 $(MAKE) build-binary-internal

.PHONY: binaries-windows_amd64
binaries-windows_amd64:
GOOS=windows GOARCH=amd64 EXTENSION=.exe $(MAKE) build-binary-internal

.PHONY: binaries-darwin_amd64-unstable
binaries-darwin_amd64-unstable:
GOOS=darwin GOARCH=amd64 $(MAKE) build-binary-internal-unstable

.PHONY: binaries-darwin_arm64-unstable
binaries-darwin_arm64-unstable:
GOOS=darwin GOARCH=arm64 $(MAKE) build-binary-internal-unstable

.PHONY: binaries-linux_amd64-unstable
binaries-linux_amd64-unstable:
GOOS=linux GOARCH=amd64 $(MAKE) build-binary-internal-unstable

.PHONY: binaries-linux_arm64-unstable
binaries-linux_arm64-unstable:
GOOS=linux GOARCH=arm64 $(MAKE) build-binary-internal-unstable

.PHONY: binaries-windows_amd64-unstable
binaries-windows_amd64-unstable:
GOOS=windows GOARCH=amd64 EXTENSION=.exe $(MAKE) build-binary-internal-unstable

.PHONY: build-binary-internal
build-binary-internal:
GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ./bin/otelcol_$(GOOS)_$(GOARCH)$(EXTENSION) $(BUILD_INFO) ./cmd/otelcol

.PHONY: build-binary-internal-unstable
build-binary-internal-unstable:
GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ./bin/otelcol_$(GOOS)_$(GOARCH)$(EXTENSION)_unstable $(BUILD_INFO) -tags enable_unstable ./cmd/otelcol

.PHONY: deb-rpm-package
%-package: ARCH ?= amd64
%-package:
$(MAKE) binaries-linux_$(ARCH)
docker build -t otelcol-fpm internal/buildscripts/packaging/fpm
docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) otelcol-fpm

# Builds a collector binary of the removed cmd/otelcol directory
.PHONY: build-binary-cmd-otelcol
build-binary-cmd-otelcol:
Expand Down
20 changes: 0 additions & 20 deletions cmd/otelcol/Dockerfile

This file was deleted.

34 changes: 0 additions & 34 deletions cmd/otelcol/config.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions cmd/otelcol/main.go

This file was deleted.

24 changes: 0 additions & 24 deletions cmd/otelcol/main_others.go

This file was deleted.

62 changes: 0 additions & 62 deletions cmd/otelcol/main_windows.go

This file was deleted.

0 comments on commit 733ad58

Please sign in to comment.