Skip to content

Commit

Permalink
Update to new artifact rules (#55)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

We refined distribution rules and renamed them to `artifact` rules.

## What are the changes implemented in this PR?

- Changes for `artifact` rules
  • Loading branch information
Adam Mitchell committed Jul 3, 2020
1 parent 64e4f99 commit 752b85f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ jobs:
bazel run @graknlabs_dependencies//tool/sonarcloud:code-analysis -- \
--project-key graknlabs_console --branch=$CIRCLE_BRANCH --commit-id=$CIRCLE_SHA1
deploy-distribution-snapshot:
deploy-artifact-snapshot:
machine: true
working_directory: ~/console
steps:
- install-bazel
- checkout
- run: |
export DEPLOY_DISTRIBUTION_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_DISTRIBUTION_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run --define version=$(git rev-parse HEAD) //:deploy-console-distribution -- snapshot
export DEPLOY_ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run --define version=$(git rev-parse HEAD) //:deploy-console-artifact -- snapshot
deploy-apt-snapshot:
machine:
Expand Down Expand Up @@ -127,16 +127,16 @@ jobs:
bazel run @graknlabs_dependencies//tool/release:validate-deps -- \
graknlabs_common graknlabs_graql graknlabs_client_java
deploy-distribution:
deploy-artifact:
machine: true
working_directory: ~/console
steps:
- install-bazel
- checkout
- run: |
export DEPLOY_DISTRIBUTION_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_DISTRIBUTION_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run --define version=$(cat VERSION) //:deploy-console-distribution -- release
export DEPLOY_ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run --define version=$(cat VERSION) //:deploy-console-artifact -- release
deploy-github:
machine:
Expand Down Expand Up @@ -213,7 +213,7 @@ workflows:
filters:
branches:
only: master
- deploy-distribution-snapshot:
- deploy-artifact-snapshot:
filters:
branches:
only: master
Expand Down Expand Up @@ -242,7 +242,7 @@ workflows:
branches:
only: master
requires:
- deploy-distribution-snapshot
- deploy-artifact-snapshot
- deploy-apt-snapshot
- deploy-rpm-snapshot

Expand All @@ -265,7 +265,7 @@ workflows:
filters:
branches:
only: console-release-branch
- deploy-distribution:
- deploy-artifact:
filters:
branches:
only: console-release-branch
Expand All @@ -288,7 +288,7 @@ workflows:
branches:
only: console-release-branch
requires:
- deploy-distribution
- deploy-artifact
- deploy-apt
- deploy-rpm
- release-cleanup:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ grakn-test/test-biomed/data/*
# Python cache #
__pycache__

# bazel-local #
.local_deps*


# bazel-local #
.local_deps*
21 changes: 11 additions & 10 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
package(default_visibility = ["//visibility:__subpackages__"])

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@graknlabs_dependencies//distribution/artifact:rules.bzl", "deploy_artifact")
load("@graknlabs_dependencies//distribution/maven:rules.bzl", "assemble_maven", "deploy_maven")
load("@graknlabs_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
load("@graknlabs_bazel_distribution//common:rules.bzl", "assemble_targz", "java_deps", "assemble_zip", "assemble_versioned")
load("@graknlabs_bazel_distribution//github:rules.bzl", "deploy_github")
load("@graknlabs_bazel_distribution//apt:rules.bzl", "assemble_apt", "deploy_apt")
load("@graknlabs_bazel_distribution//rpm:rules.bzl", "assemble_rpm", "deploy_rpm")
load("@graknlabs_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
load("@graknlabs_bazel_distribution//distribution:rules.bzl", "deploy_distribution")

genrule(
name = "version",
srcs = [
Expand Down Expand Up @@ -84,7 +85,7 @@ java_deps(
)

pkg_tar(
name = "console-distribution",
name = "console-artifact",
deps = [":console-deps"],
extension = "tgz",
files = {
Expand All @@ -93,32 +94,32 @@ pkg_tar(
visibility = ["//visibility:public"]
)

deploy_distribution(
name = "deploy-console-distribution",
target = ":console-distribution",
deploy_artifact(
name = "deploy-console-artifact",
target = ":console-artifact",
artifact_group = "graknlabs_console",
deployment_properties = "@graknlabs_dependencies//distribution:deployment.properties",
artifact_name = "console-artifact.tgz",
visibility = ["//visibility:public"],
)

assemble_targz(
name = "assemble-linux-targz",
output_filename = "grakn-console-linux",
targets = [":console-distribution", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
targets = [":console-artifact", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
visibility = ["//visibility:public"]
)

assemble_zip(
name = "assemble-mac-zip",
output_filename = "grakn-console-mac",
targets = [":console-distribution", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
targets = [":console-artifact", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
visibility = ["//visibility:public"]
)

assemble_zip(
name = "assemble-windows-zip",
output_filename = "grakn-console-windows",
targets = [":console-distribution", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
targets = [":console-artifact", "@graknlabs_dependencies//distribution:assemble-bash-targz"],
visibility = ["//visibility:public"]
)

Expand Down
2 changes: 1 addition & 1 deletion dependencies/graknlabs/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def graknlabs_dependencies():
git_repository(
name = "graknlabs_dependencies",
remote = "https://github.com/graknlabs/dependencies",
commit = "61fe8156b640196b4673fdf4f84075655bc0bc61", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_dependencies
commit = "2e7638f266703fa674f6d5f9eca1f39480fd7f99", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_dependencies
)

def graknlabs_common():
Expand Down

0 comments on commit 752b85f

Please sign in to comment.