Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ extension/dist/
extension/tmp/
extension/coverage/
/.idea/
server/bazel-bin
server/bazel-out
server/bazel-server
server/bazel-testlogs
32 changes: 32 additions & 0 deletions server/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle")

gazelle(
name = "gazelle",
prefix = "github.com/googleinterns/RDP-GCP-VMs-without-publicIP/server",
)

go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/googleinterns/RDP-GCP-VMs-without-publicIP/server",
visibility = ["//visibility:private"],
deps = [
"//gcloud:go_default_library",
"//shell:go_default_library",
"@com_github_gorilla_mux//:go_default_library",
"@com_github_gorilla_websocket//:go_default_library",
],
)

go_binary(
name = "server",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)

go_test(
name = "go_default_test",
srcs = ["main_test.go"],
embed = [":go_default_library"],
)
45 changes: 45 additions & 0 deletions server/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "a8d6b1b354d371a646d2f7927319974e0f9e52f73a2452d2b3877118169eb6bb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.3/rules_go-v0.23.3.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.3/rules_go-v0.23.3.tar.gz",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")

go_rules_dependencies()

go_register_toolchains()

# Download Gazelle
http_archive(
name = "bazel_gazelle",
sha256 = "cdb02a887a7187ea4d5a27452311a75ed8637379a1287d8eeb952138ea485f7d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.1/bazel-gazelle-v0.21.1.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.1/bazel-gazelle-v0.21.1.tar.gz",
],
)

# Load and call Gazelle dependencies
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

gazelle_dependencies()

go_repository(
name = "com_github_gorilla_mux",
importpath = "github.com/gorilla/mux",
sum = "h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=",
version = "v1.7.4",
)

go_repository(
name = "com_github_gorilla_websocket",
importpath = "github.com/gorilla/websocket",
sum = "h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=",
version = "v1.4.2",
)
26 changes: 26 additions & 0 deletions server/gcloud/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"executors.go",
"runners.go",
"types.go",
],
importpath = "github.com/googleinterns/RDP-GCP-VMs-without-publicIP/server/gcloud",
visibility = ["//visibility:public"],
deps = [
"//shell:go_default_library",
"@com_github_gorilla_websocket//:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = [
"gcloud_test.go",
"rdp_test.go",
],
embed = [":go_default_library"],
deps = ["@com_github_gorilla_websocket//:go_default_library"],
)
14 changes: 14 additions & 0 deletions server/shell/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = ["shell.go"],
importpath = "github.com/googleinterns/RDP-GCP-VMs-without-publicIP/server/shell",
visibility = ["//visibility:public"],
)

go_test(
name = "go_default_test",
srcs = ["shell_test.go"],
embed = [":go_default_library"],
)