Skip to content

Commit

Permalink
*: Upload generated manifests as artifacts/assets without checking th…
Browse files Browse the repository at this point in the history
…em in VC (#131)

* Remove checked in manifests

Upload manifests as artifcts and assets

Signed-off-by: Kemal Akkoyun <[email protected]>

* Fix action

Signed-off-by: Kemal Akkoyun <[email protected]>

* Improve UI make action

Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun authored Sep 29, 2021
1 parent 2451ac1 commit e289fa4
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 252 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,22 @@ jobs:
- name: Install llvm
run: sudo apt-get install llvm

- name: Build
run: make build
- name: Build UI
run: make ui

- name: Format
run: make format

- name: Test
run: make go/test

- name: Build
run: make build

- name: Archive generatated artifacts
uses: actions/upload-artifact@v2
with:
name: parca-bin
if-no-files-found: error
path: |
bin
9 changes: 8 additions & 1 deletion .github/workflows/jsonnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ jobs:
run: git config --global url."https://parca:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Generate
run: cd deploy && make --always-make vendor manifests && git diff --exit-code
run: cd deploy && make --always-make vendor manifests

- name: Archive generatated manifests
uses: actions/upload-artifact@v2
with:
name: manifests
path: |
deploy/manifests
39 changes: 38 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build UI
run: make ui

# Disabled until fixing the authentication issue.
# TODO(kakkoyun): Disabled until fixing the authentication issue.
# - name: Login to Github Container Registry
# uses: docker/login-action@v1
# with:
Expand All @@ -42,19 +42,56 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

manifests:
name: Manifests generate and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Set up Jsonnet
run: ./env-jsonnet.sh

- name: Configure git for private modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://parca:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Generate
run: cd deploy && make --always-make vendor manifests

- name: Prepare
run: |
tar -zcvf deploy/manifests.tar.gz deploy/manifests
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
deploy/manifests.tar.gz
deploy/manifests/manifest.yaml
container:
name: Container build and push
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build container
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: make container

- name: Login to registry
run: |
echo "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | buildah login -u parca-dev --password-stdin ghcr.io
- name: Push container
run: |
make push-container
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ build: ui go/bin
.PHONY: clean
clean:
rm -rf bin
rm -rf ui/dist
rm -rf ui/.next
rm -rf ui/packages/app/web/dist
rm -rf ui/packages/app/web/.next

.PHONY: go/deps
go/deps: internal/pprof
Expand All @@ -46,10 +46,12 @@ check-license:
go/test:
go test -v `go list ./... | grep -v ./internal/pprof`

.PHONY: ui
ui:
UI_FILES ?= $(shell find ./ui -name "*" -not -path "./ui/lib/node_modules/*" -not -path "./ui/node_modules/*" -not -path "./ui/packages/app/web/node_modules/*" -not -path "./ui/packages/app/web/dist/*" -not -path "./ui/packages/app/web/.next/*")
ui/packages/app/web/dist: $(UI_FILES)
cd ui && yarn install && yarn workspace @parca/web build

ui: ui/packages/app/web/dist

.PHONY: proto/lint
proto/lint:
# docker run --volume ${PWD}:/workspace --workdir /workspace bufbuild/buf lint
Expand Down Expand Up @@ -82,7 +84,7 @@ push-quay-container:

.PHONY: deploy/manifests
deploy/manifests:
cd deploy && make merge-manifests
cd deploy && make manifests

.PHONY: dev/setup
dev/setup:
Expand Down
4 changes: 3 additions & 1 deletion deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vendor
/vendor
/manifests
/manifest.yaml
4 changes: 1 addition & 3 deletions deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ manifests: vendor $(shell find . -name 'vendor' -prune -o -name '*.libsonnet' -p
mkdir manifests tilt
jsonnet --tla-str version=$(VERSION) -J vendor main.jsonnet -m manifests | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
jsonnet -J vendor dev.jsonnet -m tilt | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
awk 'BEGINFILE {print "---"}{print}' manifests/parca-server* > manifests/manifest.yaml

fmt:
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i

merge-manifests: manifests
awk 'BEGINFILE {print "---"}{print}' manifests/parca-server* > manifest.yaml
120 changes: 0 additions & 120 deletions deploy/manifest.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions deploy/manifests/parca-agent-namespace.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions deploy/manifests/parca-server-configmap.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions deploy/manifests/parca-server-deployment.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions deploy/manifests/parca-server-namespace.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions deploy/manifests/parca-server-service.yaml

This file was deleted.

Loading

0 comments on commit e289fa4

Please sign in to comment.