Skip to content

Commit

Permalink
Merge pull request #38 from fc92/refactor
Browse files Browse the repository at this point in the history
move backend to dedicated folder
  • Loading branch information
fc92 authored Aug 21, 2023
2 parents 5341d02 + 20c32ba commit 29619a8
Show file tree
Hide file tree
Showing 27 changed files with 10 additions and 29 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
with:
context: .
file: build/package/Dockerfile
file: backend/build/package/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -105,23 +105,3 @@ jobs:
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: deployments/poker
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ jobs:
go-version: 1.21.0

- name: Build
working-directory: backend
run: go build -v -o poker cmd/poker.go

- name: Run coverage
working-directory: backend
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...

- name: Upload coverage reports to Codecov with GitHub Action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.21.0.linux-amd64.tar.gz"
project_path: "./cmd"
project_path: "backend/cmd"
binary_name: "poker"
extra_files: LICENSE README.md
retry: 10
Expand Down
9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This page provide technical information to facilitate future maintenance of the project.

- [Contributing](#contributing)
- [Building from sources](#building-from-sources)
- [Building backend from sources](#building-backend-from-sources)
- [Deployments methods](#deployments-methods)
- [Use CLI in console mode](#use-cli-in-console-mode)
- [Deploy the game for Web based access](#deploy-the-game-for-web-based-access)
Expand All @@ -14,18 +14,18 @@ This page provide technical information to facilitate future maintenance of the
- [Low level design](#low-level-design)
- [Debug log](#debug-log)

## Building from sources
## Building backend from sources

Prerequisites:

- internet access
- recent go version (tested with 1.19.x and 1.20)
- recent go version (tested with 1.19.x to 1.21)

Get the sources and build the `poker` binary:

```bash
git clone https://github.com/fc92/poker
cd poker
cd poker/backend
go build -o poker cmd/poker.go
```

Expand All @@ -44,7 +44,6 @@ The are different ways of deploying this client/server game:

- using CLI in console mode (recommended for development or native client on a wide range of platforms),
- with Web based access for better user experience (recommended for end users),
- with Web based access to a Kubernetes cluster (adds support for multiple poker rooms for different teams)

### Use CLI in console mode

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build:
docker build -t poker:latest -f build/package/Dockerfile .
docker build -t poker:latest -f backend/build/package/Dockerfile .

build-debug:
docker build -t poker:debug -f build/package/debug/Dockerfile .
docker build -t poker:debug -f backend/build/package/debug/Dockerfile .

all: build build-debug

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added backend/poker
Binary file not shown.

0 comments on commit 29619a8

Please sign in to comment.