Skip to content

Commit

Permalink
build with custom image
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin committed Nov 10, 2020
1 parent e86a547 commit 72e0708
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 63 deletions.
63 changes: 23 additions & 40 deletions .github/workflows/build-test-deploy.yaml
Expand Up @@ -11,11 +11,11 @@ on:
jobs:
build:
runs-on: ubuntu-18.04
# container:
# image: replicated/troubleshoot-builder:18.04
# credentials:
# username: repldeploy2
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
container:
image: replicated/troubleshoot-builder:18.04
credentials:
username: repldeploy2
password: ${{ secrets.DOCKERHUB_PASSWORD }}
steps:
- uses: actions/setup-go@v1
with:
Expand All @@ -29,15 +29,15 @@ jobs:

- uses: actions/checkout@v2

- run: make ga-deps test
- run: make

compile-preflight:
runs-on: ubuntu-18.04
# container:
# image: replicated/troubleshoot-builder:18.04
# credentials:
# username: repldeploy2
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
container:
image: replicated/troubleshoot-builder:18.04
credentials:
username: repldeploy2
password: ${{ secrets.DOCKERHUB_PASSWORD }}
needs: build
steps:
- uses: actions/setup-go@v1
Expand All @@ -49,41 +49,32 @@ jobs:
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- run: make ga-deps preflight
- run: make preflight
- uses: actions/upload-artifact@v1
with:
name: preflight
path: bin/preflight

validate-preflight:
runs-on: ubuntu-18.04
# container:
# image: replicated/troubleshoot-builder:18.04
# credentials:
# username: repldeploy2
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
needs: compile-preflight
steps:
- uses: actions/checkout@master
- run: make ga-deps
- name: Download preflight binary
uses: actions/download-artifact@v1
with:
name: preflight
path: bin/
- uses: engineerd/setup-kind@v0.4.0
# - run: sudo apt-get -y update
# - run: sudo apt-get install --no-install-recommends -y libc6 libc-bin
- run: chmod +x bin/preflight
- run: ./bin/preflight --interactive=false --format=json https://preflight.replicated.com

compile-supportbundle:
runs-on: ubuntu-18.04
# container:
# image: replicated/troubleshoot-builder:18.04
# credentials:
# username: repldeploy2
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
container:
image: replicated/troubleshoot-builder:18.04
credentials:
username: repldeploy2
password: ${{ secrets.DOCKERHUB_PASSWORD }}
needs: build
steps:
- uses: actions/setup-go@v1
Expand All @@ -95,7 +86,7 @@ jobs:
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- run: make ga-deps support-bundle
- run: make support-bundle
- uses: actions/upload-artifact@v1
with:
name: support-bundle
Expand All @@ -106,29 +97,24 @@ jobs:
needs: compile-supportbundle
steps:
- uses: actions/checkout@master
- run: make ga-deps
- name: Download support-bundle binary
uses: actions/download-artifact@v1
with:
name: support-bundle
path: bin/
- uses: engineerd/setup-kind@v0.4.0
- run: dpkg -l | grep libc
# - run: sudo apt-get -y update
# - run: sudo apt-get install --no-install-recommends -y libc6 libc-bin
- run: dpkg -l | grep libc
- run: chmod +x bin/support-bundle
- run: ./bin/support-bundle ./examples/support-bundle/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
- run: ./bin/support-bundle https://kots.io

goreleaser:
runs-on: ubuntu-18.04
# container:
# image: replicated/troubleshoot-builder:18.04
# credentials:
# username: repldeploy2
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
container:
image: replicated/troubleshoot-builder:18.04
credentials:
username: repldeploy2
password: ${{ secrets.DOCKERHUB_PASSWORD }}
needs:
- validate-preflight
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -144,9 +130,6 @@ jobs:
- name: Unshallow
run: git fetch --prune --unshallow

- name: Deps
run: make ga-deps

- uses: actions/setup-go@v1
with:
go-version: "1.14"
Expand Down
24 changes: 1 addition & 23 deletions Makefile
Expand Up @@ -29,7 +29,7 @@ endif

define LDFLAGS
-ldflags "\
-s -w \
-s -w \
-extldflags \"-static\" \
-X ${VERSION_PACKAGE}.version=${VERSION} \
-X ${VERSION_PACKAGE}.gitSHA=${GIT_SHA} \
Expand Down Expand Up @@ -137,25 +137,3 @@ run-troubleshoot: support-bundle
.PHONY: run-analyze
run-analyze: analyze
./bin/analyze --analyzers ./examples/support-bundle/sample-analyzers.yaml ./support-bundle.tar.gz

.PHONY: ga-deps
ga-deps:
sudo apt-get -y update
sudo apt-get install --no-install-recommends -y \
ca-certificates \
build-essential \
pkg-config \
librrd-dev \
libglib2.0-dev \
libcairo2-dev \
libpango1.0-dev \
libpixman-1-dev \
libpng-dev \
libsdl-pango-dev \
libthai-dev \
libpcre3-dev \
libssl-dev \
libffi-dev \
libdbi-dev \
libc6 \
libc-bin

0 comments on commit 72e0708

Please sign in to comment.