Skip to content

Commit

Permalink
test: getting speakeasy cli
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Nov 4, 2022
1 parent 752810b commit 71f2757
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ COPY *.go ./

RUN go build -o /action

RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RUN echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /root/.profile
RUN echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /root/.profile
RUN eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install speakeasy-api/homebrew-tap/speakeasy
RUN eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew list speakeasy | grep bin/speakeasy | xargs -I '{}' cp '{}' /speakeasy

## Deploy
FROM gcr.io/distroless/base-debian10
FROM gcr.io/distroless/base-debian11

WORKDIR /

COPY --from=builder /action /action
COPY --from=builder /speakeasy /speakeasy

ENTRYPOINT ["/action"]
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log"
"net/url"
"os"
"os/exec"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport/http"
Expand All @@ -20,6 +21,8 @@ func main() {
fmt.Println(env)
}*/

runSpeakeasy()

accessToken := os.Getenv("INPUT_GITHUB-ACCESS-TOKEN")
if accessToken == "" {
log.Fatal("No access token provided")
Expand Down Expand Up @@ -47,3 +50,11 @@ func main() {
log.Fatal(err)
}
}

func runSpeakeasy() {
cmd := exec.Command("/speakeasy", "--version")
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
}

0 comments on commit 71f2757

Please sign in to comment.