File tree 5 files changed +16
-5
lines changed
5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 31
31
push : true
32
32
tags : |
33
33
0xchloe/spotiplex:${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
34
-
34
+ build-args : |
35
+ COMMIT_SHA=${{ github.sha }}
Original file line number Diff line number Diff line change @@ -6,13 +6,19 @@ ENV POETRY_VERSION=1.7.1
6
6
ENV PYTHONUNBUFFERED=1
7
7
ENV CRON_SCHEDULE=@daily
8
8
ENV DOCKER=True
9
+
10
+ # Accept commit SHA as a build argument
11
+ ARG COMMIT_SHA
12
+ ENV COMMIT_SHA=${COMMIT_SHA}
13
+
9
14
# Install Poetry
10
15
RUN pip install "poetry==$POETRY_VERSION"
11
16
12
17
# Copy the application source code
13
18
COPY ./spotiplex ${SRC_DIR}/spotiplex
14
19
COPY pyproject.toml poetry.lock ${SRC_DIR}/
15
20
COPY README.md ${SRC_DIR}/
21
+
16
22
# Set the working directory
17
23
WORKDIR ${SRC_DIR}
18
24
@@ -24,11 +30,11 @@ RUN poetry config virtualenvs.create false \
24
30
RUN wget -O /usr/local/bin/supercronic https://github.com/aptible/supercronic/releases/download/v0.1.11/supercronic-linux-amd64 \
25
31
&& chmod +x /usr/local/bin/supercronic
26
32
27
-
28
33
# Copy entrypoint script
29
34
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
30
35
RUN chmod +x /usr/local/bin/entrypoint.sh
31
36
32
- ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
33
-
37
+ # Log the commit SHA during the build
38
+ RUN echo "Built from commit SHA: $COMMIT_SHA"
34
39
40
+ ENTRYPOINT ["/usr/local/bin/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " spotiplex"
3
- version = " 0.1 .0"
3
+ version = " 1.0 .0"
4
4
description = " "
5
5
authors = [
" 0xChloe <[email protected] >" ]
6
6
license = " GPLv3"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class Config:
13
13
"""Generic Config class to pull environment vars."""
14
14
15
15
if os .environ .get ("DOCKER" ):
16
+ SPOTIPLEX_VERSION = os .environ .get ("COMMIT_SHA" )
16
17
SPOTIFY_API_KEY = os .environ .get ("SPOTIFY_API_KEY" )
17
18
SPOTIFY_API_ID = os .environ .get ("SPOTIFY_API_ID" )
18
19
Original file line number Diff line number Diff line change 7
7
8
8
import spotiplex .modules .confighandler .main as config_handler
9
9
import spotiplex .modules .spotiplex .main as sp_module
10
+ from spotiplex .config import Config
10
11
11
12
logger .trace ("Initializing logger..." )
12
13
logger .remove ()
20
21
@app .command ()
21
22
def sync_lidarr_imports () -> None :
22
23
"""Syncs all playlists currently being pulled via Lidarr."""
24
+ logger .debug ("We are running on commit: " , Config .SPOTIPLEX_VERSION )
23
25
sp_instance = sp_module .Spotiplex (lidarr = True , playlist_id = None )
24
26
sp_instance .run ()
25
27
@@ -34,6 +36,7 @@ def generate_env() -> None:
34
36
@app .command ()
35
37
def sync_manual_lists () -> None :
36
38
"""Syncs all playlists specified in config file."""
39
+ logger .debug ("We are running on commit: " , Config .SPOTIPLEX_VERSION )
37
40
sp_instance = sp_module .Spotiplex (lidarr = False , playlist_id = None )
38
41
sp_instance .run ()
39
42
You can’t perform that action at this time.
0 commit comments