-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6770 from fjordllc/main
Release 2023-08-03 08:48:43
- Loading branch information
Showing
282 changed files
with
2,262 additions
and
1,173 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,145 @@ | ||
steps: | ||
- id: Fetch | ||
name: gcr.io/cloud-builders/docker | ||
entrypoint: bash | ||
args: | ||
- '-c' | ||
- 'docker pull asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest || exit 0' | ||
- id: Build | ||
name: gcr.io/cloud-builders/docker | ||
args: | ||
- build | ||
- '-t' | ||
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' | ||
- '-t' | ||
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest' | ||
- '--cache-from' | ||
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest' | ||
- . | ||
- '-f' | ||
- Dockerfile | ||
- id: Push | ||
name: gcr.io/cloud-builders/docker | ||
args: | ||
- push | ||
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' | ||
waitFor: | ||
- Build | ||
- id: SqlProxy | ||
name: 'gcr.io/cloudsql-docker/gce-proxy:1.16' | ||
args: | ||
- /cloud_sql_proxy | ||
- '-dir=/cloudsql' | ||
- '-instances=$_CLOUD_SQL_HOST' | ||
waitFor: | ||
- '-' | ||
volumes: | ||
- name: db | ||
path: /cloudsql | ||
- name: gcr.io/google.com/cloudsdktool/cloud-sdk | ||
args: | ||
- '-c' | ||
- 'gcloud sql databases delete bootcamp_staging --instance=bootcamp --quiet || gcloud sql databases create bootcamp_staging --instance=bootcamp --quiet || exit 0' | ||
id: DropAndCreateDB | ||
waitFor: | ||
- Fetch | ||
entrypoint: sh | ||
volumes: | ||
- name: db | ||
path: /cloudsql | ||
- id: DBMigrate | ||
name: 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' | ||
args: | ||
- bin/rails | ||
- db:migrate | ||
- db:seed | ||
waitFor: | ||
- DropAndCreateDB | ||
volumes: | ||
- name: db | ||
path: /cloudsql | ||
env: | ||
- RAILS_ENV=production | ||
- DISABLE_DATABASE_ENVIRONMENT_CHECK=1 | ||
- DB_HOST=/cloudsql/$_CLOUD_SQL_HOST | ||
- DB_NAME=$_DB_NAME | ||
- DB_PASS=$_DB_PASS | ||
- DB_USER=$_DB_USER | ||
- RAILS_MASTER_KEY=$_RAILS_MASTER_KEY | ||
- id: Kill_SqlProxy | ||
name: gcr.io/cloud-builders/docker | ||
entrypoint: sh | ||
args: | ||
- '-c' | ||
- docker kill -s TERM $(docker ps -q --filter "volume=db") | ||
waitFor: | ||
- DBMigrate | ||
- id: Deploy | ||
name: gcr.io/google.com/cloudsdktool/cloud-sdk | ||
entrypoint: gcloud | ||
args: | ||
- run | ||
- deploy | ||
- $_SERVICE_NAME | ||
- '--platform=managed' | ||
- '--region=asia-northeast1' | ||
- '--quiet' | ||
- '--image=asia.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' | ||
- '--allow-unauthenticated' | ||
- '--clear-vpc-connector' | ||
- '--add-cloudsql-instances' | ||
- $_CLOUD_SQL_HOST | ||
- '--memory' | ||
- $_MEMORY | ||
- '--timeout' | ||
- '10m' | ||
- '--set-env-vars=LANG=ja_JP.UTF-8' | ||
- '--set-env-vars=TZ=Asia/Tokyo' | ||
- '--set-env-vars=RAILS_SERVE_STATIC_FILES=true' | ||
- '--set-env-vars=RAILS_LOG_TO_STDOUT=true' | ||
- '--set-env-vars=RAILS_ENV=production' | ||
- '--set-env-vars=RACK_ENV=production' | ||
- '--set-env-vars=APP_HOST_NAME=$_APP_HOST_NAME' | ||
- '--set-env-vars=CLOUD_RUN_HOST_NAME=$_CLOUD_RUN_HOST_NAME' | ||
- '--set-env-vars=RAILS_MASTER_KEY=$_RAILS_MASTER_KEY' | ||
- '--set-env-vars=DB_NAME=$_DB_NAME' | ||
- '--set-env-vars=DB_USER=$_DB_USER' | ||
- '--set-env-vars=DB_PASS=$_DB_PASS' | ||
- '--set-env-vars=DB_HOST=/cloudsql/$_CLOUD_SQL_HOST' | ||
- '--set-env-vars=GOOGLE_CREDENTIALS=$_GOOGLE_CREDENTIALS' | ||
- '--set-env-vars=GCS_BUCKET=$_GCS_BUCKET' | ||
- '--set-env-vars=TOKEN=$_TOKEN' | ||
- '--set-env-vars=DISCORD_NOTICE_WEBHOOK_URL=$_DISCORD_NOTICE_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_INTRODUCTION_WEBHOOK_URL=$_DISCORD_INTRODUCTION_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_ALL_WEBHOOK_URL=$_DISCORD_ALL_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_ADMIN_WEBHOOK_URL=$_DISCORD_ADMIN_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_MENTOR_WEBHOOK_URL=$_DISCORD_MENTOR_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_BUG_WEBHOOK_URL=$_DISCORD_BUG_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_REPORT_WEBHOOK_URL=$_DISCORD_REPORT_WEBHOOK_URL' | ||
- '--set-env-vars=DISCORD_GUILD_ID=$_DISCORD_GUILD_ID' | ||
- '--set-env-vars=DISCORD_TIMES_CHANNEL_CATEGORY_ID=$_DISCORD_TIMES_CHANNEL_CATEGORY_ID' | ||
- '--set-env-vars=DISCORD_BOT_TOKEN=$_DISCORD_BOT_TOKEN' | ||
- '--set-env-vars=GOOD_JOB_USERNAME=$_GOOD_JOB_USERNAME' | ||
- '--set-env-vars=GOOD_JOB_PASSWORD=$_GOOD_JOB_PASSWORD' | ||
- '--set-env-vars=STRIPE_ENDPOINT_SECRET=$_STRIPE_ENDPOINT_SECRET' | ||
- '--set-env-vars=BASIC_AUTH_USER=$_BASIC_AUTH_USER' | ||
- '--set-env-vars=BASIC_AUTH_PASSWORD=$_BASIC_AUTH_PASSWORD' | ||
- '--set-env-vars=RECAPTCHA_SITE_KEY=$_RECAPTCHA_SITE_KEY' | ||
- '--set-env-vars=RECAPTCHA_SECRET_KEY=$_RECAPTCHA_SECRET_KEY' | ||
- '--set-env-vars=ROLLBAR_CLIENT_TOKEN=$_ROLLBAR_CLIENT_TOKEN' | ||
- '--set-env-vars=OPEN_AI_ACCESS_TOKEN=$_OPEN_AI_ACCESS_TOKEN' | ||
- '--set-env-vars=$_ENVS' | ||
- >- | ||
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS | ||
- id: Notify | ||
name: 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest' | ||
args: | ||
- bin/notify | ||
waitFor: | ||
- Deploy | ||
env: | ||
- DB_NAME=$_DB_NAME | ||
- DEPLOY_NOTIFY_WEBHOOK_URL=$_DEPLOY_NOTIFY_WEBHOOK_URL | ||
timeout: 7200s | ||
images: | ||
- 'asia.gcr.io/$PROJECT_ID/$REPO_NAME:latest' |
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 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 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 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 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 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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class Categories::PracticesController < ApplicationController | ||
before_action :require_admin_login | ||
|
||
def index | ||
@category = Category.find(params[:category_id]) | ||
@categories_practices = @category | ||
.categories_practices | ||
.includes(:practice) | ||
.order(:position) | ||
end | ||
end |
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
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 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 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
Oops, something went wrong.