Skip to content

Commit 8ba5bd3

Browse files
authored
Merge pull request #37 from The-Debarghya/fix-minors
fix formatting checks with minor argument changes in dockerfiles
2 parents 81d46ec + 6be4f4c commit 8ba5bd3

File tree

15 files changed

+61
-21
lines changed

15 files changed

+61
-21
lines changed

.github/workflows/go-lint-build.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,54 @@ permissions:
1212
pull-requests: read
1313

1414
jobs:
15+
gofmt-unix:
16+
strategy:
17+
matrix:
18+
go: ["1.20"]
19+
os: [macos-latest, ubuntu-latest]
20+
name: gofmt
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-go@v4
25+
with:
26+
go-version: ${{ matrix.go }}
27+
cache: true
28+
- name: Run format checks
29+
run: |
30+
if [ $(gofmt -d -l -e . | wc -l) -eq 0 ]; then
31+
printf 'Format Checks Have Passed!!!'
32+
else
33+
printf 'Format Checks Have Failed!\nPlease use gofmt in your system to format your code.'
34+
gofmt -l -e -d .
35+
exit 1
36+
fi
37+
gofmt-windows:
38+
strategy:
39+
matrix:
40+
go: ["1.20"]
41+
os: [windows-latest]
42+
name: gofmt
43+
runs-on: ${{ matrix.os }}
44+
steps:
45+
- uses: actions/checkout@v3
46+
- uses: actions/setup-go@v4
47+
with:
48+
go-version: ${{ matrix.go }}
49+
cache: true
50+
- name: Run format checks
51+
run: |
52+
if ((gofmt -d -l -e . | Measure-Object -Line).Lines -eq 0) {
53+
Write-Host 'Format Checks Have Passed!!!'
54+
} else {
55+
Write-Host 'Format Checks Have Failed!'
56+
gofmt -l -e -d .
57+
exit 1
58+
}
1559
golangci:
1660
strategy:
1761
matrix:
18-
go: ['1.20']
62+
go: ["1.20"]
1963
os: [macos-latest, windows-latest, ubuntu-latest]
2064
name: lint
2165
runs-on: ${{ matrix.os }}
@@ -44,6 +88,3 @@ jobs:
4488

4589
- name: Run staticcheck
4690
run: staticcheck ./...
47-
48-
- name: Run format checks
49-
run: gofmt -l -d -e .

docker_config_generator/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ func SanitizeFileName(fileName string) string {
145145
// You can add more sanitization rules as needed
146146

147147
return fileName
148-
}
148+
}

docker_config_generator/templates/fastapi-pip.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
2626
ENV PYTHONUNBUFFERED=1
2727

2828
# -- args
29-
ARG PORT=80
29+
ARG PORT="80"
3030
ARG START_COMMAND="python -m uvicorn main:app --host=0.0.0.0"
3131
ARG PEX_WRAPPER="pex_wrapper"
3232

docker_config_generator/templates/fastapi-poetry.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN python3 -m venv $POETRY_VENV \
2020
# Create a new stage from the base python image
2121
FROM python-base as final
2222

23-
ARG PORT=80
23+
ARG PORT="80"
2424
ARG START_COMMAND="poetry run python -m uvicorn main:app --host=0.0.0.0"
2525
# Copy Poetry to app image
2626
COPY --from=poetry-base ${POETRY_VENV} ${POETRY_VENV}

docker_config_generator/templates/flask-pip.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
2525
ENV PYTHONUNBUFFERED=1
2626

2727
# -- args
28-
ARG PORT=80
28+
ARG PORT="80"
2929
ARG START_COMMAND="python -m flask --app main run --host=0.0.0.0"
3030
ARG PEX_WRAPPER="pex_wrapper"
3131

docker_config_generator/templates/flask-poetry.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN python3 -m venv $POETRY_VENV \
2020
# Create a new stage from the base python image
2121
FROM python-base as final
2222

23-
ARG PORT=80
23+
ARG PORT="80"
2424
ARG START_COMMAND="poetry run flask --app main run --host=0.0.0.0"
2525
# Copy Poetry to app image
2626
COPY --from=poetry-base ${POETRY_VENV} ${POETRY_VENV}

docker_config_generator/templates/nextjs.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN ${BUILD_COMMAND} && npm prune --production
3232
FROM node:18.11-slim AS runner
3333

3434
# Build args
35-
ARG PORT=80
35+
ARG PORT="80"
3636

3737
WORKDIR /app
3838
ENV NODE_ENV production

docker_config_generator/templates/nodejs.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN \
1313
# Production image, copy all the files and run
1414
FROM node:lts-slim AS runner
1515

16-
ARG PORT=80
16+
ARG PORT="80"
1717
ARG START_COMMAND="npm run start"
1818

1919
WORKDIR /app

docker_config_generator/templates/streamlit-pip.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
2626
ENV PYTHONUNBUFFERED=1
2727

2828
# -- args
29-
ARG PORT=80
29+
ARG PORT="80"
3030
ARG START_COMMAND="streamlit run main.py --server.port $PORT"
3131
ARG PEX_WRAPPER="pex_wrapper"
3232

docker_config_generator/templates/streamlit-poetry.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
2020
# The runtime image, used to just run the code provided its virtual environment
2121
FROM python:3.11-slim-buster as runner
2222

23-
ARG PORT=80
23+
ARG PORT="80"
2424
ARG START_COMMAND="poetry run streamlit run main.py --server.port ${PORT}"
2525
ENV VIRTUAL_ENV=/app/.venv \
2626
PATH="/app/.venv/bin:$PATH"

0 commit comments

Comments
 (0)