Skip to content

Commit

Permalink
Merge pull request #1456 from Logflare/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecabaco authored Apr 5, 2023
2 parents 4183aef + 7cc95a4 commit fc295e1
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 87 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
mirror_image:
permissions:
contents: read
packages: write
id-token: write
needs:
- publish
# Mirror image only if new version is published
if: ${{ github.ref == 'refs/heads/master' }}
# Call workflow explicitly because events from actions cannot trigger more actions
uses: ./.github/workflows/mirror.yml
with:
version: ${{ needs.publish.outputs.logflare_version }}
secrets: inherit
trigger_cloudbuild:
name: Trigger Cloud Build in Production
if: github.ref == 'refs/heads/master'
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/mirror.yml

This file was deleted.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
58 changes: 34 additions & 24 deletions cloudbuild/prod/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,44 @@ steps:
args:
- kms
- decrypt
- --ciphertext-file=gcloud_prod.json.enc
- --plaintext-file=gcloud.json
- --location=us-central1
- --keyring=logflare-prod-keyring-us-central1
- --key=logflare-prod-secrets-key
- '--ciphertext-file=gcloud_prod.json.enc'
- '--plaintext-file=gcloud.json'
- '--location=us-central1'
- '--keyring=logflare-prod-keyring-us-central1'
- '--key=logflare-prod-secrets-key'
- name: gcr.io/cloud-builders/gcloud
args:
- kms
- decrypt
- --ciphertext-file=./.prod.env.enc
- --plaintext-file=./.secrets.env
- --location=us-central1
- --keyring=logflare-prod-keyring-us-central1
- --key=logflare-prod-secrets-key
- name: "gcr.io/cloud-builders/docker"
entrypoint: 'sh'
- '--ciphertext-file=./.prod.env.enc'
- '--plaintext-file=./.secrets.env'
- '--location=us-central1'
- '--keyring=logflare-prod-keyring-us-central1'
- '--key=logflare-prod-secrets-key'
- name: gcr.io/cloud-builders/docker
args:
[
"-c", "docker build --build-arg TAG_VERSION=$(cat ./VERSION) -t gcr.io/$PROJECT_ID/logflare_app:$COMMIT_SHA -t gcr.io/$PROJECT_ID/logflare_app:latest -f docker/secret_setup.Dockerfile .",
]
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$PROJECT_ID/logflare_app:$COMMIT_SHA"]
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$PROJECT_ID/logflare_app:latest"]
secrets:
- kmsKeyName: projects/logflare-232118/locations/us-central1/keyRings/logflare-prod-secrets-key/cryptoKeys/logflare-prod-secrets-key
- '-c'
- >-
docker build --build-arg $$MAGIC_COOKIE --build-arg TAG_VERSION=$(cat ./VERSION) -t gcr.io/$PROJECT_ID/logflare_app:$COMMIT_SHA -t
gcr.io/$PROJECT_ID/logflare_app:latest -f docker/secret_setup.Dockerfile
.
entrypoint: sh
secretEnv:
MAGIC_COOKIE: "CiQAaKkB6bwW6k2L9NxnoxLiSerCpIeLBGlN54tyvdAtGmTqBeISSQA/IRNwMsuZjfo6o1os4UkkFYG3eJzzxp6hDWbI+6El6HxSZLWLDy3ousxpSU8hip3hLypJ9aSjOLlj4zrnXFxS6qzwLA3/pEE="
options:
machineType: "N1_HIGHCPU_32"
- MAGIC_COOKIE
- name: gcr.io/cloud-builders/docker
args:
- push
- 'gcr.io/$PROJECT_ID/logflare_app:$COMMIT_SHA'
- name: gcr.io/cloud-builders/docker
args:
- push
- 'gcr.io/$PROJECT_ID/logflare_app:latest'
timeout: 1800s
options:
machineType: N1_HIGHCPU_32
secrets:
- kmsKeyName: >-
projects/logflare-232118/locations/us-central1/keyRings/logflare-prod-secrets-key/cryptoKeys/logflare-prod-secrets-key
secretEnv:
MAGIC_COOKIE: >-
CiQAaKkB6bwW6k2L9NxnoxLiSerCpIeLBGlN54tyvdAtGmTqBeISSQA/IRNwMsuZjfo6o1os4UkkFYG3eJzzxp6hDWbI+6El6HxSZLWLDy3ousxpSU8hip3hLypJ9aSjOLlj4zrnXFxS6qzwLA3/pEE=
1 change: 1 addition & 0 deletions docker/secret_setup.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ARG TAG_VERSION
FROM supabase/logflare:${TAG_VERSION}

RUN apk add tini
Expand Down
15 changes: 11 additions & 4 deletions lib/logflare_web/api_spec.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
defmodule LogflareWeb.ApiSpec do
alias LogflareWeb.Endpoint
alias LogflareWeb.Router

alias OpenApiSpex.Components
alias OpenApiSpex.Info
alias OpenApiSpex.OpenApi
alias OpenApiSpex.Paths
alias OpenApiSpex.SecurityScheme
alias OpenApiSpex.Server

alias LogflareWeb.Endpoint
alias LogflareWeb.Router

@behaviour OpenApi

@impl OpenApi
Expand All @@ -17,7 +19,12 @@ defmodule LogflareWeb.ApiSpec do
title: to_string(Application.spec(:logflare, :description)),
version: to_string(Application.spec(:logflare, :vsn))
},
paths: Paths.from_router(Router)
paths: Paths.from_router(Router),
components: %Components{
securitySchemes: %{
"authorization" => %SecurityScheme{type: "http", scheme: "bearer", bearerFormat: "JWT"}
}
}
})
end
end

0 comments on commit fc295e1

Please sign in to comment.