-
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
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,4 @@ | |||
# For more options, see http://capistranorb.com/documentation/getting-started/configuration/# | |||
# config valid only for current version of Capistrano | |||
lock '3.3.5' |
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.
was this getting in the way? Seems like removing it opens up a new risk of incompatibility between the Capistrano version and our config
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.
This was added with e75758b
Upgrades to ruby3.2, capistrano 3.18
Seems to be working fine with the upgraded capistrano version, so I'm fine continuing with the latest for now, until it becomes a problem, when we can lock it.
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.
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