Add explicit binary version and resurrect "bashbrew.sh" for helping users compile from source
This commit is contained in:
parent
173e6d74dc
commit
61ca39fc4f
|
|
@ -1,4 +1,5 @@
|
|||
**
|
||||
!bashbrew.sh
|
||||
!cmd/
|
||||
!go.mod
|
||||
!go.sum
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
run: |
|
||||
docker build --tag bashbrew --pull .
|
||||
docker run --rm bashbrew tar -cC /usr/local/bin bashbrew | tar -xv
|
||||
./bashbrew --help > /dev/null
|
||||
./bashbrew --version
|
||||
- name: Smoke Test
|
||||
run: |
|
||||
image='https://github.com/docker-library/official-images/raw/master/library/hello-world'
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
bin/
|
||||
|
|
@ -9,13 +9,14 @@ RUN apt-get update; \
|
|||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /usr/src/bashbrew
|
||||
COPY go.mod go.sum ./
|
||||
COPY go.mod go.sum bashbrew.sh ./
|
||||
COPY cmd cmd
|
||||
COPY vendor vendor
|
||||
RUN export CGO_ENABLED=0; \
|
||||
go build -mod vendor -v -o /usr/local/bin/bashbrew ./cmd/bashbrew; \
|
||||
bash -x ./bashbrew.sh --version; \
|
||||
rm -r ~/.cache/go-build; \
|
||||
bashbrew --help > /dev/null
|
||||
mv bin/bashbrew /usr/local/bin/; \
|
||||
bashbrew --version
|
||||
|
||||
ENV BASHBREW_CACHE /bashbrew-cache
|
||||
# make sure our default cache dir exists and is writable by anyone (similar to /tmp)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ NAME:
|
|||
USAGE:
|
||||
bashbrew [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
v0.1.0
|
||||
|
||||
COMMANDS:
|
||||
list, ls list repo:tag combinations for a given repo
|
||||
build build (and tag) repo:tag combinations for a given repo
|
||||
|
|
@ -35,6 +38,7 @@ GLOBAL OPTIONS:
|
|||
--library value where the bodies are buried (default: "/home/tianon/docker/official-images/library") [$BASHBREW_LIBRARY]
|
||||
--cache value where the git wizardry is stashed (default: "/home/tianon/.cache/bashbrew") [$BASHBREW_CACHE]
|
||||
--help, -h, -? show help
|
||||
--version, -v print the version
|
||||
```
|
||||
|
||||
## Installing
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
# a small shell script to help compile bashbrew
|
||||
|
||||
dir="$(readlink -f "$BASH_SOURCE")"
|
||||
dir="$(dirname "$dir")"
|
||||
|
||||
export GO111MODULE=on
|
||||
go build -o bin/bashbrew -mod vendor ./cmd/bashbrew > /dev/null
|
||||
|
||||
exec "$dir/bin/bashbrew" "$@"
|
||||
|
|
@ -66,8 +66,7 @@ func main() {
|
|||
app := cli.NewApp()
|
||||
app.Name = "bashbrew"
|
||||
app.Usage = "canonical build tool for the official images"
|
||||
app.Version = "dev"
|
||||
app.HideVersion = true
|
||||
app.Version = version
|
||||
app.EnableBashCompletion = true
|
||||
|
||||
// TODO add "Description" to app and commands (for longer-form description of their functionality)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
package main
|
||||
|
||||
const version = "v0.1.0"
|
||||
Loading…
Reference in New Issue