-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 docker image and deploy script (#84)
* Working dockerfile for environment * Ignore keys * Basic CLI for deployments * Pass envs with -e ENV format * Add help text for deploy script * Adds CD auto building action
- Loading branch information
Showing
8 changed files
with
92 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 🪂 Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
release: | ||
types: [published, edited, prereleased] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: 🔨 Build and deploy docker image | ||
uses: WGBH-MLA/.github/.github/workflows/build.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.capistrano | ||
stuff | ||
.DS_Store | ||
.DS_Store | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ruby:3.1 | ||
WORKDIR /root | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
|
||
RUN bundle install | ||
|
||
CMD bundle exec cap aws deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
HELP="deploy script for AAPB and OpenVault3 \n\n | ||
USAGE \n | ||
./deploy COMMAND [ARGS] \n\n | ||
COMMANDS \n | ||
b | build \t\t Build the deployer image \n | ||
deploy \t\t Run the deployer with environment vars passed in \n | ||
h | help \t\t Show this message \n\n | ||
Requires a local SSH_KEY. \n | ||
All environment variables must be exported in the current session, \n | ||
or passed in on the command line." | ||
|
||
IMAGE_NAME=aapb-deploy | ||
|
||
VOLUME_MOUNT="-v `pwd`:/root/" | ||
DOCKER_ARGS="docker run -it $VOLUME_MOUNT" | ||
|
||
|
||
if [ $1 = "build" -o $1 = "b" ]; then | ||
shift | ||
# build the docker image | ||
docker build -t $IMAGE_NAME . "$@" | ||
|
||
elif [ $1 = "deploy" ]; then | ||
shift | ||
# deploy AAPB or OpenVault | ||
$DOCKER_ARGS \ | ||
-e BRANCH \ | ||
-e APP_NAME \ | ||
-e REPO_URL \ | ||
-e SSH_HOST \ | ||
-e SSH_KEY \ | ||
$IMAGE_NAME "$@" | ||
|
||
else | ||
echo "command not recognized: $@" | ||
echo -e $HELP | ||
fi |