Skip to content

Commit

Permalink
Fix container builds
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Jun 14, 2022
1 parent 322bdaa commit fcc8a31
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 45 deletions.
6 changes: 2 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
*.log
*_test.go
.next
.git
.next
/.github
/.idea
/bin
/node_modules
/tmp
/ui/node_modules/
Dockerfile*
Makefile
README.md
coverage
/ui/node_modules
node_modules
out
testdata/
ui/packages/app/web/node_modules
39 changes: 10 additions & 29 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ on:
- .github/workflows/container.yml

jobs:
build-binary:
name: Build binary (Goreleaser)
build-container:
name: Container build and push (when merged)
runs-on: ubuntu-latest

permissions:
id-token: write
packages: write
contents: read

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -37,28 +43,17 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'

- name: Set up environment
run: |
./env.sh
- name: Validate
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: check

- name: Set Tag
run: |
echo "goreleaser_current_tag=`git describe --match 'v*' --tags`" >> $GITHUB_ENV
- name: Dry Run
- name: Build binaries
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
Expand All @@ -67,20 +62,6 @@ jobs:
env:
GORELEASER_CURRENT_TAG: "${{ env.goreleaser_current_tag }}"

build-container:
name: Container build and push (when merged)
runs-on: ubuntu-latest
needs: build-binary

permissions:
id-token: write
packages: write
contents: read

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get branch name
shell: bash
run: echo "GITHUB_BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Pull all tags for Lerna semantic release
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
check-latest: true
cache: true

- name: Use Node.js 14.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ VCR_FILES ?= $(shell find ./pkg/*/testdata -name "fixtures.yaml")
go/test-clean:
rm -f $(VCR_FILES)


UI_FILES ?= $(shell find ./ui -name "*" -not -path "./ui/lib/node_modules/*" -not -path "./ui/node_modules/*" -not -path "./ui/packages/app/template/node_modules/*" -not -path "./ui/packages/app/web/node_modules/*" -not -path "./ui/packages/app/web/build/*")

.PHONY: ui/build
ui/build: $(UI_FILES)
cd ui && yarn --prefer-offline && yarn workspace @parca/web build
Expand Down Expand Up @@ -109,8 +107,8 @@ proto/google/pprof/profile.proto:

.PHONY: container-dev
container-dev:
#docker build -t parca-dev/parca-agent:dev --build-arg=GOLANG_BASE=golang:1.18-bullseye --build-arg=RUNNER_BASE=debian:bullseye-slim -t $(OUT_DOCKER):$(VERSION) .
podman build --timestamp 0 --layers --build-arg=GOLANG_BASE=golang:1.18-bullseye --build-arg=RUNNER_BASE=debian:bullseye-slim -t $(OUT_DOCKER):$(VERSION) .
docker build -t parca-dev/parca-agent:dev --build-arg=GOLANG_BASE=golang:1.18-bullseye --build-arg=RUNNER_BASE=debian:bullseye-slim -t $(OUT_DOCKER):$(VERSION) .
#podman build --timestamp 0 --layers --build-arg=GOLANG_BASE=golang:1.18.3-bullseye --build-arg=RUNNER_BASE=debian:bullseye-slim -t $(OUT_DOCKER):$(VERSION) .

.PHONY: container
container:
Expand Down
4 changes: 3 additions & 1 deletion ui/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ Dockerfile
Dockerfile.dev
Makefile
README.md
/node_modules
node_modules
.next
out
*.log
coverage
tmp
bin
/packages/app/web/node_modules

0 comments on commit fcc8a31

Please sign in to comment.