Skip to content

Commands

Noah S. Roberts edited this page Dec 2, 2024 · 9 revisions

Running make install creates a few symlinks to make running deploy and create-group much easier.

  • deploy: A symlink residing at '/usr/local/bin/deploy' pointing to '/django/source/deploy.py'
    • can be executed by both the class admin(s) and group members
  • create-group: A symlink residing at '/usr/local/bin/create-group' pointing to '/django/source/create-group.sh'
    • can only be executed by the class admin(s)

 

deploy

Note

Subcommands that deal with a specific stack will automatically detect which stack files are in the current directory, only allowing stacks to be selected.

  • start: Starts the specified stack.
  • stop: Stops the specified stack.
  • status: Displays the current status of the specified stack.
  • build: Build the Docker image(s) used in the stack.
  • pull: Pull the latest Docker image(s) used in the stack.
  • exec: Runs the specified command in the given stack and container. Stack must be running for this.
  • manage: Run manage.py with the specified arguments. Stack must be running for this.
  • log: Display log output of the stack or one of its services.
  • prep: Prepare your group's folder for deployment.

 

Container State

start, stop, restart

Required arguments:

  • stack - name of the stack to start. Autodetects which stacks are available by searching for all docker-compose.[stackname].yml files in the current directory.

status

Required arguments:

  • stack - name of the stack to start.

Optional arguments:

  • '-j' - output status as JSON.

build, pull

Required arguments:

  • stack - name of the stack to build or pull.

Optional arguments:

  • service - name of the specific service within the specified stack to build or pull. If no service is passed, all services from the stack will be built or pulled.

 

Command Execution

exec

Note

The stack must be running for this.

Required arguments:

  • stack - name of the stack to build or pull.
  • service - name of the specific service within the specified stack to run the command.
  • command - command to run

Optional arguments:

  • subargs - argument(s) for the command being run. Multiple (or no) arguments can be passed.

manage

Note

The stack must be running for this.

Required arguments:

  • command - command within manage.py to run

Optional arguments:

  • subargs - argument(s) for the command being run. Multiple (or no) arguments can be passed.

 

Miscellaneous Commands

logs

Required arguments:

  • stack - name of the stack to build or pull.

Optional arguments:

  • service - name of the specific service within the specified stack to display logs from. If no service is passed, logs from all services in the stack will be displayed.
  • -f, --follow - follow the output of the logs as they are written to.

prep

Optional arguments:

  • -r [repo url] - Remote Git repo URL to your Django site's source code.
  • -g [group name] - Name of your group. Should be the name of your group's folder.
  • -s [site name] - Name of your site. Will be in the URL.
  • -p [project folder] - Name of the Django project folder, ex: django_project, dj. This is only needed if your Django project folder has a weird name.
  • -y - Answer yes to all confirmation prompts.

 

Git commands

pull

Required argument:

  • folder - the folder containing the cloned repository to pull. This can be a relative or absolute path.

reset

This runs git reset --hard on the given folder.

Warning

This will forcefully and irreversibly overwrite all local changes to this folder! You will need to confirm your intentions before the command will be run.

Required argument:

  • folder - the folder containing the cloned repository to hard reset. This can be a relative or absolute path.

 

create-group

create-group is a super simple helper script to create a group's folder and link the necessary files from /django/source to their folder.

create-group [term] [group]
# ex:
create-group fall24 group1

Note

create-group does not create the term's folder. This needs to be manually created inside the '/django' folder. This is to prevent accidental duplicate terms from being created.

mkdir /django/[term]
# ex:
mkdir /django/fall24

Clone this wiki locally