Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix museum deployment #683

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/auth-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ jobs:
run:
working-directory: auth
steps:
# Checkout our code, including submodules
- uses: actions/checkout@v4
- name: Checkout code and submodules
uses: actions/checkout@v4
with:
submodules: recursive

# Install Flutter
- uses: subosito/flutter-action@v2
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.13.4"
cache: true

# Install dependencies
- run: flutter pub get

# Lint
- run: flutter analyze --no-fatal-infos
10 changes: 4 additions & 6 deletions .github/workflows/mobile-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ jobs:
run:
working-directory: mobile
steps:
# Checkout our code, including submodules
- uses: actions/checkout@v4
- name: Checkout code and submodules
uses: actions/checkout@v4
with:
submodules: recursive

# Install Flutter
- uses: subosito/flutter-action@v2
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.13.4"
cache: true

# Install dependencies
- run: flutter pub get

# Lint
- run: flutter analyze --no-fatal-infos
33 changes: 33 additions & 0 deletions .github/workflows/server-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Lint (server)"

on:
# Run on every push (this also covers pull requests)
push:
# See: [Note: Specify branch when specifying a path filter]
branches: ["**"]
# Only run if something changes in these paths
paths:
- "server/**"
- ".github/workflows/server-lint.yml"

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: "server/go.mod"
cache: true

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libsodium-dev

- name: Lint
run: "./scripts/lint.sh"
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: Prod CI
name: "Release (server)"

on:
workflow_dispatch:
# Enable manual run
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v4.2.0
workflow_dispatch: # Run manually

jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,6 +13,8 @@ jobs:
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & Push
with:
dockerfile: server/Dockerfile
directory: server
image: ente/museum-prod
registry: rg.fr-par.scw.cloud
enableBuildKit: true
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/web-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ jobs:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node and enable yarn caching
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: "web/yarn.lock"

- run: yarn install

- run: yarn lint
28 changes: 0 additions & 28 deletions server/.github/workflows/dev-ci.yml

This file was deleted.

21 changes: 0 additions & 21 deletions server/.github/workflows/pr.yml

This file was deleted.

4 changes: 2 additions & 2 deletions server/pkg/repo/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type QueueItem struct {

// InsertItem adds entry in the queue with given queueName and item. If entry already exists, it's no-op
func (repo *QueueRepository) InsertItem(ctx context.Context, queueName string, item string) error {
_, err := repo.DB.ExecContext(ctx, `INSERT INTO queue(queue_name, item) VALUES($1, $2)
_, err := repo.DB.ExecContext(ctx, `INSERT INTO queue(queue_name, item) VALUES($1, $2)
ON CONFLICT (queue_name, item) DO NOTHING`, queueName, item)
if err != nil {
return stacktrace.Propagate(err, "")
Expand Down Expand Up @@ -83,7 +83,7 @@ func (repo *QueueRepository) RequeueItem(ctx context.Context, queueName string,
if count == 0 {
return fmt.Errorf("no item found with queueID: %d for queue %s", queueID, queueName)
}
logrus.Info("Re-queued %d item with queueID: %d for queue %s", count, queueID, queueName)
logrus.Infof("Re-queued %d item with queueID: %d for queue %s", count, queueID, queueName)
return nil
}

Expand Down
Loading