generated from trywilco/Anythink-Market-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WilcoApp
committed
Dec 18, 2024
1 parent
37c0c38
commit 818973b
Showing
102 changed files
with
92 additions
and
20,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# set ubuntu version to 20.04 - https://github.com/devcontainers/features/issues/372 | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-ubuntu-20.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "GCP playground", | ||
"image": "mcr.microsoft.com/vscode/devcontainers/python:3", | ||
"features": { | ||
"ghcr.io/devcontainers/features/sshd:1": { | ||
"version": "latest" | ||
} | ||
}, | ||
"settings": { | ||
"extensions.ignoreRecommendations": true, | ||
"workbench.startupEditor": "none", | ||
"workbench.colorTheme": "Visual Studio Dark", | ||
"workbench.colorCustomizations": {}, | ||
"workbench.welcomePage.walkthroughs.openOnInstall": false, | ||
"workbench.welcomePage.experimental.videoTutorials": "off", | ||
"github.codespaces.defaultExtensions": [] | ||
}, | ||
"postStartCommand": "bash -c .devcontainer/setup.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
wilco: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 10 | ||
name: Pr checks | ||
|
||
steps: | ||
- name: Check out project | ||
uses: actions/checkout@v2 | ||
|
||
- uses: oNaiPs/secrets-to-env-action@v1 | ||
with: | ||
secrets: ${{ toJSON(secrets) }} | ||
|
||
- name: Wilco checks | ||
id: Wilco | ||
uses: trywilco/actions@main | ||
with: | ||
engine: ${{ secrets.WILCO_ENGINE_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/backend/node_modules | ||
/frontend/node_modules | ||
/.wilco-helpers/node_modules | ||
/tests/e2e/node_modules | ||
/tests/frontend/node_modules/ | ||
/tests/frontend/test-results/ | ||
/tests/frontend/playwright-report/ | ||
/tests/frontend/playwright/.cache/ | ||
|
||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/backend/build | ||
/frontend/build | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
#IDEs | ||
/.idea/ | ||
/.idea |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# gcp-playground | ||
GCP playground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Variables | ||
SERVICE_ACCOUNT_NAME="wilco-checks-service-account" | ||
DESCRIPTION="Verify wilco actions" | ||
DISPLAY_NAME="Wilco checks" | ||
PROJECT_ID=$(gcloud config get-value project) | ||
ROLE="roles/owner" | ||
KEY_FILE_PATH="/tmp/wilco_creds.json" | ||
|
||
# Create the service account | ||
gcloud iam service-accounts create $SERVICE_ACCOUNT_NAME \ | ||
--description="$DESCRIPTION" \ | ||
--display-name="$DISPLAY_NAME" | ||
|
||
# Assign the role to the service account | ||
gcloud projects add-iam-policy-binding $PROJECT_ID \ | ||
--member="serviceAccount:${SERVICE_ACCOUNT_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" \ | ||
--role="$ROLE" | ||
|
||
# Generate the key file for the service account | ||
gcloud iam service-accounts keys create $KEY_FILE_PATH \ | ||
--iam-account "${SERVICE_ACCOUNT_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" | ||
|
||
gcloud services enable dataflow.googleapis.com | ||
|
||
credentials="`cat $KEY_FILE_PATH`" | ||
stringified_credentials="$(echo "$credentials" | jq -R -s .)" | ||
|
||
|
||
WILCO_ID="`cat .wilco`" | ||
export ENGINE_EVENT_ENDPOINT="${ENGINE_BASE_URL}/users/${WILCO_ID}/event" | ||
|
||
# Update engine with service account credentials | ||
|
||
curl -L -X POST "${ENGINE_EVENT_ENDPOINT}" -H "Content-Type: application/json" --data-raw "{ \"event\": \"gcp_service_account_created\", \"metadata\": {\"credentials\": $stringified_credentials, \"project_id\": \"$PROJECT_ID\" }}" | ||
|
||
export GOOGLE_APPLICATION_CREDENTIALS=$KEY_FILE_PATH | ||
|
||
echo "Service account created successfully" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.