-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from jarondl/new_bazel
Move bazel tests to a separate dir, update README with instructions.
- Loading branch information
Showing
13 changed files
with
259 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
|
||
/bazel-* | ||
/example_bazel/bazel-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") | ||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") | ||
|
||
|
||
def rpmpack_dependencies(): | ||
go_rules_dependencies() | ||
go_register_toolchains() | ||
gazelle_dependencies() | ||
|
||
|
||
go_repository( | ||
name = "com_github_pkg_errors", | ||
importpath = "github.com/pkg/errors", | ||
tag = "v0.8.1", | ||
) | ||
|
||
go_repository( | ||
name = "com_github_google_go_cmp", | ||
importpath = "github.com/google/go-cmp", | ||
tag = "v0.2.0", | ||
) | ||
|
||
go_repository( | ||
name = "com_github_cavaliercoder_go_cpio", | ||
commit = "925f9528c45e", | ||
importpath = "github.com/cavaliercoder/go-cpio", | ||
) | ||
|
||
go_repository( | ||
name = "com_github_ulikunitz_xz", | ||
importpath = "github.com/ulikunitz/xz", | ||
tag = "v0.5.6", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# A build file for rpmpack. | ||
# For running basic build/run/test you can also use the regular go tools, | ||
# this is currently added to assist in external testing. | ||
|
||
load("@io_bazel_rules_docker//container:container.bzl", "container_image") | ||
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") | ||
load("@com_github_google_rpmpack//:def.bzl", "pkg_tar2rpm") | ||
|
||
pkg_tar( | ||
name = "rpmtest-tar", | ||
srcs = [":content1.txt"], | ||
mode = "0644", | ||
ownername = "root.root", | ||
package_dir = "var/lib/rpmpack", | ||
) | ||
|
||
pkg_tar2rpm( | ||
name = "rpmtest", | ||
data = ":rpmtest-tar", | ||
pkg_name = "rpmtest", | ||
prein = "echo \"This is preinst\" > /tmp/preinst.txt", | ||
release = "3.4", | ||
version = "1.2", | ||
) | ||
|
||
container_image( | ||
name = "centos_with_rpm", | ||
testonly = True, | ||
base = "@centos//image", | ||
directory = "/root/", | ||
files = [":rpmtest.rpm"], | ||
legacy_run_behavior = False, | ||
) | ||
|
||
container_image( | ||
name = "centos_V", | ||
testonly = True, | ||
base = ":centos_with_rpm", | ||
cmd = "echo ===marker=== && rpm -i /root/rpmtest.rpm && rpm -Vv rpmtest", | ||
legacy_run_behavior = False, | ||
) | ||
|
||
container_image( | ||
name = "centos_ls", | ||
testonly = True, | ||
base = ":centos_with_rpm", | ||
cmd = "echo ===marker=== && rpm -i /root/rpmtest.rpm && ls -l /var/lib/rpmpack", | ||
legacy_run_behavior = False, | ||
) | ||
|
||
container_image( | ||
name = "centos_preinst", | ||
testonly = True, | ||
base = ":centos_with_rpm", | ||
cmd = "echo ===marker=== && rpm -i /root/rpmtest.rpm && cat /tmp/preinst.txt", | ||
legacy_run_behavior = False, | ||
) | ||
|
||
sh_test( | ||
name = "docker_tests", | ||
srcs = ["docker_tests.sh"], | ||
data = [ | ||
":centos_V", | ||
":centos_ls", | ||
":centos_preinst", | ||
":golden_V.txt", | ||
":golden_ls.txt", | ||
":golden_preinst.txt", | ||
], | ||
) |
Oops, something went wrong.