-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from intuitem/improve_version_handling
Improve version handling for multiple modes of build
- Loading branch information
Showing
10 changed files
with
56 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
.git* | ||
.pytest* | ||
.idea* | ||
.dockerignore | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CISO_ASSISTANT_VERSION=dev | ||
CISO_ASSISTANT_BUILD=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CISO_ASSISTANT_VERSION=dev | ||
CISO_ASSISTANT_BUILD=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
#! /usr/bin/env bash | ||
#!/usr/bin/env bash | ||
|
||
export VERSION=$(git describe --tags --always 2> /dev/null || echo "unknown") | ||
export BUILD=$(git rev-parse --short HEAD 2> /dev/null || echo "unknown") | ||
prepare_meta_file() { | ||
VERSION=$(git describe --tags --always) | ||
BUILD=$(git rev-parse --short HEAD) | ||
|
||
if [ -f db/ciso-assistant.sqlite3 ] ; then | ||
echo "the database seems already created" | ||
echo "you should launch docker compose up -d" | ||
echo "CISO_ASSISTANT_VERSION=${VERSION}" > .meta | ||
echo "CISO_ASSISTANT_BUILD=${BUILD}" >> .meta | ||
|
||
cp .meta ./backend/ciso_assistant/.meta | ||
cp .meta ./backend/.meta | ||
} | ||
|
||
# Check if the database already exists | ||
if [ -f db/ciso-assistant.sqlite3 ]; then | ||
echo "The database seems already created." | ||
echo "You should launch 'docker compose up -d'." | ||
else | ||
prepare_meta_file | ||
|
||
# Build and start the containers | ||
docker compose -f docker-compose-build.yml build | ||
docker compose -f docker-compose-build.yml up -d | ||
|
||
# Perform database migrations | ||
docker compose exec backend python manage.py migrate | ||
echo "initialize your superuser account..." | ||
|
||
# Initialize the superuser account | ||
echo "Initialize your superuser account..." | ||
docker compose exec backend python manage.py createsuperuser | ||
echo "connect to ciso assistant on https://localhost:8443" | ||
echo "for successive runs you can now use docker compose up" | ||
|
||
echo "Connect to CISO Assistant on https://localhost:8443" | ||
echo "For successive runs, you can now use 'docker compose up'." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters