Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onebuild #5

Merged
merged 10 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
commons-libs
qg-api-service
user-documentation
yaku-apps-python
yaku-apps-typescript
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.3.2
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: Build chart
name: Build all

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'chart/**'
pull_request:
branches: [ "main" ]
paths:
- 'chart/**'

env:
REGISTRY: ghcr.io
Expand All @@ -34,11 +30,9 @@ jobs:
repository-cache: true

- name: Build with Bazel
working-directory: chart
run: bazel build //...

- name: Test with Bazel
working-directory: chart
run: bazel test //...

- name: Log in to the Container registry
Expand All @@ -49,5 +43,4 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push the chart to the OCI registry
working-directory: chart
run: bazel run //:yaku_helm.push_registry
run: bazel run //chart:yaku_helm.push_registry
35 changes: 0 additions & 35 deletions .github/workflows/build-oynx.yml

This file was deleted.

13 changes: 13 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bazel_dep(name = "rules_helm", version = "0.5.1")

bazel_dep(name = "gazelle", version = "0.37.0")
bazel_dep(name = "rules_go", version = "0.48.1")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

# Download an SDK for the host OS & architecture as well as common remote execution platforms.
go_sdk.download(version = "1.22.2")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//onyx:go.mod")
use_repo(go_deps, "com_github_azure_azure_sdk_for_go_sdk_azcore", "com_github_azure_azure_sdk_for_go_sdk_azidentity", "com_github_azure_azure_sdk_for_go_sdk_storage_azblob", "com_github_chigopher_pathlib", "com_github_invopop_jsonschema", "com_github_invopop_yaml", "com_github_netflix_go_iomux", "com_github_pkg_errors", "com_github_spf13_afero", "com_github_spf13_cobra", "com_github_spf13_viper", "com_github_stretchr_testify", "com_github_xeipuuv_gojsonschema", "in_gopkg_natefinch_lumberjack_v2", "in_gopkg_yaml_v3", "org_uber_go_zap")
1,077 changes: 1,077 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# yaku

## Bazel
[![Build all](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml/badge.svg)](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml)

### Overview

| Component | Build | Test | Artifact Upload | Workflow |
|------------|-------|------|-----------------|---------|
| Onyx | ✔️ | ✔️ | |[![Build Onyx](https://github.com/B-S-F/yaku/actions/workflows/build-oynx.yml/badge.svg)](https://github.com/B-S-F/yaku/actions/workflows/build-oynx.yml)|
| API | | | ||
| Chart | ✔️ | ✔️ | ✔️ |[![Build chart](https://github.com/B-S-F/yaku/actions/workflows/build-chart.yml/badge.svg)](https://github.com/B-S-F/yaku/actions/workflows/build-chart.yml)|
| Component4 | | | | |
| Component | Build | Test | Artifact Upload |
|------------|-------|------|-----------------|
| Onyx | ✔️ | ✔️ | |
| API | | | |
| Chart | ✔️ | ✔️ | ✔️ |
| Component4 | | | |

✔️ works
❌ does not work

### Components

#### Onyx
- bazel version: 6.0.0 (see `.bazelversion`)
- `BUILD` files created with `gazelle -go_prefix github.com/B-S-F/yaku/onyx` (from the component root)
- `deps.bzl` created with `gazelle update-repos -from_file=go.mod -to_macro=deps.bzl%go_dependencies -prune` (from the component root)
- `BUILD` files created with `gazelle -go_prefix github.com/B-S-F/yaku` (from root)
- derived from this tutorial: https://earthly.dev/blog/build-golang-bazel-gazelle/

#### Chart
Expand Down
17 changes: 0 additions & 17 deletions chart/WORKSPACE → WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_helm",
integrity = "sha256-easVF1EdnzWNj0sqE7TgqwCfvq3BEfA/poKPAfLA4Kw=",
urls = ["https://github.com/abrisco/rules_helm/releases/download/0.6.0/rules_helm-v0.6.0.tar.gz"],
)

load("@rules_helm//helm:repositories.bzl", "helm_register_toolchains", "rules_helm_dependencies")

rules_helm_dependencies()

helm_register_toolchains()

load("@rules_helm//helm:repositories_transitive.bzl", "rules_helm_transitive_dependencies")

rules_helm_transitive_dependencies()

load("@rules_helm//helm:defs.bzl", "helm_import_repository")

# Import the Argo Workflows chart
Expand Down
4 changes: 2 additions & 2 deletions chart/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ exports_files(["Chart.lock"])
helm_chart(
name = "yaku_helm",
chart = "Chart.yaml",
registry_url = "oci://ghcr.io/b-s-f/charts/",
values = "values.yaml",
deps = [
"@helm_dep_argo_workflows",
"@helm_dep_minio",
],
registry_url = "oci://ghcr.io/b-s-f/charts/"
)

helm_lint_test(
name = "yaku_helm_lint",
chart = ":yaku_helm",
)
)
6 changes: 6 additions & 0 deletions chart/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module(
name = "yaku_chart",
version = "1.0",
)

bazel_dep(name = "rules_helm", version = "0.5.1")
Loading
Loading