]> git.puffer.fish Git - matthieu/nova.git/commitdiff
add more docker images
authorMatthieu <matthieu@developershouse.xyz>
Tue, 7 Sep 2021 19:26:15 +0000 (23:26 +0400)
committerMatthieu <matthieu@developershouse.xyz>
Tue, 7 Sep 2021 19:26:15 +0000 (23:26 +0400)
.github/workflows/bazel-build.yml
BUILD
bazel/docker.bzl
gateway/BUILD
ratelimiter/BUILD
third_party/BUILD [deleted file]
third_party/crate_universe_defaults.bzl [deleted file]
webhook/BUILD

index 3e423f9142d075a52ee22caf317e71e4a2fe53cc..20d7f5468f8a0ec7ec156bb7e306f42e362c286f 100644 (file)
@@ -21,6 +21,13 @@ jobs:
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
       - uses: actions/checkout@v2
+      - uses: docker-practice/actions-setup-docker@master
+      - name: Login to GitHub Container Registry
+        uses: docker/login-action@v1
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
       - name: Setup Bazelisk
         # You may pin to the exact commit or the version.
         # uses: bazelbuild/setup-bazelisk@2351cf5a7584ce72638fbce7c22e5128a5fcd5b2
@@ -56,13 +63,6 @@ jobs:
             bazel-bin*/package_tar.tar.gz
 
                   - name: Setup docker
-      - uses: docker-practice/actions-setup-docker@master
-      - name: Login to GitHub Container Registry
-        uses: docker/login-action@v1
-        with:
-          registry: ghcr.io
-          username: ${{ github.actor }}
-          password: ${{ secrets.GITHUB_TOKEN }}
       - name: Publish docker images
         shell: bash
         run: |
diff --git a/BUILD b/BUILD
index 78fd897cf0344b5f15f8d081484193e58a0ddeb6..31ccc06789a811b296f162dcc2f5717aaa9daf6e 100644 (file)
--- a/BUILD
+++ b/BUILD
@@ -21,6 +21,9 @@ container_bundle(
 
   images = {
     "ghcr.io/discordnova/nova/novactl:latest": "//novactl:image",
+    "ghcr.io/discordnova/nova/gateway:latest": "//gateway:image",
+    "ghcr.io/discordnova/nova/ratelimiter:latest": "//ratelimiter:image",
+    "ghcr.io/discordnova/nova/webhook:latest": "//webhook:image",
   }
 )
 
index 54ac81c87d4a355569adeb9fdbb5825520a0246a..6b42a69097c2fcc8fceb1f5ae253c73971ea18fc 100644 (file)
@@ -3,16 +3,24 @@
 load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", "toolchain_configure")
 load("@io_bazel_rules_docker//repositories:repositories.bzl", "repositories")
 load("@io_bazel_rules_docker//repositories:deps.bzl", "deps")
-load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
 load(
     "@io_bazel_rules_docker//go:image.bzl",
     _go_image_repos = "repositories",
 )
+load(
+    "@io_bazel_rules_docker//rust:image.bzl",
+    _rust_image_repos = "repositories",
+)
+
 
 def load_docker():
+    """
+    Loads all the docker credentials and pull the needed images
+    """
     toolchain_configure(
         name = "docker_config"
     )
     repositories()
     deps()
-    _go_image_repos()
\ No newline at end of file
+    _go_image_repos()
+    _rust_image_repos()
\ No newline at end of file
index 54df7afb8256a23ad7d725fc3422e269cf783513..f1078dfa1045cb5fc5a5849757feca184337da9e 100644 (file)
@@ -1,5 +1,6 @@
 load("@rules_rust//rust:rust.bzl", "rust_binary")
 load("//cargo:crates.bzl", "all_crate_deps", "crate_deps")
+load("@io_bazel_rules_docker//rust:image.bzl", "rust_image")
 
 exports_files(["Cargo.toml"])
 
@@ -10,3 +11,11 @@ rust_binary(
     deps = all_crate_deps(),
     visibility = ["//visibility:public"],
 )
+
+rust_image(
+    name = "image",
+    srcs = glob(["src/**/*.rs"]),
+    proc_macro_deps = crate_deps(["serde_repr"]),
+    deps = all_crate_deps(),
+    visibility = ["//visibility:public"],
+)
\ No newline at end of file
index 167e80f1345367be21cfd97296bb52a14f84c84b..3a8b2e402662adc80d0640839deac6e193596fc3 100644 (file)
@@ -1,6 +1,7 @@
 load("@rules_rust//rust:rust.bzl", "rust_binary")
 load("@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script")
 load("//cargo:crates.bzl", "all_crate_deps", "crate_deps")
+load("@io_bazel_rules_docker//rust:image.bzl", "rust_image")
 
 exports_files(["Cargo.toml"])
 
@@ -26,3 +27,10 @@ rust_binary(
     deps = all_crate_deps() + [":build_script"],
     visibility = ["//visibility:public"],
 )
+
+rust_image(
+    name = "image",
+    srcs = ["src/main.rs"],
+    deps = all_crate_deps() + [":build_script"],
+    visibility = ["//visibility:public"],
+)
\ No newline at end of file
diff --git a/third_party/BUILD b/third_party/BUILD
deleted file mode 100644 (file)
index be277cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-exports_files(["create_universe_defaults.bzl"])
\ No newline at end of file
diff --git a/third_party/crate_universe_defaults.bzl b/third_party/crate_universe_defaults.bzl
deleted file mode 100644 (file)
index c32a00e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-"""A helper module defining generated information about crate_universe dependencies"""
-
-# This global should match the current release of `crate_unvierse`.
-DEFAULT_URL_TEMPLATE = "https://github.com/bazelbuild/rules_rust/releases/download/crate_universe-12/crate_universe_resolver-{host_triple}{extension}"
-
-# Note that if any additional platforms are added here, the pipeline defined
-# by `create_universe.yaml` should also be updated
-DEFAULT_SHA256_CHECKSUMS = {
-    "aarch64-apple-darwin": "c6017cd8a4fee0f1796a8db184e9d64445dd340b7f48a65130d7ee61b97051b4",
-    "aarch64-unknown-linux-gnu": "d0a310b03b8147e234e44f6a93e8478c260a7c330e5b35515336e7dd67150f35",
-    "x86_64-apple-darwin": "762f1c77b3cf1de8e84d7471442af1314157efd90720c7e1f2fff68556830ee2",
-    "x86_64-pc-windows-gnu": "8fa9a00812f3e2f6ac2678e3bce2d8415f3dc8ef926b590d4f855cc696af7c8d",
-    "x86_64-unknown-linux-gnu": "aebf51af6a3dd33fdac463b35b0c3f4c47ab93e052099199673289e2025e5824",
-}
\ No newline at end of file
index e33a21d76762730b6c0587f839e7026a9d8c8ec5..84c04f6ed0c4565f4e252dac0f499deaf92e8122 100644 (file)
@@ -1,5 +1,6 @@
 load("@rules_rust//rust:rust.bzl", "rust_binary", "rust_test")
-load("//cargo:crates.bzl", "all_crate_deps", "crate_deps")
+load("//cargo:crates.bzl", "all_crate_deps")
+load("@io_bazel_rules_docker//rust:image.bzl", "rust_image")
 
 exports_files(["Cargo.toml"])
 
@@ -14,4 +15,11 @@ rust_test(
     name = "webhook_test",
     crate = ":webhook",
     deps = all_crate_deps(),
+)
+
+rust_image(
+    name = "image",
+    srcs = glob(["src/**"]),
+    deps = all_crate_deps(),
+    visibility = ["//visibility:public"],
 )
\ No newline at end of file