Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #157

Merged
merged 4 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,6 @@ jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- "1433:1433"
env:
ACCEPT_EULA: Y
SA_PASSWORD: ${{ secrets.SQL_SA_PASSWORD }}
MSSQL_PID: Express

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Execute init.sql
run: |
sqlcmd -S localhost -U sa -P ${{ secrets.SQL_SA_PASSWORD }} -i db/init.sql

- name: Run Unit Tests
run: mvn test

- name: Run Integration Tests
run: mvn verify

build:
name: Build
needs: run-tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand Down
21 changes: 10 additions & 11 deletions db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Dùng official SQL Server 2019 image của Microsoft
FROM mcr.microsoft.com/mssql/server:2019-latest
# Use the official MySQL image
FROM mysql:8.2.0

# Copy the SQL script vào container
COPY init.sql /usr/src/app/init.sql
# Set environment variables for MySQL
ENV MYSQL_ALLOW_EMPTY_PASSWORD yes
ENV MYSQL_DATABASE=DB_AUCTION
ENV MYSQL_COLLATION=utf8mb4_general_ci

# Chạy lệnh trong file sql
RUN /opt/mssql/bin/sqlservr & sleep 30 \
&& /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Thanhth@nh1 -i /usr/src/app/init.sql \
&& pkill sqlservr
# Copy the SQL script into the container
COPY init.sql /docker-entrypoint-initdb.d/init.sql

EXPOSE 1433
# Khởi động sql server
CMD ["/opt/mssql/bin/sqlservr"]
# Expose MySQL port
EXPOSE 3306
Loading
Loading