1
0
Fork 0

doc/codelabs: stub of bazel-go.md

Change-Id: Icf408f9edddfb5e446b2675485c6f9e17ff7357a
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1564
Reviewed-by: q3k <q3k@hackerspace.pl>
master
radex 2023-08-05 20:29:55 +02:00
parent 54183ba222
commit 6715080ebc
5 changed files with 39 additions and 14 deletions

View File

@ -0,0 +1,35 @@
Bazel & Go basics
=================
_sad-trombone.wav_
TODO: This guide has not really been written yet. But here's a few bits and pieces you might find helpful to get started if you're not familiar with Bazel (until the full guide is written).
[TOC]
Installing Bazel on macOS
-------------------------
$ brew install bazelisk ibazel
You want to have `bazelisk` installed instead of `bazel` so that the correct version of Bazel is used instead of the latest one.
Bazel basics
------------
$ bazel run //hswaw/site
$ bazel run //hswaw/laserproxy
This builds and runs project at specified [depot paths](checking-out.md).
You can pass flags to build product after `--`, like so:
$ bazel run //hswaw/site -- -hspki_disable
BTW: `-hspki_disable` is a common flag to use to run a project locally without HTTPS setup.
By convention, most projects will show you available flags like so:
$ bazel run //hswaw/laserproxy -- -h
For some projects, you might want interactive development, where rebuild happens automatically on any change to the project. In this case, replace `bazel run` with `ibazel run`.

View File

@ -62,7 +62,7 @@ What's up with `//these/paths`?
These paths, sometimes called *depot paths*, are a convention to refer to paths within hscloud. For example, `//foo/bar` means a file or directory named `bar` within a directory named `foo` in the root of the hscloud repository.
These paths are notably used by Bazel, our build system, which extends the syntax slightly: `//foo/bar:baz` means a file or *build target* named baz within a directory bar within a diredctory foo inside hscloud.
These paths are notably used by Bazel, our build system, which extends the syntax slightly: `//foo/bar:baz` means a file or *build target* named baz within a directory bar within a directory foo inside hscloud.
What are changes?
-----------------
@ -106,5 +106,5 @@ Further steps
Now that you have a local hscloud checkout and mostly know why it exists and how it's laid out, there's a few next steps you can take:
- [Your first hscloud Change](your-first-change.md) will guide you through using Gerrit to send your first contribution to hscloud - a small file change in your personal directory.
- **TODO** will guide you through building some code using Bazel, and then writing a tiny bit of Go code of your own.
- [Bazel & Go basics](bazel-go.md) will (TODO) guide you through building some code using Bazel, and then writing a tiny bit of Go code of your own.
- **TODO** will guide you through accessing our production Kubernetes cluster and running some code on it.

View File

@ -188,6 +188,6 @@ Further steps
-------------
- If you need a **Git refresher** - we highly recommend the [Git Visual Reference](https://marklodato.github.io/visual-git-guide/index-en.html)
- **TODO** will guide you through building some code using Bazel, and then writing a tiny bit of Go code of your own.
- [Bazel & Go basics](bazel-go.md) will (TODO) guide you through building some code using Bazel, and then writing a tiny bit of Go code of your own.
- **TODO** will guide you through accessing our production Kubernetes cluster and running some code on it.

View File

@ -10,3 +10,4 @@ Getting started
- [**Checking out hscloud**](getting-started/checking-out.md) - how to get a copy of hscloud, how to navigate around it, and what's what. This is nearly **mandatory** for anyone who wishes to interact with hscloud.
- [**Your First Change**](getting-started/your-first-change.md) - how to use Gerrit and git to send your first change to hscloud, and an intro to personal directories. Using Gerrit can be somewhat confusing even (or especially) if you're used to Gitflow or GitHub.
- [**Bazel & Go basics**](getting-started/bazel-go.md) - will (TODO) guide you through building some code using Bazel, and then writing a tiny bit of Go code of your own.

View File

@ -23,17 +23,6 @@ Something similar to this should work for you locally enough to open the web app
bazel run //hswaw/laserproxy -- -hspki_disable -laser_network 127.0.0.1 -client_network 127.0.0.1
This will show you available flags you can pass:
bazel run //hswaw/laserproxy -- -h
If you've never used `bazel`, this should work for y'all macOS newbs:
brew install bazel
brew install postgresql
_TODO(q3k): move this to the bazel codelab once it's finished_
Deployment
----------