Skip to content

Commit

Permalink
Remove packaging support from collector core, will be done in the rel…
Browse files Browse the repository at this point in the history
…ease (open-telemetry#3892)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Aug 25, 2021
1 parent feb6cf2 commit 0fb771a
Show file tree
Hide file tree
Showing 20 changed files with 2 additions and 753 deletions.
96 changes: 0 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ commands:
bin/otelcol_linux_arm64
bin/otelcol_linux_amd64
bin/otelcol_windows_amd64.exe
dist/otel-collector-*arm64.rpm
dist/otel-collector_*amd64.deb
dist/otel-collector-*x86_64.rpm
dist/otel-collector_*arm64.deb
dist/otel-collector-*amd64.msi
steps:
- run:
name: Check if files exist
Expand Down Expand Up @@ -134,20 +129,11 @@ workflows:
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/
- windows-msi:
requires:
- cross-compile
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/
- publish-check:
name: publish-check-main
requires:
- cross-compile
- coverage
- windows-msi
- deb-package
- rpm-package
filters:
branches:
only: main
Expand All @@ -156,9 +142,6 @@ workflows:
requires:
- cross-compile
- coverage
- windows-msi
- deb-package
- rpm-package
filters:
branches:
ignore: main
Expand All @@ -169,9 +152,6 @@ workflows:
requires:
- cross-compile
- coverage
- windows-msi
- deb-package
- rpm-package
filters:
branches:
ignore: /.*/
Expand All @@ -183,30 +163,11 @@ workflows:
requires:
- cross-compile
- coverage
- windows-msi
- deb-package
- rpm-package
filters:
branches:
only: main
tags:
ignore: /.*/
- build-package:
name: deb-package
package_type: deb
requires:
- cross-compile
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/
- build-package:
name: rpm-package
package_type: rpm
requires:
- cross-compile
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/

jobs:
setup-environment:
Expand Down Expand Up @@ -304,60 +265,3 @@ jobs:
- publish_docker_images:
repo: opentelemetry-collector-dev
tag: ${CIRCLE_SHA1}

windows-msi:
executor:
name: win/default
shell: powershell.exe
steps:
- attach_to_workspace
- run:
command: mkdir -p dist
- run:
name: Install Wix Toolset
command: .\internal\buildscripts\packaging\msi\make.ps1 Install-Tools
- run:
name: Build MSI
command: |
$Version = if ($env:CIRCLE_TAG -match '^v(\d+\.\d+\.\d+)') { $Matches[1] } else { "0.0.1" }
.\internal\buildscripts\packaging\msi\make.ps1 New-MSI -Version $Version
- run:
name: Validate MSI
command: .\internal\buildscripts\packaging\msi\make.ps1 Confirm-MSI
- persist_to_workspace:
root: ~/
paths: project/dist/*.msi

build-package:
machine:
image: ubuntu-1604:202007-01
parameters:
package_type:
type: enum
enum: ["deb", "rpm"]
steps:
- checkout
- attach_to_workspace
- run:
name: Install fpm and dependencies
command: |
sudo apt-get update
sudo apt-get install -y ruby ruby-dev rubygems build-essential rpm
gem install --no-document fpm -v 1.11.0
- run:
name: Build << parameters.package_type >> amd64 package
command: ./internal/buildscripts/packaging/fpm/<< parameters.package_type >>/build.sh "${CIRCLE_TAG:-}" "amd64" "./dist/"
- run:
name: Build << parameters.package_type >> arm64 package
command: ./internal/buildscripts/packaging/fpm/<< parameters.package_type >>/build.sh "${CIRCLE_TAG:-}" "arm64" "./dist/"
- run:
name: Test << parameters.package_type >> package
command: |
if [[ "<< parameters.package_type >>" = "deb" ]]; then
./internal/buildscripts/packaging/fpm/test.sh dist/otel-collector*amd64.deb
else
./internal/buildscripts/packaging/fpm/test.sh dist/otel-collector*x86_64.rpm
fi
- persist_to_workspace:
root: ~/
paths: project/dist
100 changes: 2 additions & 98 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,105 +196,9 @@ jobs:
with:
name: collector-binaries
path: ./bin.tar
build-package:
runs-on: ubuntu-latest
needs: [cross-compile]
strategy:
fail-fast: false
matrix:
package_type: ["deb", "rpm"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2.1.3
with:
go-version: 1.16
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
mkdir bin/
- name: Install Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install fpm
run: gem install --no-document fpm -v 1.11.0
- name: Cache Tools
id: tool-cache
uses: actions/cache@v2
env:
cache-name: cache-tool-binaries
with:
path: /home/runner/go/bin
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
- name: Download Collector Binaries
uses: actions/download-artifact@v1
with:
name: collector-binaries
- name: Extract Binaries Archive
run: tar -xvf collector-binaries/bin.tar
- name: Set Release Tag
id: github_tag
run: ./.github/workflows/scripts/set_release_tag.sh
- name: Build ${{ matrix.package_type }} amd64 package
run: ./internal/buildscripts/packaging/fpm/${{ matrix.package_type }}/build.sh "${{ steps.github_tag.outputs.tag }}" "amd64" "./dist/"
- name: Build ${{ matrix.package_type }} arm64 package
run: ./internal/buildscripts/packaging/fpm/${{ matrix.package_type }}/build.sh "${{ steps.github_tag.outputs.tag }}" "arm64" "./dist/"
- name: Test ${{ matrix.package_type }} package
run: |
if [[ "${{ matrix.package_type }}" = "deb" ]]; then
./internal/buildscripts/packaging/fpm/test.sh dist/otel-collector*amd64.deb
else
./internal/buildscripts/packaging/fpm/test.sh dist/otel-collector*x86_64.rpm
fi
- name: Upload Packages
uses: actions/upload-artifact@v2.2.4
with:
name: build-packages
path: ./dist
windows-msi:
runs-on: windows-latest
needs: [cross-compile]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2.1.3
with:
go-version: 1.16
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
mkdir bin/
- name: Download Binaries
uses: actions/download-artifact@v1
with:
name: collector-binaries
- name: Extract Binaries Archive
run: tar -xvf collector-binaries/bin.tar
- name: Install Wix Toolset
run: .\internal\buildscripts\packaging\msi\make.ps1 Install-Tools
- name: Build MSI
run: |
$Version = if ($env:GITHUB_REF -match '^refs/tags/(\d+\.\d+\.\d+)') { $Matches[1] } else { "0.0.1" }
.\internal\buildscripts\packaging\msi\make.ps1 New-MSI -Version $Version
- name: Validate MSI
run: .\internal\buildscripts\packaging\msi\make.ps1 Confirm-MSI
- name: Upload MSI
uses: actions/upload-artifact@v2.2.4
with:
name: msi-binaries
path: ./dist
publish-dev:
runs-on: ubuntu-latest
needs: [build-package, windows-msi]
needs: [cross-compile]
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'open-telemetry/opentelemetry-collector'
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -354,7 +258,7 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD}}
publish-stable:
runs-on: ubuntu-latest
needs: [build-package, windows-msi]
needs: [cross-compile]
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'open-telemetry/opentelemetry-collector'
steps:
- name: Checkout Repo
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/scripts/verify-dist-files-exist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ files=(
bin/otelcol_linux_arm64
bin/otelcol_linux_amd64
bin/otelcol_windows_amd64.exe
dist/otel-collector-*arm64.rpm
dist/otel-collector_*amd64.deb
dist/otel-collector-*x86_64.rpm
dist/otel-collector_*arm64.deb
dist/otel-collector-*amd64.msi
);
for f in "${files[@]}"
do
Expand Down
16 changes: 0 additions & 16 deletions internal/buildscripts/packaging/fpm/Dockerfile

This file was deleted.

60 changes: 0 additions & 60 deletions internal/buildscripts/packaging/fpm/common.sh

This file was deleted.

22 changes: 0 additions & 22 deletions internal/buildscripts/packaging/fpm/deb/Dockerfile.test

This file was deleted.

13 changes: 0 additions & 13 deletions internal/buildscripts/packaging/fpm/deb/README.md

This file was deleted.

Loading

0 comments on commit 0fb771a

Please sign in to comment.