Merge pull request #977 from simple-login/fix/obtain-git-information
Obtain git information from version file
This commit is contained in:
commit
d6a50ff864
|
@ -13,4 +13,5 @@ static/upload
|
|||
venv/
|
||||
.venv
|
||||
.coverage
|
||||
htmlcov
|
||||
htmlcov
|
||||
.git/
|
|
@ -114,16 +114,25 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build image and publish to Docker Registry
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
# We need to checkout the repository in order for the "Create Sentry release" to work
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Prepare version file
|
||||
run: |
|
||||
BUILD_INFO_FILE=app/build_info.py
|
||||
echo "SHA1 = '${{ github.ref }}'" > $BUILD_INFO_FILE
|
||||
BUILD_TIME=$(date +%s)
|
||||
echo "BUILD_TIME = '${BUILD_TIME}' >> $BUILD_INFO_FILE
|
||||
cat $BUILD_INFO_FILE
|
||||
|
||||
- name: Build image and publish to Docker Registry
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
- name: Create Sentry release
|
||||
uses: getsentry/action-release@v1
|
||||
env:
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
SHA1 = "dev"
|
||||
BUILD_TIME = "1652365083"
|
|
@ -2,14 +2,13 @@ import os
|
|||
import random
|
||||
import socket
|
||||
import string
|
||||
import subprocess
|
||||
from ast import literal_eval
|
||||
from typing import Callable, List
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
SHA1 = subprocess.getoutput("git rev-parse HEAD")
|
||||
|
||||
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from app.config import SHA1
|
||||
from app.build_info import SHA1
|
||||
from app.monitor.base import monitor_bp
|
||||
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ from app.admin_model import (
|
|||
)
|
||||
from app.api.base import api_bp
|
||||
from app.auth.base import auth_bp
|
||||
from app.build_info import SHA1
|
||||
from app.config import (
|
||||
DB_URI,
|
||||
FLASK_SECRET,
|
||||
SENTRY_DSN,
|
||||
URL,
|
||||
SHA1,
|
||||
PADDLE_MONTHLY_PRODUCT_ID,
|
||||
FLASK_PROFILER_PATH,
|
||||
FLASK_PROFILER_PASSWORD,
|
||||
|
|
Loading…
Reference in New Issue