-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐳 docker image and deploy script #84
Conversation
deployer.py
Outdated
click.echo(f"Branch: { branch }") | ||
cmd = f"""docker run -it -v {realpath('')}:/root/ {DOCKER_IMAGE}""" | ||
|
||
sub_run(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrharpo how does context
and branch
inform the docker run
command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot about this file. This was a secondary attempt after the ./deploy
script, which is what I've been using to deploy things.
Not sure why I would prefer this over the env var approach. We can probably delete this file, since the regular bash version is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Also, * Removes logs from revision. * Requires capistrano git plugin and install it, per advice of deprecation notice. * Add usage comment for `bundle exec cap aws revision` for fetching currently deployed revision. Closes #84.
Docker
Added dockerfile, based on
ruby:3.1
bundle Install
CMD
:bundle exec cap aws deploy
./deploy
Docker based shortcut script
Usage
./deploy COMMAND [ARGS]
Requires local vars to be exported in the current session, e.g:
export BRANCH=42-fixes-all-bugs
Also requires the
SSH_KEY
to be available somewhere within$PWD
, so it can be mounted into the container.Commands
build
Build the docker image
deploy
Run the deployer
ENV_VARS
to docker for:BRANCH
APP_NAME
REPO_URL
SSH_HOST
SSH_KEY
ENV_VARS
can be overwritten on the command line:BRANCH=my-fancy-branch ./deploy deploy
Other usage
Enter the deployer into a bash session:
./deploy deploy bash