Skip to content

Commit f154c17

Browse files
committed
Merge remote-tracking branch 'upstream/devdev' into devdev
# Conflicts: # .github/workflows/deploy_on_dev.yml
2 parents b83b8e7 + 5e5b9b0 commit f154c17

File tree

8 files changed

+62
-19
lines changed

8 files changed

+62
-19
lines changed

.github/workflows/deploy_on_dev.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: [3.8]
13+
python-version: [3.9]
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -42,17 +42,18 @@ jobs:
4242
4343
- name: Create Virtualenv
4444
run: |
45-
virtualenv pyconweb2022-zappa
45+
virtualenv zappa-env
4646
4747
# - name: Activate Virtualenv
4848
# run: |
49-
# source ./pyconweb2022-zappa/bin/activate
49+
# source ./zappa-env/bin/activate
5050

5151
- name: Install dependencies
5252
run: |
53-
source ./pyconweb2022-zappa/bin/activate
53+
source ./zappa-env/bin/activate
5454
python -m pip install --upgrade pip
5555
pip install pytest
56+
pip install zappa
5657
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
5758
5859
# Pull request dose not get the gitub action secrets
@@ -65,18 +66,18 @@ jobs:
6566

6667
- name: update pyconkr-secretes
6768
run: |
68-
./update_secrets.sh
69+
chmod 775 ./update_secrets.sh
70+
./update_secrets.sh
6971
7072
- name: Test with Django Test
7173
run: |
72-
source ./pyconweb2022-zappa/bin/activate
73-
cd pyconweb2022
74+
source ./zappa-env/bin/activate
7475
python manage.py test
7576
76-
- name: Test with pytest
77-
run: |
78-
source ./pyconweb2022-zappa/bin/activate
79-
pytest pyconweb2022
77+
# - name: Test with pytest
78+
# run: |
79+
# source ./zappa-env/bin/activate
80+
# pytest pyconweb2022
8081

8182
- name: Configure AWS Credentials
8283
uses: aws-actions/configure-aws-credentials@v1
@@ -90,7 +91,6 @@ jobs:
9091
AWS_ACCESS_KEY_ID: ${{ secrets.PYCON_DEV_2021_AWS_KEY }}
9192
AWS_SECRET_ACCESS_KEY: ${{ secrets.PYCON_DEV_2021_AWS_SECRET }}
9293
run: |
93-
source ./pyconweb2022-zappa/bin/activate
94-
cd pyconweb2022
95-
zappa update dev
94+
source ./zappa-env/bin/activate
95+
zappa update dev2023
9696
# zappa manage dev collectstatic
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Pull Request Merge Precondition
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.8]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: psf/black@stable
16+
with:
17+
options: "--check --verbose"

pyconkr/settings-dev.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
"PORT": os.getenv("AWS_RDS_PORT"),
1414
}
1515
}
16+
17+
# django-storages: S3
18+
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
19+
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
20+
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
21+
AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
22+
AWS_STORAGE_BUCKET_NAME = "pyconkr-api-v2-static-dev"

pyconkr/settings-prod.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
"PORT": os.getenv("AWS_RDS_PORT"),
1414
}
1515
}
16+
17+
# django-storages: S3
18+
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
19+
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
20+
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
21+
AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
22+
AWS_STORAGE_BUCKET_NAME = "pyconkr-api-v2-static"

pyconkr/settings.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"django.contrib.sessions",
3838
"django.contrib.messages",
3939
"django.contrib.staticfiles",
40-
4140
# djangorestframework
4241
"rest_framework",
4342
]
@@ -106,16 +105,16 @@
106105
# Internationalization
107106
# https://docs.djangoproject.com/en/4.1/topics/i18n/
108107

109-
LANGUAGE_CODE = "en-us"
108+
LANGUAGE_CODE = "ko-KR"
110109

111-
TIME_ZONE = "UTC"
110+
TIME_ZONE = "Asia/Seoul"
112111

113112
USE_I18N = True
114113

115114
USE_TZ = True
116115

117116

118-
# Static files (CSS, JavaScript, Images)
117+
# Static files (CSS, JavaScript, Images) (w/ django-storages)
119118
# https://docs.djangoproject.com/en/4.1/howto/static-files/
120119

121120
STATIC_URL = "static/"

pyconkr/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
from django.urls import path, include
1818

1919
urlpatterns = [
20-
path('api-auth/', include('rest_framework.urls')),
20+
path("api-auth/", include("rest_framework.urls")),
2121
path("admin/", admin.site.urls),
2222
]

requirements.txt

-242 Bytes
Binary file not shown.

update_secrets.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# REPO_BASE_URL="github.com/pythonkr/pyconkr-secrets.git"
4+
# REPO_URL="https://${REPO_BASE_URL}"
5+
REPO_URL="[email protected]:pythonkr/pyconkr-secrets.git"
6+
7+
# checkout repo from github
8+
mkdir -p .temp
9+
pushd .temp
10+
git clone --depth=1 ${REPO_URL}
11+
rsync -arv ./pyconkr-secrets/pyconkr-api-v2/ ..
12+
popd
13+
rm -rf ./.temp

0 commit comments

Comments
 (0)