서승완
Builds for 1 pipeline passed in 25 minutes 33 seconds

chore: add gitlab ci

deploy backend to lambda with zappa
deploy frontend to s3 with awscli
1 +stages:
2 + - deploy:backend
3 + - deploy:frontend
4 +
5 +variables:
6 + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
7 +
8 +cache:
9 + paths:
10 + - "$CI_PROJECT_DIR/.cache"
11 +
12 +deploy:backend:
13 + image: python:3.6.5
14 + stage: deploy:backend
15 + cache:
16 + paths:
17 + - "$CI_PROJECT_DIR/khubox-api/venv"
18 + script:
19 + - cd $CI_PROJECT_DIR/khubox-api
20 + - pip install --upgrade pip
21 + - pip install awscli
22 + - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
23 + - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
24 + - aws configure set region $AWS_DEFAULT_REGION
25 + - pip install virtualenv
26 + - python -m virtualenv venv
27 + - source venv/bin/activate
28 + - pip install -r requirements.txt
29 + - zappa update
30 +
31 +deploy:frontend:
32 + image: nikolaik/python-nodejs:python3.6-nodejs12-alpine
33 + stage: deploy:frontend
34 + cache:
35 + paths:
36 + - "$CI_PROJECT_DIR/.yarn"
37 + - "$CI_PROJECT_DIR/khubox-front/node_modules"
38 + script:
39 + - cd $CI_PROJECT_DIR/khubox-front
40 + - yarn config set cache-folder $CI_PROJECT_DIR/.yarn
41 + - yarn install
42 + - CI=false yarn build
43 + - pip install awscli
44 + - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
45 + - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
46 + - aws configure set region $AWS_DEFAULT_REGION
47 + - aws s3 cp ./build/ s3://khubox-deploy/ --recursive --include "*" --acl public-read
48 + - aws cloudfront create-invalidation --distribution-id E1RC3LPJHL5VUA --paths "/*"