Skip to content

Commit

Permalink
feat(refactor): Re-write action in Go (#19)
Browse files Browse the repository at this point in the history
* feat: Re-write action in Go

* use resty to query version endpoint

* configure restry client

* log the bindplane api version

* implement apply

* validate file paths

* cleanup errors

* gaurd against unset path

* update error

* log status

* fix condition

* Debug apply response

* debug api response

* read file and unmarshal to correct type before applying to api

* properly decode yaml file with multiple objects

* move empty file check

* use err

* remove debug log

* rollout configs with pending rollouts

* set options for rollout, need to dial them in

* use nil options

* refactor

* add full config object

* try cloning the repo

* check repo status

* format logs

* write files and detect changes

* cleanup resources before writing

* try commit and push

* push origin

* write to out dir

* implement state

* Debug

* fix state by using correct resource Kind values

* implement state package with save data access

* state nil check

* use state key

* return config names as slice

* fix client configuration method

* fix api path

* test state package

* organize

* write raw config

* vendor deps

* remove git for ca certs

* Revert "vendor deps"

This reverts commit 1281c63.

* remove targetBranch from action package and check if traget branch in main

* remove legacy entrypoint script

* move client to internal

* breakup internal/client

* remove unused kinds
  • Loading branch information
jsirianni authored May 16, 2024
1 parent bad1f18 commit 610ca77
Show file tree
Hide file tree
Showing 28 changed files with 2,393 additions and 256 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
- name: Install ShellCheck
run: sudo apt-get install shellcheck

- name: Run ShellCheck entrypoint.sh
run: shellcheck -x -s bash entrypoint.sh

- name: Run ShellCheck test script
run: shellcheck -x -s bash .github/workflows/scripts/*.sh

Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Container image that runs your code
FROM alpine:3.10

RUN apk add --no-cache bash curl git jq
FROM golang:1.22-alpine as builder
WORKDIR /app
COPY . .
WORKDIR /app/cmd/action
RUN CGO_ENABLED=0 go build -o /entrypoint

COPY --chmod=0755 entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
FROM alpine:3.10
RUN apk add --no-cache ca-certificates
COPY --from=builder /entrypoint /entrypoint
ENTRYPOINT ["/entrypoint"]
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ runs:
using: 'docker'
image: 'Dockerfile'
# Arg order must match the order of the arg parsing
# in entrypoint.sh.
args:
- ${{ inputs.bindplane_remote_url }}
- ${{ inputs.bindplane_api_key }}
Expand Down
Loading

0 comments on commit 610ca77

Please sign in to comment.