Skip to content

Commit

Permalink
Release pipeline (typedb#5069)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

CI pipeline for releasing `grakn`, which includes the following:
1. `deploy-github`: creates a Github draft containing 9 binaries: `server`, `console`, and `all` for the following OS: Windows, Linux, and Mac
2. `deploy-apt`: deploy to the APT repository
3. `deploy-rpm`: deploy to the RPM repository
4. `deploy-docker`: deploy to Docker Hub
5. `deploy-brew`: deploy to Graknlabs' Brew Tap
6. `deploy-maven`: deploy `api`, `protocol`, `concept`, and `common` to the Maven repository (they are used by `client-java`
  • Loading branch information
Ganeshwara Herawan Hananda authored Mar 28, 2019
1 parent b442b28 commit 9f39863
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 3 deletions.
104 changes: 103 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,67 @@ jobs:
export DEPLOY_GITHUB_TOKEN=$GRABL_CREDENTIAL
bazel run //:deploy-github
deploy-apt:
machine: true
working_directory: ~/grakn
steps:
- install-bazel-linux-rbe
- checkout
- run: cat VERSION
- run: |
export DEPLOY_APT_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_APT_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run //bin:deploy-apt -- release
bazel run //console:deploy-apt -- release
bazel run //server:deploy-apt -- release
deploy-rpm:
machine: true
working_directory: ~/grakn
steps:
- install-bazel-linux-rbe
- checkout
- run: sudo apt install rpm
- run: cat VERSION
- run: |
export DEPLOY_RPM_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_RPM_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run //bin:deploy-rpm -- release
bazel run //server:deploy-rpm -- release
bazel run //console:deploy-rpm -- release
deploy-brew:
machine: true
working_directory: ~/grakn
steps:
- install-bazel-linux-rbe
- checkout
- run: bazel run //:deploy-brew -- release

deploy-docker:
machine: true
working_directory: ~/grakn
steps:
- install-bazel-linux-rbe
- checkout
- run: docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- run: bazel run --define version=$(cat VERSION) //:deploy-docker

deploy-maven:
machine: true
working_directory: ~/grakn
steps:
- install-bazel-linux-rbe
- checkout
- run: cat VERSION
- run: |
export DEPLOY_MAVEN_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_MAVEN_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run //api:deploy-maven -- release $(cat VERSION)
bazel run //protocol:deploy-maven -- release $(cat VERSION)
bazel run //concept:deploy-maven -- release $(cat VERSION)
bazel run //common:deploy-maven -- release $(cat VERSION)
release-cleanup:
machine: true
steps:
Expand Down Expand Up @@ -464,9 +525,50 @@ workflows:
filters:
branches:
only: grakn-core-release-branch
- deploy-approval:
type: approval
requires:
- deploy-github
filters:
branches:
only: grakn-core-release-branch
- deploy-apt:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-approval
- deploy-rpm:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-approval
- deploy-brew:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-approval
- deploy-docker:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-approval
- deploy-maven:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-approval
- release-cleanup:
filters:
branches:
only: grakn-core-release-branch
requires:
- deploy-github
- deploy-apt
- deploy-rpm
- deploy-brew
- deploy-docker
- deploy-maven
6 changes: 4 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

exports_files(["VERSION", "deployment.properties"], visibility = ["//visibility:public"])
exports_files(["VERSION", "deployment.properties", "RELEASE_TEMPLATE.md"], visibility = ["//visibility:public"])
load("@graknlabs_bazel_distribution//apt:rules.bzl", "assemble_apt", "deploy_apt")
load("@graknlabs_bazel_distribution//brew:rules.bzl", "deploy_brew")
load("@graknlabs_bazel_distribution//common:rules.bzl", "assemble_targz", "java_deps", "assemble_zip", "checksum")
Expand All @@ -27,6 +27,8 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_push")

deploy_github(
name = "deploy-github",
deployment_properties = "//:deployment.properties",
release_description = "//:RELEASE_TEMPLATE.md",
targets = [
":assemble-linux-targz",
":assemble-mac-zip",
Expand All @@ -38,7 +40,6 @@ deploy_github(
"//server:assemble-mac-zip",
"//server:assemble-windows-zip",
],
deployment_properties = "//:deployment.properties",
version_file = "//:VERSION"
)

Expand Down Expand Up @@ -153,4 +154,5 @@ container_push(
format = "Docker",
registry = "index.docker.io",
repository = "graknlabs/grakn-core",
# tag = "$(version)" # TODO: enable once we fixed the issue with having to always pass the variable during bazel build
)
5 changes: 5 additions & 0 deletions RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Grakn

{ Please add the release notes here }

Refer to [docs](http://dev.grakn.ai/docs/running-grakn/install-and-run) for the installation guide.

0 comments on commit 9f39863

Please sign in to comment.