Skip to content

Commit

Permalink
chore: add call to supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 19, 2024
1 parent f8a6e9b commit d1b904d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
Binary file modified plugins/kontinuous-ui/.yarn/install-state.gz
Binary file not shown.
41 changes: 27 additions & 14 deletions plugins/kontinuous-ui/pre-deploy/01-deployment_event.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
// const { createClient } = require("@supabase/supabase-js")
const { createClient } = require("@supabase/supabase-js")

Check failure on line 1 in plugins/kontinuous-ui/pre-deploy/01-deployment_event.js

View workflow job for this annotation

GitHub Actions / Lint

Unable to resolve path to module '@supabase/supabase-js'

Check failure on line 1 in plugins/kontinuous-ui/pre-deploy/01-deployment_event.js

View workflow job for this annotation

GitHub Actions / Lint

"@supabase/supabase-js" is not found

module.exports = async (manifests, _options, { config, logger }) => {
const { repositoryName } = config
logger.debug("*****> REPOSITORY NAME:", repositoryName)
module.exports = async (_manifests, _options, { config }) => {
const {
action,
gitSha,
projectName,
environment,
refLabelValue,
repositoryName,
} = config

// const supabase = createClient(
// "https://dabwsunwcukreynmegja.supabase.co",
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRhYndzdW53Y3VrcmV5bm1lZ2phIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjU2NDQwMDksImV4cCI6MjA0MTIyMDAwOX0.8779ZywO5dvRLfMGMShlxBUqGeqC6WK4k3e0puBN7So"
// )
// logger.info("Creation du client supabase")
// const { data, error } = await supabase.from("users").select("*")
// logger.info("Execution de la requete", error)
// if (error) throw error
// logger.info("DATA:", JSON.stringify(data, null, 2))
logger.info("CONFIG", config)
const supabase = createClient(
"https://dabwsunwcukreynmegja.supabase.co",
"XXXX"
)

const { error } = await supabase.from("deployments_logs").insert([
{
status: action,
commit_hash: gitSha,
project: projectName,
environment,
branch: refLabelValue,
repository: repositoryName,
},
])

if (error) throw error
}

// ../kontinuous/kontinuous deploy --kubeconfig-context ovh-dev --dry-run -d

0 comments on commit d1b904d

Please sign in to comment.