-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoo.local.yaml
80 lines (74 loc) · 2.09 KB
/
too.local.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: 0
# runtime:
# runs_on: local
# prerequisite:
# command:
# - gcloud
# - go
# - npm
# - curl
# num_cpu:
# min: 2
# memory_gb:
# min: 4
# validate:
# - run: gcloud auth list
include:
- secrets.local.yaml
- too.local.extends.yaml
env:
PROJECT_ID: triax-football
DATASTORE_PROJECT_ID: triax-football
DATASTORE_DATASET: triax-football
DATASTORE_EMULATOR_HOST: localhost:8081
DATASTORE_EMULATOR_HOST_PATH: localhost:8081/datastore
DATASTORE_HOST: http://localhost:8081
var:
DATE:
use: bash
# generate: date '+%Y-%m%d-%H%M%S'
# value: echo 2024-1113-183041
generate: echo 2024-1201-200205
# collect: stdout
prep:
steps:
- name: 確認
run: echo ${DATE}
- name: devdataのディレクトリをつくっておく
run: mkdir -p ./devdata
# - name: Datastore から Google Cloud Storage に、実データをエクスポート
# run: |
# gcloud datastore export \
# gs://${PROJECT_ID}.appspot.com/datastore-export/${DATE} \
# --project=${PROJECT_ID}
# - name: ねんのために5秒待つ
# run: sleep 5
# - name: Google Cloud Storage からデータをダウンロード
# run: |
# gcloud storage cp -r \
# gs://${PROJECT_ID}.appspot.com/datastore-export/${DATE} \
# ./devdata \
# --project=${PROJECT_ID}
main:
jobs:
- name: Datastore エミュレータを起動
label: datastore
run: gcloud beta emulators datastore start --data-dir=./devdata/${DATE} --project=${PROJECT_ID}
- name: しょうがないのでAPIで突っ込む
label: import
run: |
sleep 5 && \
curl -X POST http://${DATASTORE_EMULATOR_HOST}/v1/projects/${PROJECT_ID}:import \
-H 'Content-Type: application/json' \
-d "{\"input_url\": \"${PWD}/devdata/${DATE}/${DATE}.overall_export_metadata\"}"
- name: APIサーバ起動
label: api
run: go run main.go
- name: フロントエンドdevサーバ起動
label: frontend
run: npm run dev
post:
steps:
- name: Clean up process
run: pkill datastore
ignore_error: true