Skip to content
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

Merged
merged 11 commits into from
Dec 3, 2024
Merged

🐳 docker image and deploy script #84

merged 11 commits into from
Dec 3, 2024

Conversation

mrharpo
Copy link
Contributor

@mrharpo mrharpo commented Dec 20, 2022

Docker

Added dockerfile, based on ruby:3.1

  • Copy Gemfile and Gemfile.lock
  • Run 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

  • Passes local ENV_VARS to docker for:
    • BRANCH
    • APP_NAME
    • REPO_URL
    • SSH_HOST
    • SSH_KEY
  • exported 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

@mrharpo mrharpo added the feature request 🧚 New feature request label Dec 20, 2022
@mrharpo mrharpo self-assigned this Dec 20, 2022
config/deploy.rb Show resolved Hide resolved
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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

@afred afred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

config/deploy.rb Show resolved Hide resolved
@afred afred merged commit 8ff0c60 into master Dec 3, 2024
2 checks passed
@afred afred deleted the deploy branch December 3, 2024 15:32
afred added a commit that referenced this pull request Dec 3, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 🧚 New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants