Skip to content

Conversation

@chinyeungli
Copy link

Fixed #341

Create a script to use Docker container to build a Debian package.

Once the .deb is generated, one can install the package by

sudo apt install ./<package>.deb

Note: The ./ is important - it tells apt to install from a local file
rather than searching repositories.

Once it's installed, one can run the binary directly

dejacode

I need the following to run the test after installed the debian package

Create and configure a PostgreSQL user named dejacode

psql -h localhost -U postgres -c "CREATE USER dejacode; ALTER USER dejacode CREATEDB; GRANT ALL PRIVILEGES ON DATABASE dejacode TO dejacode;" 2>/dev/null || psql -h localhost -U postgres -c "ALTER USER dejacode CREATEDB; GRANT ALL PRIVILEGES ON DATABASE dejacode TO dejacode;"

Assuming the system has postgresql, if not, install it with

sudo apt install postgresql-client

Sets up environment variables and runs a test

PGPASSWORD="password" SECRET_KEY=secret dejacode test
  • Replace the "password" with the PostgreSQL password

Output

thomas@DESKTOP-6IMEJ77:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.0
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
thomas@DESKTOP-6IMEJ77:~$ dejacode

Type 'dejacode help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    optimizemigration
    runserver
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver
Note that only Django core commands are listed as settings are not properly configured (error: Set the SECRET_KEY environment variable).
thomas@DESKTOP-6IMEJ77:~$

Signed-off-by: Chin Yeung Li [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRAVEX-integration: Packaging for Debian

2 participants