This repository was archived by the owner on Jul 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 env :
4343 GITHUB_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
4444 run : bash ./scripts/brew_push_formula.sh ${{ github.event.inputs.release_version }}
45+
46+ docker :
47+ runs-on : ubuntu-latest
48+ steps :
49+ -
50+ name : Checkout
51+ uses : actions/checkout@v2
52+ -
53+ name : Set up QEMU
54+ uses : docker/setup-qemu-action@v1
55+ -
56+ name : Set up Docker Buildx
57+ uses : docker/setup-buildx-action@v1
58+ -
59+ name : Build and export to Docker
60+ uses : docker/build-push-action@v2
61+ with :
62+ context : .
63+ load : true
64+ tags : |
65+ allero/allero-cli:${{ github.event.inputs.release_version }}
66+ allero/allero-cli:latest
67+ -
68+ name : Test
69+ run : |
70+ docker run --rm allero/allero-cli:${{ github.event.inputs.release_version }}
71+ -
72+ name : Login to DockerHub
73+ uses : docker/login-action@v1
74+ if : github.event_name != 'pull_request'
75+ with :
76+ username : ${{ secrets.DOCKERHUB_USERNAME }}
77+ password : ${{ secrets.DOCKERHUB_TOKEN }}
78+ -
79+ name : Build and push
80+ uses : docker/build-push-action@v2
81+ with :
82+ context : .
83+ push : true
84+ build-args : cli-version=${{ github.event.inputs.release_version }}
85+ tags : |
86+ allero/allero-cli:${{ github.event.inputs.release_version }}
87+ allero/allero-cli:latest
Original file line number Diff line number Diff line change 11FROM golang:1.19-alpine AS builder
22RUN apk --no-cache add curl gcc g++
33
4+ ARG cli-version
5+
46WORKDIR /go/src/app
57COPY . .
68
7- RUN curl -H "Authorization: token $GITHUB_TOKEN" --silent "https://api.github.com/repos/allero-io/allero-wip/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1 /' > cli-version
89RUN go get -d -v ./...
9- RUN go build -tags main -ldflags="-X github.com/allero-io/allero/cmd.CliVersion=$(cat cli-version) " -v
10+ RUN go build -tags main -ldflags="-X github.com/allero-io/allero/cmd.CliVersion=${ cli-version} " -v
1011
1112FROM alpine:3.14
1213COPY --from=builder /go/src/app/allero /
13- ENTRYPOINT ["/allero" ]
14+ ENTRYPOINT ["/allero" ]
You can’t perform that action at this time.
0 commit comments