diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ac51a05..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bazel-* diff --git a/BUILD.bazel b/BUILD.bazel deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index f5d681f..e8c8738 100644 --- a/README.md +++ b/README.md @@ -1,15 +1 @@ # Images - -Build image `image` with tag `x.y.z` with: -```sh -bazel run //image:x.y.z -``` - -Build and push image `image` with tag `x.y.z` with: -```sh -bazel run //image:x.y.z_push -``` - -## Terraform - -Available at [quay.io/hadrienpatte/terraform](https://quay.io/repository/hadrienpatte/terraform) diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index d16a4dc..0000000 --- a/WORKSPACE +++ /dev/null @@ -1,32 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "io_bazel_rules_docker", - sha256 = "1698624e878b0607052ae6131aa216d45ebb63871ec497f26c67455b34119c80", - strip_prefix = "rules_docker-0.15.0", - urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.15.0/rules_docker-v0.15.0.tar.gz"], -) - -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) - -container_repositories() - -load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") - -container_deps() - -load("@io_bazel_rules_docker//container:container.bzl", "container_pull") - -container_pull( - name = "distroless", - digest = "sha256:f2d2b4f3b53f952d74148ad1242f3d36904598b33cd6411ee886088e0744270e", - registry = "gcr.io", - repository = "distroless/static-debian10", -) - -load("//terraform:terraform.bzl", "terraform_binaries") - -terraform_binaries() diff --git a/terraform/BUILD.bazel b/terraform/BUILD.bazel deleted file mode 100644 index 505e845..0000000 --- a/terraform/BUILD.bazel +++ /dev/null @@ -1,3 +0,0 @@ -load(":terraform.bzl", "terraform_images") - -terraform_images() diff --git a/terraform/terraform.bzl b/terraform/terraform.bzl deleted file mode 100644 index 75d37f7..0000000 --- a/terraform/terraform.bzl +++ /dev/null @@ -1,54 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push") - -TERRAFORM_RELEASES = [ - { - "version": "0.13.5", - "sha256": "f7b7a7b1bfbf5d78151cfe3d1d463140b5fd6a354e71a7de2b5644e652ca5147", - }, - { - "version": "0.13.4", - "sha256": "a92df4a151d390144040de5d18351301e597d3fae3679a814ea57554f6aa9b24", - }, - { - "version": "0.13.3", - "sha256": "35c662be9d32d38815cde5fa4c9fa61a3b7f39952ecd50ebf92fd1b2ddd6109b", - }, - { - "version": "0.13.0", - "sha256": "9ed437560faf084c18716e289ea712c784a514bdd7f2796549c735d439dbe378", - }, -] - -def terraform_binaries(): - for release in TERRAFORM_RELEASES: - maybe( - http_archive, - name = "terraform_{}_linux_amd64".format(release["version"]), - build_file_content = "exports_files([\"terraform\"])", - sha256 = release["sha256"], - urls = ["https://releases.hashicorp.com/terraform/{}/terraform_{}_linux_amd64.zip".format(release["version"], release["version"])], - ) - -def terraform_images(): - for release in TERRAFORM_RELEASES: - container_image( - name = release["version"], - base = "@distroless//image", - cmd = "help", - directory = "/bin/", - entrypoint = ["/bin/terraform"], - files = ["@terraform_{}_linux_amd64//:terraform".format(release["version"])], - mode = "0o755", - repository = "quay.io/hadrienpatte", - ) - - container_push( - name = "{}_push".format(release["version"]), - format = "Docker", - image = ":{}".format(release["version"]), - registry = "quay.io", - repository = "hadrienpatte/terraform", - tag = release["version"], - )