Skip to content

Commit

Permalink
Merge pull request #22 from B-urb/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
B-urb committed Feb 29, 2024
2 parents 6799fd2 + d42a3e7 commit 4b3a039
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 109 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
environment: development
strategy:
matrix:
go-version: [ '1.21' ]
go-version: [ '1.22' ]
node-version: [ 18 ]
goarch: [ 'amd64', 'arm64' ] # Define architectures here
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Setup Node.js
Expand All @@ -47,41 +47,40 @@ jobs:
- name: Build
working-directory: frontend
run: npm run build
- name: Install ARM64 cross-compiler
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install dependencies
working-directory: backend
run: go get ./...
- name: Set up CC for cross-compilation
if: matrix.goarch == 'arm64'
run: echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
working-directory: backend
run: |
GOOS=linux GOARCH=${{ matrix.goarch }} go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
GOOS=linux GOARCH=${{ matrix.goarch }} CGO_ENABLED=1 go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
#- name: Test with the Go CLI
# run: go test
- name: Archive production artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
name: production-artifacts
path: |
backend/
frontend/public

build-docker:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [ 'amd64', 'arm64' ] # Define architectures here
if: ${{ github.ref }} != 'master' && ${{ github.ref }} != 'development'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
merge-multiple: true
name: production-artifacts
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

Expand All @@ -96,9 +95,7 @@ jobs:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage:${{ env.BRANCH_NAME }}
platforms: linux/${{ matrix.goarch }}
build-args: |
TARGETARCH=${{ matrix.goarch }}
platforms: linux/amd64,linux/arm64
release:
needs: helm-release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,7 +144,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT }}

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: deploy/
env:
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
environment: production
strategy:
matrix:
go-version: [ '1.21' ]
go-version: [ '1.22' ]
node-version: [ 18 ]
goarch: [ 'amd64', 'arm64' ] # Define architectures here
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Setup Node.js
Expand All @@ -41,41 +41,40 @@ jobs:
- name: Build
working-directory: frontend
run: npm run build
- name: Install ARM64 cross-compiler
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install dependencies
working-directory: backend
run: go get ./...
- name: Set up CC for cross-compilation
if: matrix.goarch == 'arm64'
run: echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
working-directory: backend
run: |
GOOS=linux GOARCH=${{ matrix.goarch }} go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
GOOS=linux GOARCH=${{ matrix.goarch }} CGO_ENABLED=1 go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
#- name: Test with the Go CLI
# run: go test
- name: Archive production artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
name: production-artifacts
path: |
backend/
frontend/public
build-docker:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [ 'amd64', 'arm64' ] # Define architectures here
if: ${{ github.ref }} != 'master' && ${{ github.ref }} != 'development'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
merge-multiple: true

name: production-artifacts
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

Expand All @@ -90,9 +89,7 @@ jobs:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage:${{ env.BRANCH_NAME }}
platforms: linux/${{ matrix.goarch }}
build-args: |
TARGETARCH=${{ matrix.goarch }}
platforms: linux/amd64,linux/arm64
helm-release:
needs: build-docker
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
environment: development
strategy:
matrix:
go-version: [ '1.21' ]
go-version: [ '1.22' ]
node-version: [ 18 ]
goarch: [ 'amd64', 'arm64' ] # Define architectures here
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Setup Node.js
Expand All @@ -41,39 +41,40 @@ jobs:
- name: Build
working-directory: frontend
run: npm run build
- name: Install ARM64 cross-compiler
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install dependencies
working-directory: backend
run: go get ./...
- name: Set up CC for cross-compilation
if: matrix.goarch == 'arm64'
run: echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
working-directory: backend
run: |
GOOS=linux GOARCH=${{ matrix.goarch }} go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
GOOS=linux GOARCH=${{ matrix.goarch }} CGO_ENABLED=1 go build -o build/kubevoyage-${{ matrix.goarch }} ./cmd/kubevoyage
#- name: Test with the Go CLI
# run: go test
- name: Archive production artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
name: production-artifacts
path: |
backend/
frontend/public
build-docker:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [ 'amd64', 'arm64' ] # Define architectures here
if: ${{ github.ref }} != 'master' && ${{ github.ref }} != 'development'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: production-artifacts-${{matrix.goarch}}
merge-multiple: true
name: production-artifacts
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

Expand All @@ -88,9 +89,7 @@ jobs:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage:${{ env.BRANCH_NAME }}
platforms: linux/${{ matrix.goarch }}
build-args: |
TARGETARCH=${{ matrix.goarch }}
platforms: linux/amd64,linux/arm64
helm-release:
needs: build-docker
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21
FROM golang:1.22
# Define an argument for the architecture, which will be passed from the build command
ARG TARGETARCH
LABEL authors="bjornurban"
Expand Down
18 changes: 9 additions & 9 deletions backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ module github.com/B-Urb/KubeVoyage
go 1.21

require (
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/rs/cors v1.10.0
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/rs/cors v1.10.1
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.13.0
gorm.io/driver/mysql v1.5.1
gorm.io/driver/postgres v1.5.2
gorm.io/driver/sqlite v1.5.3
gorm.io/gorm v1.25.4
golang.org/x/crypto v0.20.0
gorm.io/driver/mysql v1.5.4
gorm.io/driver/postgres v1.5.6
gorm.io/driver/sqlite v1.5.5
gorm.io/gorm v1.25.7
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.3.1 // indirect
github.com/jackc/pgx/v5 v5.4.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
21 changes: 21 additions & 0 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
github.com/jackc/pgx/v5 v5.4.3 h1:cxFyXhxlvAifxnkKKdlxv8XqUf59tDlYjnV5YYfsJJY=
github.com/jackc/pgx/v5 v5.4.3/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
Expand All @@ -28,15 +32,23 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand All @@ -45,10 +57,19 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
gorm.io/driver/mysql v1.5.4 h1:igQmHfKcbaTVyAIHNhhB888vvxh8EdQ2uSUT0LPcBso=
gorm.io/driver/mysql v1.5.4/go.mod h1:9rYxJph/u9SWkWc9yY4XJ1F/+xO0S/ChOmbk3+Z5Tvs=
gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0=
gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
gorm.io/driver/postgres v1.5.6 h1:ydr9xEd5YAM0vxVDY0X139dyzNz10spDiDlC7+ibLeU=
gorm.io/driver/postgres v1.5.6/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA=
gorm.io/driver/sqlite v1.5.3 h1:7/0dUgX28KAcopdfbRWWl68Rflh6osa4rDh+m51KL2g=
gorm.io/driver/sqlite v1.5.3/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4=
gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E=
gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE=
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw=
gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A=
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
Loading

0 comments on commit 4b3a039

Please sign in to comment.