Compare commits
5 Commits
v0.1.25020
...
v0.3.25020
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c6db02e57 | |||
| d6cd731a2a | |||
| ed4d845b12 | |||
| 96afac4789 | |||
| 50690f01cf |
@@ -34,32 +34,23 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
- name: Deploy to production server
|
- name: Deploy to production server
|
||||||
run: |
|
run: |
|
||||||
|
echo "${{ github.ref_name }} - ${{ github.run_number }}"
|
||||||
TOKEN=$(curl --silent --location 'https://auth.makecodes.dev/auth' \
|
TOKEN=$(curl --silent --location 'https://auth.makecodes.dev/auth' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data '{
|
--data '{
|
||||||
"email": "'$USERNAME'",
|
"email": "'$USERNAME'",
|
||||||
"password": "'$PASSWORD'"
|
"password": "'$PASSWORD'"
|
||||||
}' | jq -r '.token')
|
}' | jq -r '.token')
|
||||||
# curl --location --silent 'https://deployer.makecodes.dev/deploy' \
|
curl --location --silent 'https://deployer.makecodes.dev/deploy' \
|
||||||
# --header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
# --header "Authorization: Bearer $TOKEN" \
|
--header "Authorization: Bearer $TOKEN" \
|
||||||
# --data '{
|
--data '{
|
||||||
# "image": "docker.nexus.makecodes.dev/makecodes/nfe-vision",
|
"image": "docker.nexus.makecodes.dev/mines/backend",
|
||||||
# "service": "nfe-vision_app",
|
"service": "mines_backend",
|
||||||
# "version": "${{ github.ref_name }}",
|
"version": "${{ github.ref_name }}",
|
||||||
# "pipeline": "${{ github.run_number }}",
|
"pipeline": "${{ github.run_number }}",
|
||||||
# "repository": "makecodes/nfe-vision"
|
"repository": "mines/backend"
|
||||||
# }'
|
}'
|
||||||
# curl --location --silent 'https://deployer.makecodes.dev/deploy' \
|
|
||||||
# --header 'Content-Type: application/json' \
|
|
||||||
# --header "Authorization: Bearer $TOKEN" \
|
|
||||||
# --data '{
|
|
||||||
# "image": "docker.nexus.makecodes.dev/makecodes/nfe-vision",
|
|
||||||
# "service": "nfe-vision_worker",
|
|
||||||
# "version": "${{ github.ref_name }}",
|
|
||||||
# "pipeline": "${{ github.run_number }}",
|
|
||||||
# "repository": "makecodes/nfe-vision"
|
|
||||||
# }'
|
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ secrets.SERVER_AUTH_USERNAME }}
|
USERNAME: ${{ secrets.SERVER_AUTH_USERNAME }}
|
||||||
PASSWORD: ${{ secrets.SERVER_AUTH_PASSWORD }}
|
PASSWORD: ${{ secrets.SERVER_AUTH_PASSWORD }}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ OP_ITEM_TITLE = os.environ.get('OP_ITEM_TITLE', 'mines')
|
|||||||
op_env = OnePassword(SCOPE, OP_ITEM_TITLE)
|
op_env = OnePassword(SCOPE, OP_ITEM_TITLE)
|
||||||
|
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
dsn=op_env.get('settings.SENTRY_DSN'),
|
dsn=op_env.get('SENTRY_DSN'),
|
||||||
integrations=[DjangoIntegration()],
|
integrations=[DjangoIntegration()],
|
||||||
environment=SCOPE,
|
environment=SCOPE,
|
||||||
send_default_pii=False,
|
send_default_pii=False,
|
||||||
@@ -23,12 +23,12 @@ sentry_sdk.init(
|
|||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = op_env.get('settings.SECRET_KEY')
|
SECRET_KEY = op_env.get('SECRET_KEY')
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = op_env.get('settings.DEBUG', '0') in ['1', 'true']
|
DEBUG = op_env.get('DEBUG', '0') in ['1', 'true']
|
||||||
|
|
||||||
ALLOWED_HOSTS = op_env.get('settings.ALLOWED_HOSTS', '127.0.0.1,localhost').split(',')
|
ALLOWED_HOSTS = op_env.get('ALLOWED_HOSTS', '127.0.0.1,localhost').split(',')
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
from django.conf import settings
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', include('api.urls')),
|
path('', include('api.urls')),
|
||||||
|
path('admin/', admin.site.urls),
|
||||||
]
|
]
|
||||||
|
|
||||||
# We need this only for development purpose
|
|
||||||
if settings.DEBUG is True:
|
|
||||||
urlpatterns += [
|
|
||||||
path('admin/', admin.site.urls),
|
|
||||||
]
|
|
||||||
|
|||||||
25
app/utils.py
25
app/utils.py
@@ -1,25 +0,0 @@
|
|||||||
import onepasswordconnectsdk
|
|
||||||
from onepasswordconnectsdk.client import Client, new_client_from_environment
|
|
||||||
|
|
||||||
|
|
||||||
def get_op_config():
|
|
||||||
op_client: Client = new_client_from_environment()
|
|
||||||
|
|
||||||
OP_DJANGO_SETTINGS_VARS = [
|
|
||||||
'database.host',
|
|
||||||
'database.port',
|
|
||||||
'database.name',
|
|
||||||
'database.user',
|
|
||||||
'database.password',
|
|
||||||
'settings.ALLOWED_HOSTS',
|
|
||||||
'settings.DEBUG',
|
|
||||||
'settings.SCOPE',
|
|
||||||
'settings.SENTRY_DSN',
|
|
||||||
'settings.SECRET_KEY',
|
|
||||||
]
|
|
||||||
|
|
||||||
op_config_get = {}
|
|
||||||
for var in OP_DJANGO_SETTINGS_VARS:
|
|
||||||
op_config_get[var] = {'opitem': 'mines', 'opfield': var}
|
|
||||||
|
|
||||||
return onepasswordconnectsdk.load_dict(op_client, op_config_get)
|
|
||||||
Reference in New Issue
Block a user