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

feat: Wire bunq2ynab in provisioner #616

Merged
merged 28 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2256ad9
Wire bunq2ynab in provisioner
mvgijssel Dec 11, 2023
0df86d4
Wire bunq2ynab in provisioner
mvgijssel Dec 11, 2023
2935d36
Fix references
mvgijssel Dec 11, 2023
c8cbba2
Move regctl
mvgijssel Dec 12, 2023
51b1e9e
Setup dev publish oci image for bunq2ynab
mvgijssel Dec 12, 2023
55dfcdc
Migrating provisioner to rules_oci
mvgijssel Dec 12, 2023
9ba5603
Working running provisioner-dev image
mvgijssel Dec 12, 2023
1493d20
Make it work for bunq
mvgijssel Dec 12, 2023
6e45e83
Delete unused file
mvgijssel Dec 12, 2023
0098d1e
Update home assistant and friends
mvgijssel Dec 13, 2023
e315fd2
Setup matter server in home assistant
mvgijssel Dec 13, 2023
524b5b3
Working dev provisionen
mvgijssel Dec 17, 2023
9e359bd
Creating local docker rules
mvgijssel Dec 18, 2023
e93fd2f
Use proper labels
mvgijssel Dec 18, 2023
25d4c5d
Remove microk8s tests
mvgijssel Dec 18, 2023
660e402
Fix ci tests
mvgijssel Dec 18, 2023
2e8e9f4
Create docker base image with systemctl and sudo
mvgijssel Dec 18, 2023
20910aa
Working provision!
mvgijssel Dec 18, 2023
27fb5f5
Use dev image for bunq2ynab
mvgijssel Dec 18, 2023
5e7c83a
Add tests
mvgijssel Dec 18, 2023
1c34dec
Fix CI tests
mvgijssel Dec 18, 2023
b7876ae
Set exec_properties
mvgijssel Dec 18, 2023
8f28d96
Lock down bunq api tokens
mvgijssel Dec 18, 2023
d6aaead
Link bunq2ynab image to setup repository
mvgijssel Dec 18, 2023
8c17825
Install bunq2ynab from two private container registries
mvgijssel Dec 18, 2023
34433a4
Setup release flow for provisioner + selective delivery
mvgijssel Dec 18, 2023
41b427f
Fix visibility
mvgijssel Dec 18, 2023
8ec7e25
Added changesets
mvgijssel Dec 18, 2023
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: 0 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ test --test_env=ONEPASSWORD_SERVICE_ACCOUNT_TOKEN_DEV

common --enable_bzlmod=true

# Currently a bug in rules_docker where the wrong platform is selected when building docker images
# disabling the transitions ensures that docker images are built for the right CPU (amd64 or arm64)
# See https://github.com/bazelbuild/rules_docker/issues/2052#issuecomment-1175585409
build --@io_bazel_rules_docker//transitions:enable=false

# Enable builds without the bytes https://github.com/bazelbuild/bazel/issues/6862
build:buildbuddy --remote_download_minimal

Expand Down
5 changes: 5 additions & 0 deletions .changeset/bunq2ynab-small-dots-approve-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bunq2ynab": minor
---

feat: Added support for specifying a sleep timeout at the end of running bunq2ynab to prevent rate limit issues with both Bunq and YNAB.
5 changes: 5 additions & 0 deletions .changeset/bunq2ynab-small-dots-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bunq2ynab": minor
---

feat: Enabled support for both dev and prod environments loading secrets from relevant 1Password vaults.
5 changes: 5 additions & 0 deletions .changeset/provisioner-ninety-windows-shop-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"provisioner": major
---

BREAKING CHANGE: Remove microk8s from provisioner as it's not used and is only consuming resources.
5 changes: 5 additions & 0 deletions .changeset/provisioner-ninety-windows-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"provisioner": minor
---

feat: Deploy bunq2ynab image in dev, test and prod using different images and credentials!
5 changes: 5 additions & 0 deletions .changeset/rules_release-gentle-otters-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rules_release": minor
---

feat: Added `publish_oci_image` rule to publish OCI images to a registry.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- "master"
paths:
- "provisioner/version.txt"
jobs:
deploy-provisioner:
name: Deploy Provisioner
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ mutagen.yml.lock
/home-assistant/zigbee2mqtt-data/*
!/home-assistant/zigbee2mqtt-data/configuration.yaml

/home-assistant/matter-server-data/*

/home-assistant/z-stack-firmware/*

/home-assistant/mosquitto-data/*
Expand Down
3 changes: 2 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ release_manager(
":push_git_changes",
],
deps = [
"//provisioner:release",
"//tools/bunq2ynab:release",
"@rules_release//:release",
"@rules_task//:release",
Expand All @@ -255,7 +256,7 @@ release_manager(

alias(
name = "regctl",
actual = "//tools/regctl",
actual = "@rules_release//tools/regctl",
)

alias(
Expand Down
60 changes: 52 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,51 @@ register_toolchains(
)

# ------------------------------------ platforms ------------------------------------ #
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(
name = "platforms",
version = "0.0.8",
)

# ------------------------------------ rules_skylib ------------------------------------ #
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(
name = "bazel_skylib",
version = "1.4.2",
)

# ------------------------------------ aspect_bazel_lib ------------------------------------ #
bazel_dep(name = "aspect_bazel_lib", version = "2.0.1")
bazel_dep(
name = "aspect_bazel_lib",
version = "2.0.3",
)

bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")

bazel_lib_toolchains.jq()

use_repo(bazel_lib_toolchains, "jq_toolchains")

# ------------------------------------ rules_pkg ------------------------------------ #
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(
name = "rules_pkg",
version = "0.9.1",
)

# ------------------------------------ rules_task ------------------------------------ #
bazel_dep(name = "rules_task", version = "0.0.0")
bazel_dep(
name = "rules_task",
version = "0.0.0",
)

local_path_override(
module_name = "rules_task",
path = "./rules/rules_task",
)

# ------------------------------------ rules_python ------------------------------------ #
bazel_dep(name = "rules_python", version = "0.25.0")
bazel_dep(
name = "rules_python",
version = "0.25.0",
)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")

Expand All @@ -48,10 +72,30 @@ python.toolchain(
use_repo(python, "python_versions")

# ------------------------------------ rules_oci ------------------------------------ #
bazel_dep(name = "rules_oci", version = "1.4.3")
bazel_dep(
name = "rules_oci",
version = "1.4.3",
)

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "ubuntu_base",
digest = "sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf",
image = "index.docker.io/library/ubuntu",
platforms = [
"linux/amd64",
"linux/arm64/v8",
],
)

use_repo(oci, "ubuntu_base")

# ------------------------------------ rules_release ------------------------------------ #
bazel_dep(name = "rules_release", version = "0.0.0")
bazel_dep(
name = "rules_release",
version = "0.0.0",
)

local_path_override(
module_name = "rules_release",
Expand Down
103 changes: 0 additions & 103 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,50 +1,6 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# ------------------------------------ rules_docker ------------------------------------ #
# https://github.com/bazelbuild/rules_docker/pull/2201
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = [
"https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz",
],
)

load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)

container_repositories()

load(
"@io_bazel_rules_docker//python3:image.bzl",
_py3_image_repos = "repositories",
)

_py3_image_repos()

load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)

# https://hub.docker.com/layers/library/python/3.10.8-bullseye/images/sha256-de501d4dbc12f846ee78ee76629b7524ec07f10c121832a190a1ecb7b9a119bb?context=explore
container_pull(
name = "python_base_arm64",
digest = "sha256:fa109a6d1100a4e6382950ab1f7f94563268e537b1619f1969b9b33a9c1a99fb",
registry = "index.docker.io",
repository = "library/python:3.10.8-bullseye",
)

container_pull(
name = "python_base_amd64",
digest = "sha256:de501d4dbc12f846ee78ee76629b7524ec07f10c121832a190a1ecb7b9a119bb",
registry = "index.docker.io",
repository = "library/python:3.10.8-bullseye",
)

# ------------------------------------ rules_pycross ------------------------------------ #
http_archive(
name = "jvolkman_rules_pycross",
Expand Down Expand Up @@ -78,37 +34,6 @@ load("@pdm-setup//:requirements.bzl", "install_deps")

install_deps()

# ------------------------------------ workstation ------------------------------------ #

# https://hub.docker.com/layers/library/ubuntu/jammy-20230425/images/sha256-ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00?context=explore
container_pull(
name = "ubuntu_base_amd64",
digest = "sha256:ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00",
registry = "index.docker.io",
repository = "library/ubuntu:jammy-20230425",
)

container_pull(
name = "ubuntu_base_arm64",
digest = "sha256:6f8fe7bff0bee25c481cdc26e28bba984ebf72e6152005c18e1036983c01a28b",
registry = "index.docker.io",
repository = "library/ubuntu:jammy-20230425",
)

http_file(
name = "inspec_arm64",
downloaded_file_path = "inspec.deb",
sha256 = "79a496d2467f579c6533bcf42c663d96d830af42ba2f32769ddf6ef879d7d3b5",
url = "https://packages.chef.io/files/stable/inspec/5.18.14/ubuntu/20.04/inspec_5.18.14-1_arm64.deb",
)

http_file(
name = "inspec_amd64",
downloaded_file_path = "inspec.deb",
sha256 = "b4e8b11478cd2c930b24edcf5c24ef49fe83452f08f6cedc13deae5ce7b0c757",
url = "https://packages.chef.io/files/stable/inspec/5.18.14/ubuntu/20.04/inspec_5.18.14-1_amd64.deb",
)

# ------------------------------------ tilt ------------------------------------ #

# From https://github.com/tilt-dev/tilt/releases
Expand Down Expand Up @@ -228,34 +153,6 @@ http_archive(
url = "https://cache.agilebits.com/dist/1P/op2/pkg/v2.22.0/op_darwin_arm64_v2.22.0.zip",
)

# ------------------------------------ regctl ------------------------------------ #

# From https://github.com/regclient/regclient/releases

http_file(
name = "regctl_linux_arm64",
downloaded_file_path = "regctl",
executable = True,
sha256 = "380105c05c6c69ea3d35a8efeec0ccfa1bdfc38a876bf7d473be06d7267bae99",
url = "https://github.com/regclient/regclient/releases/download/v0.5.3/regctl-linux-arm64",
)

http_file(
name = "regctl_linux_amd64",
downloaded_file_path = "regctl",
executable = True,
sha256 = "5141569cd0ef6e52a9dc67391c432f1bdd0cfd2d3b82d3f22d56f94feab7203e",
url = "https://github.com/regclient/regclient/releases/download/v0.5.3/regctl-linux-amd64",
)

http_file(
name = "regctl_darwin_arm64",
downloaded_file_path = "regctl",
executable = True,
sha256 = "4705d5068f946a75606494400c811b9f3f34c89dc495a372462eef02d372fe4d",
url = "https://github.com/regclient/regclient/releases/download/v0.5.3/regctl-darwin-arm64",
)

# ------------------------------------ mutagen ------------------------------------ #

# From https://github.com/mutagen-io/mutagen/releases
Expand Down
2 changes: 1 addition & 1 deletion devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
"[email protected]": {
"last_modified": "2023-10-25T20:49:13Z",
"plugin_version": "0.0.1",
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#python310Packages.pip",
"source": "devbox-search",
"version": "23.2.1",
Expand Down
22 changes: 11 additions & 11 deletions home-assistant/config/automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
presence_entity_id: sensor.driveway_presence
presence_indicator_entity_ids:
- binary_sensor.driveway_doorbell_motion
- binary_sensor.hallway_door_contact
presence_hint_entity_ids:
- binary_sensor.driveway_shelly_input
presence_timeout: 120
Expand All @@ -52,10 +51,11 @@
- binary_sensor.landing_motion_occupancy
- binary_sensor.living_room_motion_occupancy
- binary_sensor.toilet_motion_occupancy
- binary_sensor.hallway_motion_occupancy
- binary_sensor.hallway_motion_update_available
presence_timeout: 120
presence_indicator_entity_ids:
- binary_sensor.hallway_motion_occupancy
- binary_sensor.hallway_door_contact
- id: "1655752934365"
alias: "Laundry Room - Presence: Manage"
description: ""
Expand Down Expand Up @@ -305,15 +305,15 @@
- service: media_player.play_media
data:
media_content_type: music
media_content_id: http://hypervisor:8123/local/sounds_sounds_ring_button_Chime.mp3
media_content_id: http://192.168.1.30:8123/local/sounds_sounds_ring_button_Chime.mp3
target:
entity_id:
- media_player.woonkamer
- media_player.sonos_move
- delay:
hours: 0
minutes: 0
seconds: 4
seconds: 8
milliseconds: 0
- parallel:
- service: sonos.restore
Expand Down Expand Up @@ -459,8 +459,8 @@
illuminance_entity_id: sensor.living_room_illuminance
away_timer_entity_id: timer.living_room_dining_table_away_timer
away_timer_duration:
hours: 0
minutes: 3
hours: 1
minutes: 0
seconds: 0
manual_timer_entity_id: timer.living_room_dining_table_manual_timer
manual_timer_duration:
Expand All @@ -480,8 +480,8 @@
illuminance_entity_id: sensor.living_room_illuminance
away_timer_entity_id: timer.living_room_kitchen_away_timer
away_timer_duration:
hours: 0
minutes: 3
hours: 1
minutes: 0
seconds: 0
manual_timer_entity_id: timer.living_room_kitchen_manual_timer
manual_timer_duration:
Expand All @@ -502,7 +502,7 @@
away_timer_entity_id: timer.living_room_reading_away_timer
away_timer_duration:
hours: 0
minutes: 3
minutes: 15
seconds: 0
manual_timer_entity_id: timer.living_room_reading_manual_timer
manual_timer_duration:
Expand All @@ -523,8 +523,8 @@
illuminance_entity_id: sensor.living_room_illuminance
away_timer_entity_id: timer.living_room_sofa_away_timer
away_timer_duration:
hours: 0
minutes: 3
hours: 1
minutes: 0
seconds: 0
manual_timer_entity_id: timer.living_room_sofa_manual_timer
manual_timer_duration:
Expand Down
Loading