From 17205142309b5f024c93c693be3a9f5364a110a6 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 17:10:07 +0300 Subject: [PATCH 01/33] myname --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2bec0368b..ae079fd0b5 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Run the server: go build -o notely && ./notely ``` -*This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8080`. +_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`. -You do *not* need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course! +You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course! +donutz03 From 6ece40ba525d964928ae72aee1476209ecf82948 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 18:29:55 +0300 Subject: [PATCH 02/33] add ci.yml --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..99ceb2f807 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: ci + +on: + pull_request: + branches: [main] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name: Force Failure + run: (exit 1) From 4401d67a7960170d050f215bf11d714cf52ab3d6 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 18:34:10 +0300 Subject: [PATCH 03/33] success --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99ceb2f807..148388de54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.23.0" - - name: Force Failure - run: (exit 1) + - name: Success + run: (go version) From 9a9ee148be4b1487b0bf8488af516ff22e1f088e Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 18:52:46 +0300 Subject: [PATCH 04/33] broken code --- .github/workflows/ci.yml | 4 +-- internal/auth/auth.go | 2 +- internal/auth/auth_test.go | 68 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 internal/auth/auth_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 148388de54..be78d5c224 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.23.0" - - name: Success - run: (go version) + - name: Tests locally auth + run: go test ./... diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f969aacf63..9bf2704ef8 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -16,7 +16,7 @@ func GetAPIKey(headers http.Header) (string, error) { } splitAuth := strings.Split(authHeader, " ") if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { - return "", errors.New("malformed authorization header") + // return "", errors.New("malformed authorization header") } return splitAuth[1], nil diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go new file mode 100644 index 0000000000..9bce548070 --- /dev/null +++ b/internal/auth/auth_test.go @@ -0,0 +1,68 @@ +package auth + +import ( + "errors" + "net/http" + "testing" +) + +func TestGetAPIKey(t *testing.T) { + tests := []struct { + name string + headers http.Header + expectedKey string + expectedError error + }{ + { + name: "No Authorization header", + headers: http.Header{}, + expectedKey: "", + expectedError: ErrNoAuthHeaderIncluded, + }, + { + name: "Malformed Authorization header - no space", + headers: http.Header{ + "Authorization": []string{"ApiKey"}, + }, + expectedKey: "", + expectedError: errors.New("malformed authorization header"), + }, + { + name: "Malformed Authorization header - wrong prefix", + headers: http.Header{ + "Authorization": []string{"Bearer token123"}, + }, + expectedKey: "", + expectedError: errors.New("malformed authorization header"), + }, + { + name: "Valid Authorization header", + headers: http.Header{ + "Authorization": []string{"ApiKey test123"}, + }, + expectedKey: "test123", + expectedError: nil, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + key, err := GetAPIKey(tt.headers) + if err != nil && tt.expectedError == nil { + t.Errorf("GetAPIKey() unexpected error = %v", err) + return + } + if err == nil && tt.expectedError != nil { + t.Errorf("GetAPIKey() expected error = %v, got nil", tt.expectedError) + return + } + if err != nil && tt.expectedError != nil && err.Error() != tt.expectedError.Error() { + t.Errorf("GetAPIKey() error = %v, expected error = %v", err, tt.expectedError) + return + } + if key != tt.expectedKey { + t.Errorf("GetAPIKey() key = %v, expected key = %v", key, tt.expectedKey) + } + }) + } +} From 71a992f064f0d52423fbf3efc1704bd80f1d7ec4 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 18:54:10 +0300 Subject: [PATCH 05/33] fix broken code --- internal/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 9bf2704ef8..f969aacf63 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -16,7 +16,7 @@ func GetAPIKey(headers http.Header) (string, error) { } splitAuth := strings.Split(authHeader, " ") if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { - // return "", errors.New("malformed authorization header") + return "", errors.New("malformed authorization header") } return splitAuth[1], nil From 9f40418f9f565bd80ba8333d08c170c8dec09599 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 18:56:40 +0300 Subject: [PATCH 06/33] add coverage --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be78d5c224..ff12c15b7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.23.0" - name: Tests locally auth - run: go test ./... + run: go test ./... -cover From b79a389b1f3a48d42eb84d8c76a2aba66c56701b Mon Sep 17 00:00:00 2001 From: donutz03 Date: Mon, 5 May 2025 19:00:48 +0300 Subject: [PATCH 07/33] status --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ae079fd0b5..43216f9fb4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![ci](https://github.com/donutz03/learn-cicd-starter/actions/workflows/ci.yml/badge.svg?branch=addtests)](https://github.com/donutz03/learn-cicd-starter/actions/workflows/ci.yml) + # learn-cicd-starter (Notely) This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). From 4a19c52bec989811203ba13ba9348ed2e7e39903 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 17:47:14 +0300 Subject: [PATCH 08/33] format wrong --- main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.go b/main.go index 19d7366c5f..b21a6e81ad 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,7 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) -type apiConfig struct { - DB *database.Queries +type apiConfig struct {DB *database.Queries } //go:embed static/* From 254b839ab9c85b771ee8baf2b7a7d6c97a3f0971 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 17:53:02 +0300 Subject: [PATCH 09/33] br --- .github/workflows/ci.yml | 15 +++++++++++++++ main.go | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff12c15b7f..23ee2706c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,18 @@ jobs: - name: Tests locally auth run: go test ./... -cover + style: + name: Style + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name: style format automatically + run: test -z $(go fmt ./...) diff --git a/main.go b/main.go index b21a6e81ad..19d7366c5f 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,8 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) -type apiConfig struct {DB *database.Queries +type apiConfig struct { + DB *database.Queries } //go:embed static/* From dbd9d47e3bd9504a751c9708159bda4f788e59b6 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 18:04:11 +0300 Subject: [PATCH 10/33] add new yml --- .github/workflows/ci.yml | 3 +++ main.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23ee2706c4..d64268b3ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,6 @@ jobs: - name: style format automatically run: test -z $(go fmt ./...) + + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest diff --git a/main.go b/main.go index 19d7366c5f..56c493934d 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,11 @@ type apiConfig struct { //go:embed static/* var staticFiles embed.FS +func unused() { + // this function does nothing + // and is called nowhere +} + func main() { err := godotenv.Load(".env") if err != nil { From 01fad7f35d490d0cfe22b8b0681eeebe16635818 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 18:20:18 +0300 Subject: [PATCH 11/33] security --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d64268b3ae..8e822c6c14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,10 @@ jobs: - name: Tests locally auth run: go test ./... -cover + + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest + style: name: Style runs-on: ubuntu-latest From d7112c432c1718eb38ab2ddeb6c310cb53f537e0 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 18:27:12 +0300 Subject: [PATCH 12/33] security --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e822c6c14..a7216fb050 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - name: Install gosec run: go install github.com/securego/gosec/v2/cmd/gosec@latest + - name: Run gosec security scan + run: gosec ./... + style: name: Style runs-on: ubuntu-latest From accc65f366952100162b63f062564a5c87aa27de Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 18:33:23 +0300 Subject: [PATCH 13/33] fix security --- json.go | 4 +++- main.go | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/json.go b/json.go index 1e6e7985e1..8d4f9d6c93 100644 --- a/json.go +++ b/json.go @@ -30,5 +30,7 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } w.WriteHeader(code) - w.Write(dat) + if _, err := w.Write(dat); err != nil { + log.Printf("failed to write response: %v", err) + } } diff --git a/main.go b/main.go index 56c493934d..09b9d8d68d 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "log" "net/http" "os" + "time" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -24,11 +25,6 @@ type apiConfig struct { //go:embed static/* var staticFiles embed.FS -func unused() { - // this function does nothing - // and is called nowhere -} - func main() { err := godotenv.Load(".env") if err != nil { @@ -94,8 +90,9 @@ func main() { router.Mount("/v1", v1Router) srv := &http.Server{ - Addr: ":" + port, - Handler: router, + ReadHeaderTimeout: 5 * time.Second, + Addr: ":" + port, + Handler: router, } log.Printf("Serving on port: %s\n", port) From 020670641c334ebd788759ca746ab7be28cd26a4 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 20:10:34 +0300 Subject: [PATCH 14/33] cd --- .github/workflows/cd.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000000..22c2be9546 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,21 @@ +name: cd + +on: + push: + branches: [main] + +jobs: + Deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name: Build + run: ./scripts/buildprod.sh \ No newline at end of file From 5ed3d315c3c0f440cb045434d9ec71bbce5e2578 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 20:48:47 +0300 Subject: [PATCH 15/33] GC integration --- .github/workflows/cd.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 22c2be9546..660bb0daf2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,4 +18,19 @@ jobs: go-version: "1.23.0" - name: Build - run: ./scripts/buildprod.sh \ No newline at end of file + run: ./scripts/buildprod.sh + + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v2 + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: Set up gcloud CLI + uses: google-github-actions/setup-gcloud@v2 + with: + project_id: notely-459117 + version: '>= 416.0.0' + + - name: Submit image to Artifact Registry via Cloud Build + run: | + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest . From 858fa499ae470cc8bdaeecb24a9702a3bd5f3527 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:15:00 +0300 Subject: [PATCH 16/33] fix --- .github/workflows/cd.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 660bb0daf2..2a20072e64 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -17,19 +17,22 @@ jobs: with: go-version: "1.23.0" + - name: Clean up existing files + run: rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* + - name: Build run: ./scripts/buildprod.sh - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: - credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + credentials_json: "${{ secrets.GCP_CREDENTIALS }}" - name: Set up gcloud CLI uses: google-github-actions/setup-gcloud@v2 with: project_id: notely-459117 - version: '>= 416.0.0' + version: ">= 416.0.0" - name: Submit image to Artifact Registry via Cloud Build run: | From bdfd8e78657531ef348d96fdc6a513bc475bf70d Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 21:18:24 +0300 Subject: [PATCH 17/33] fix (#4) Co-authored-by: donutz03 --- .github/workflows/cd.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 660bb0daf2..2a20072e64 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -17,19 +17,22 @@ jobs: with: go-version: "1.23.0" + - name: Clean up existing files + run: rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* + - name: Build run: ./scripts/buildprod.sh - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: - credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + credentials_json: "${{ secrets.GCP_CREDENTIALS }}" - name: Set up gcloud CLI uses: google-github-actions/setup-gcloud@v2 with: project_id: notely-459117 - version: '>= 416.0.0' + version: ">= 416.0.0" - name: Submit image to Artifact Registry via Cloud Build run: | From 255df3e27768c8f8525a64338670da372eca5048 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:22:59 +0300 Subject: [PATCH 18/33] a --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2a20072e64..c9a78d002d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,7 +18,7 @@ jobs: go-version: "1.23.0" - name: Clean up existing files - run: rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* + run: sudo rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* - name: Build run: ./scripts/buildprod.sh From 48dbdfa975b5cd40f6ad3a9751727fa9fa941411 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:25:14 +0300 Subject: [PATCH 19/33] ab --- .github/workflows/cd.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c9a78d002d..fbf55fc235 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,7 +5,8 @@ on: branches: [main] jobs: - Deploy: + deploy: + name: Deploy runs-on: ubuntu-latest steps: @@ -17,23 +18,20 @@ jobs: with: go-version: "1.23.0" - - name: Clean up existing files - run: sudo rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* - - - name: Build + - name: Build app run: ./scripts/buildprod.sh - - name: Authenticate to Google Cloud + - id: auth uses: google-github-actions/auth@v2 with: - credentials_json: "${{ secrets.GCP_CREDENTIALS }}" + credentials_json: ${{ secrets.GCP_CREDENTIALS }} - - name: Set up gcloud CLI + - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v2 - with: - project_id: notely-459117 - version: ">= 416.0.0" - - name: Submit image to Artifact Registry via Cloud Build + - name: Use gcloud CLI + run: gcloud info + + - name: Build and push Docker image run: | gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest . From 1a29cc80edd1bcf9ab089eb2ef2e94fe3748a12a Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 21:30:35 +0300 Subject: [PATCH 20/33] Addtests (#5) * fix * a * ab --------- Co-authored-by: donutz03 --- .github/workflows/cd.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2a20072e64..fbf55fc235 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,7 +5,8 @@ on: branches: [main] jobs: - Deploy: + deploy: + name: Deploy runs-on: ubuntu-latest steps: @@ -17,23 +18,20 @@ jobs: with: go-version: "1.23.0" - - name: Clean up existing files - run: rm -rf ../../../go/pkg/mod/golang.org/x/telemetry/config@v0.47.0/* - - - name: Build + - name: Build app run: ./scripts/buildprod.sh - - name: Authenticate to Google Cloud + - id: auth uses: google-github-actions/auth@v2 with: - credentials_json: "${{ secrets.GCP_CREDENTIALS }}" + credentials_json: ${{ secrets.GCP_CREDENTIALS }} - - name: Set up gcloud CLI + - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v2 - with: - project_id: notely-459117 - version: ">= 416.0.0" - - name: Submit image to Artifact Registry via Cloud Build + - name: Use gcloud CLI + run: gcloud info + + - name: Build and push Docker image run: | gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest . From aafe4dca3392487400ecc888432c528c304051bc Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:45:45 +0300 Subject: [PATCH 21/33] kk --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fbf55fc235..90febcd079 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,6 +32,6 @@ jobs: - name: Use gcloud CLI run: gcloud info - - name: Build and push Docker image + - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest . + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com From 6c868eca17face20f33ae014666bc3f7a5b43b15 Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 21:49:06 +0300 Subject: [PATCH 22/33] Addtests (#6) * fix * a * ab * kk --------- Co-authored-by: donutz03 --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fbf55fc235..90febcd079 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,6 +32,6 @@ jobs: - name: Use gcloud CLI run: gcloud info - - name: Build and push Docker image + - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest . + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com From 5ea247eae48e106ce3e87a3fdfe7870cb14c1b51 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:50:43 +0300 Subject: [PATCH 23/33] d --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 90febcd079..49379a799a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com logging=CLOUD_LOGGING_ONLY From 82baf1f5365dbc598fae9641f362d81be9c9431f Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 21:52:43 +0300 Subject: [PATCH 24/33] Addtests (#7) * fix * a * ab * kk * d --------- Co-authored-by: donutz03 --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 90febcd079..49379a799a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com logging=CLOUD_LOGGING_ONLY From 60c71a5ed7c12be09dca5065f11a0265f542843a Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:54:53 +0300 Subject: [PATCH 25/33] d --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 49379a799a..652f95b009 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com logging=CLOUD_LOGGING_ONLY + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --logging=CLOUD_LOGGING_ONLY From aa5a571b28702066d529e76932a59e98d1a596b9 Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 21:56:58 +0300 Subject: [PATCH 26/33] Addtests (#8) * fix * a * ab * kk * d * d --------- Co-authored-by: donutz03 --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 49379a799a..652f95b009 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com logging=CLOUD_LOGGING_ONLY + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --logging=CLOUD_LOGGING_ONLY From 8ff6fbe55baa870fda6d0b0a067c3fca404654a2 Mon Sep 17 00:00:00 2001 From: donutz03 Date: Wed, 7 May 2025 21:58:43 +0300 Subject: [PATCH 27/33] x --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 652f95b009..794b699f55 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --logging=CLOUD_LOGGING_ONLY + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --gcs-log-dir=gs://notely-459117_cloudbuild/logs From 4f230dc48fc75f2d13aa7b05052b4b666ecd92ad Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 22:00:27 +0300 Subject: [PATCH 28/33] Addtests (#9) * fix * a * ab * kk * d * d * x --------- Co-authored-by: donutz03 --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 652f95b009..794b699f55 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,4 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --logging=CLOUD_LOGGING_ONLY + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --gcs-log-dir=gs://notely-459117_cloudbuild/logs From d39d9992c7b6be8a213e3ed099421d123e43720b Mon Sep 17 00:00:00 2001 From: donutz03 <109514731+donutz03@users.noreply.github.com> Date: Wed, 7 May 2025 22:03:39 +0300 Subject: [PATCH 29/33] Update cd.yml --- .github/workflows/cd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 794b699f55..a71d14482c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,5 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --gcs-log-dir=gs://notely-459117_cloudbuild/logs + gcloud builds submit . --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=projects/notely-459117/serviceAccounts/cloud-run-deployer@notely-459117.iam.gserviceaccount.com --gcs-log-dir=gs://notely-459117_cloudbuild/logs + From b8a865a700d5f1a5d0209c9619affb39ba617c2c Mon Sep 17 00:00:00 2001 From: donutz03 Date: Thu, 8 May 2025 20:35:59 +0300 Subject: [PATCH 30/33] auto --- .github/workflows/cd.yml | 13 +- static/index.html | 354 ++++++++++++++++++++------------------- 2 files changed, 194 insertions(+), 173 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 794b699f55..dd0f207773 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,4 +34,15 @@ jobs: - name: Build and push Docker image to Artifact Registry run: | - gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com --gcs-log-dir=gs://notely-459117_cloudbuild/logs + gcloud builds submit --tag us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest \ + --service-account=cloud-run-deployer@notely-459117.iam.gserviceaccount.com \ + --gcs-log-dir=gs://notely-459117_cloudbuild/logs + + - name: Deploy to Cloud Run + run: | + gcloud run deploy notely \ + --image us-central1-docker.pkg.dev/notely-459117/notely-ar-repo/notely:latest \ + --region us-central1 \ + --allow-unauthenticated \ + --project notely-459117 \ + --max-instances=4 diff --git a/static/index.html b/static/index.html index 72be101028..d9997c6fef 100644 --- a/static/index.html +++ b/static/index.html @@ -1,193 +1,203 @@ + + + Welcome to Notely + - - - Notely - - - +

Notely

- - + +
-