This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline Docker Build Updates (#73)
- Loading branch information
Oscar Kevin
authored
Jun 22, 2022
1 parent
70b1e86
commit e4cd5ec
Showing
10 changed files
with
82 additions
and
9 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
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
File renamed without changes.
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,12 @@ | ||
#!/bin/bash | ||
|
||
# Copy Secret Credentials to Mounted Volume | ||
echo "Attempting to copy secret credentials..." | ||
cp secrets.py assets/ | ||
echo "Successfully copied secret credentials!" | ||
|
||
# Run Latest Docker Images | ||
echo "Attempting to update Docker images..." | ||
docker-compose down | ||
docker-compose up -d | ||
echo "Successfully updated Docker images!" |
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,5 +1,5 @@ | ||
# Select Docker image | ||
FROM python:3.8-slim | ||
FROM python:3.8-slim-buster | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
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,5 +1,5 @@ | ||
# Select Docker image | ||
FROM python:3.8-slim | ||
FROM python:3.8-slim-buster | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
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,49 @@ | ||
# Set Docker Image Version | ||
export DOCKER_VERSION=1.59 | ||
|
||
# Build, Deploy, and Tear Down Docker Containers | ||
echo "Attempting to build Docker containers..." | ||
docker build -t feh-gauntlet-bot_convoy ./convoy/ | ||
docker build -t feh-gauntlet-bot_genny ./discord/genny/ | ||
docker build -t feh-gauntlet-bot_rebecca ./discord/rebecca/ | ||
|
||
echo "----------Success!!!----------" | ||
|
||
# Log Into Docker | ||
echo "Attempting to log into Docker..." | ||
docker login | ||
echo "----------Success!!!----------" | ||
|
||
# Upload Latest Convoy Image | ||
echo "Attempting to upload latest Convoy images..." | ||
docker tag feh-gauntlet-bot_convoy atemosta/feh-gauntlet-bot:convoy-${DOCKER_VERSION} | ||
docker push atemosta/feh-gauntlet-bot:convoy-${DOCKER_VERSION} | ||
docker tag feh-gauntlet-bot_convoy atemosta/feh-gauntlet-bot:convoy-latest | ||
docker push atemosta/feh-gauntlet-bot:convoy-latest | ||
echo "----------Success!!!----------" | ||
|
||
# Upload Latest Genny Image | ||
echo "Attempting to upload latest Genny images..." | ||
docker tag feh-gauntlet-bot_genny atemosta/feh-gauntlet-bot:genny-${DOCKER_VERSION} | ||
docker push atemosta/feh-gauntlet-bot:genny-${DOCKER_VERSION} | ||
docker tag feh-gauntlet-bot_genny atemosta/feh-gauntlet-bot:genny-latest | ||
docker push atemosta/feh-gauntlet-bot:genny-latest | ||
echo "----------Success!!!----------" | ||
|
||
# Upload Latest Rebecca Image | ||
echo "Attempting to upload latest Rebecca images..." | ||
docker tag feh-gauntlet-bot_rebecca atemosta/feh-gauntlet-bot:rebecca-${DOCKER_VERSION} | ||
docker push atemosta/feh-gauntlet-bot:rebecca-${DOCKER_VERSION} | ||
docker tag feh-gauntlet-bot_rebecca atemosta/feh-gauntlet-bot:rebecca-latest | ||
docker push atemosta/feh-gauntlet-bot:rebecca-latest | ||
echo "----------Success!!!----------" | ||
|
||
|
||
# Clear Docker Containers and Images | ||
echo "Clearing old docker images..." | ||
docker stop $(docker ps -a -q) | ||
docker rm $(docker ps -a -q) | ||
export IMAGE_PATTERN=feh-gauntlet-bot | ||
docker images -a | grep ${IMAGE_PATTERN} | ||
docker images -a | grep ${IMAGE_PATTERN} | awk '{print $3}' | xargs docker rmi -f | ||
echo "----------Success!!!----------" |