Skip to content

Commit ca26502

Browse files
committed
Refactor dev task in taskfile.yaml to not use air
1 parent 2af091a commit ca26502

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

.air.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dist/
1313

1414
# Temp files/folders
1515
tmp/
16+
.task/
1617

1718
# Binaries for programs and plugins
1819
*.exe

docker/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ENV DEBIAN_FRONTEND=noninteractive
2121
RUN apt-get update && \
2222
apt-get install -y \
2323
wget=1.21.4-1ubuntu4.1 unzip=6.0-28ubuntu4 git=1:2.43.0-1ubuntu7.1 \
24-
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 && \
24+
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 \
25+
lsof=4.95.0-1build3 && \
2526
rm -rf /var/lib/apt/lists/*
2627

2728
# Add PostgreSQL repository and key
@@ -55,12 +56,6 @@ RUN wget --no-verbose https://github.com/cli/cli/releases/download/v2.52.0/gh_2.
5556
mv gh_2.52.0_linux_amd64/bin/gh /usr/local/bin/gh && \
5657
chmod 777 /usr/local/bin/gh
5758

58-
# Install air
59-
RUN wget --no-verbose https://github.com/cosmtrek/air/releases/download/v1.52.3/air_1.52.3_linux_amd64.tar.gz && \
60-
tar -xzf air_1.52.3_linux_amd64.tar.gz && \
61-
mv ./air /usr/local/bin/air && \
62-
chmod 777 /usr/local/bin/air
63-
6459
# Install goose
6560
RUN wget --no-verbose https://github.com/pressly/goose/releases/download/v3.21.1/goose_linux_x86_64 && \
6661
mv ./goose_linux_x86_64 /usr/local/bin/goose && \
@@ -78,6 +73,9 @@ RUN wget --no-verbose https://github.com/golangci/golangci-lint/releases/downloa
7873
mv ./golangci-lint-1.59.1-linux-amd64/golangci-lint /usr/local/bin/golangci-lint && \
7974
chmod 777 /usr/local/bin/golangci-lint
8075

76+
# Install node utilities
77+
RUN npm install --global kill-port
78+
8179
# Go to the app dir, delete the temporary dir and create backups dir
8280
WORKDIR /app
8381
RUN rm -rf /app/temp && \

docker/Dockerfile.cicd

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ENV DEBIAN_FRONTEND=noninteractive
2121
RUN apt-get update && \
2222
apt-get install -y \
2323
wget=1.21.4-1ubuntu4.1 unzip=6.0-28ubuntu4 git=1:2.43.0-1ubuntu7.1 \
24-
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 && \
24+
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 \
25+
lsof=4.95.0-1build3 && \
2526
rm -rf /var/lib/apt/lists/*
2627

2728
# Add PostgreSQL repository and key
@@ -55,12 +56,6 @@ RUN wget --no-verbose https://github.com/cli/cli/releases/download/v2.52.0/gh_2.
5556
mv gh_2.52.0_linux_amd64/bin/gh /usr/local/bin/gh && \
5657
chmod 777 /usr/local/bin/gh
5758

58-
# Install air
59-
RUN wget --no-verbose https://github.com/cosmtrek/air/releases/download/v1.52.3/air_1.52.3_linux_amd64.tar.gz && \
60-
tar -xzf air_1.52.3_linux_amd64.tar.gz && \
61-
mv ./air /usr/local/bin/air && \
62-
chmod 777 /usr/local/bin/air
63-
6459
# Install goose
6560
RUN wget --no-verbose https://github.com/pressly/goose/releases/download/v3.21.1/goose_linux_x86_64 && \
6661
mv ./goose_linux_x86_64 /usr/local/bin/goose && \
@@ -78,6 +73,9 @@ RUN wget --no-verbose https://github.com/golangci/golangci-lint/releases/downloa
7873
mv ./golangci-lint-1.59.1-linux-amd64/golangci-lint /usr/local/bin/golangci-lint && \
7974
chmod 777 /usr/local/bin/golangci-lint
8075

76+
# Install node utilities
77+
RUN npm install --global kill-port
78+
8179
# Go to the app dir, delete the temporary dir and create backups dir
8280
WORKDIR /app
8381
RUN rm -rf /app/temp && \

docker/Dockerfile.dev

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ENV DEBIAN_FRONTEND=noninteractive
2121
RUN apt-get update && \
2222
apt-get install -y \
2323
wget=1.21.4-1ubuntu4.1 unzip=6.0-28ubuntu4 git=1:2.43.0-1ubuntu7.1 \
24-
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 && \
24+
gnupg2=2.4.4-2ubuntu17 lsb-release=12.0-2 tzdata=2024a-2ubuntu1 \
25+
lsof=4.95.0-1build3 && \
2526
rm -rf /var/lib/apt/lists/*
2627

2728
# Add PostgreSQL repository and key
@@ -55,12 +56,6 @@ RUN wget --no-verbose https://github.com/cli/cli/releases/download/v2.52.0/gh_2.
5556
mv gh_2.52.0_linux_amd64/bin/gh /usr/local/bin/gh && \
5657
chmod 777 /usr/local/bin/gh
5758

58-
# Install air
59-
RUN wget --no-verbose https://github.com/cosmtrek/air/releases/download/v1.52.3/air_1.52.3_linux_amd64.tar.gz && \
60-
tar -xzf air_1.52.3_linux_amd64.tar.gz && \
61-
mv ./air /usr/local/bin/air && \
62-
chmod 777 /usr/local/bin/air
63-
6459
# Install goose
6560
RUN wget --no-verbose https://github.com/pressly/goose/releases/download/v3.21.1/goose_linux_x86_64 && \
6661
mv ./goose_linux_x86_64 /usr/local/bin/goose && \
@@ -78,6 +73,9 @@ RUN wget --no-verbose https://github.com/golangci/golangci-lint/releases/downloa
7873
mv ./golangci-lint-1.59.1-linux-amd64/golangci-lint /usr/local/bin/golangci-lint && \
7974
chmod 777 /usr/local/bin/golangci-lint
8075

76+
# Install node utilities
77+
RUN npm install --global kill-port
78+
8179
# Go to the app dir, delete the temporary dir and create backups dir
8280
WORKDIR /app
8381
RUN rm -rf /app/temp && \

taskfile.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version: "3"
22

3+
interval: 500ms
4+
35
dotenv: [".env"]
46

57
tasks:
@@ -12,7 +14,26 @@ tasks:
1214
cmd: docker compose down
1315

1416
dev:
15-
cmd: air -c .air.toml
17+
watch: true
18+
sources:
19+
- "**/*.go"
20+
- "**/*.sql"
21+
- "**/*.js"
22+
- "**/*.css"
23+
- "**/*.json"
24+
- ".env"
25+
- exclude: "tmp/**"
26+
- exclude: "dist/**"
27+
- exclude: "internal/database/dbgen/**"
28+
- exclude: "internal/view/static/css/style.css"
29+
- exclude: "**/*.gen.go"
30+
- exclude: "**/*.sql.go"
31+
- exclude: "**/*_test.go"
32+
- exclude: "**/_generated.go"
33+
cmds:
34+
- kill-port 8085
35+
- task build
36+
- task serve
1637

1738
build:
1839
deps:

0 commit comments

Comments
 (0)