도커허브 업로드 자동화 구현

This commit is contained in:
2025-02-02 07:51:52 +09:00
parent 2935a844a0
commit 46c59d40de
6 changed files with 17 additions and 7 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@ Temp/
Music Music
*.json *.json
yt-dlp yt-dlp
ffmpeg ffmpeg
password

4
BuildDockerAndUpload.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
cat password | docker login -u happytanuki12 --password-stdin
docker build --tag happytanuki12/bumblebee:latest .
docker push happytanuki12/bumblebee:latest

View File

@@ -19,10 +19,10 @@ RUN pip3 install --break-system-packages pycryptodome
RUN curl -Lo dpp.deb https://dl.dpp.dev/ RUN curl -Lo dpp.deb https://dl.dpp.dev/
RUN dpkg -i dpp.deb RUN dpkg -i dpp.deb
RUN rm dpp.deb RUN rm dpp.deb
RUN curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz # RUN curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz
RUN tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz # RUN tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz
RUN rm ffmpeg-master-latest-linux64-gpl.tar.xz # RUN rm ffmpeg-master-latest-linux64-gpl.tar.xz
RUN mv ffmpeg-master-latest-linux64-gpl ffmpeg # RUN mv ffmpeg-master-latest-linux64-gpl ffmpeg
RUN curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp RUN curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
RUN chmod +x ./yt-dlp RUN chmod +x ./yt-dlp
COPY ./build/BumbleCee /BumbleCee COPY ./build/BumbleCee /BumbleCee

View File

@@ -1,6 +1,6 @@
services: services:
bumblebee: bumblebee:
build: . image: happytanuki12/bumblebee:latest
container_name: BumbleBee container_name: BumbleBee
volumes: volumes:
- ./config.json:/config.json - ./config.json:/config.json

View File

@@ -81,6 +81,8 @@ std::list<MusicQueueElement> MusicPlayManager::getQueue(const dpp::snowflake gui
MusicQueueElement MusicPlayManager::getNowPlaying(const dpp::snowflake guildId) { MusicQueueElement MusicPlayManager::getNowPlaying(const dpp::snowflake guildId) {
std::shared_ptr<MusicQueueElement> nowplaying = queueMap[guildId]->nowplaying(); std::shared_ptr<MusicQueueElement> nowplaying = queueMap[guildId]->nowplaying();
if (nowplaying == nullptr)
return MusicQueueElement("", "", dpp::user(), dpp::embed());
MusicQueueElement returnValue(*nowplaying); MusicQueueElement returnValue(*nowplaying);
return returnValue; return returnValue;
} }

View File

@@ -36,7 +36,10 @@ std::list<std::shared_ptr<MusicQueueElement>>::iterator MusicQueue::findByIndex(
} }
std::shared_ptr<MusicQueueElement> MusicQueue::nowplaying() { std::shared_ptr<MusicQueueElement> MusicQueue::nowplaying() {
std::lock_guard<std::mutex> lock(queueMutex); std::lock_guard<std::mutex> lock(queueMutex);
return *currentPlayingPosition; if (currentPlayingPosition == queue.end())
return nullptr;
else
return *currentPlayingPosition;
} }
std::list<std::shared_ptr<MusicQueueElement>>::iterator MusicQueue::next_music() { std::list<std::shared_ptr<MusicQueueElement>>::iterator MusicQueue::next_music() {
std::lock_guard<std::mutex> lock(queueMutex); std::lock_guard<std::mutex> lock(queueMutex);