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

DAT-16200



 DevOps :: Support Docker like Liquibase Command Line #268

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
14 changes: 14 additions & 0 deletions .github/test/changelog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
USE master;

-- Create a sample table in the dbo schema
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'SampleTable')
BEGIN
CREATE TABLE dbo.SampleTable (
id INT PRIMARY KEY NOT NULL,
name VARCHAR(255)
-- Add more columns as needed
);

-- Example: Add an index on the 'name' column
-- CREATE INDEX idx_name ON dbo.SampleTable (name);
END;
16 changes: 16 additions & 0 deletions .github/test/liquibase-mssql.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Enter the path for your changelog file.
changeLogFile=changelog.sql

# Enter the URL of the source database
url=jdbc:sqlserver://mssql:1433;database=master;encrypt=false;

# Enter the username for your source database.
username: SA
password: Letmein.8

driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath: /liquibase/changelog/drivers/mssql-jdbc-8.2.2.jre11.jar

#### Target Database Information ####
## The target database is the database you want to use to compare to your source database.
logLevel: ERROR
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN ln -s /liquibase/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh &&
ln -s /liquibase/liquibase /usr/local/bin/liquibase && \
ln -s /liquibase/bin/lpm /usr/local/bin/lpm

WORKDIR /liquibase
WORKDIR /liquibase/changelog
USER liquibase
ENV LIQUIBASE_HOME=/liquibase

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN addgroup --gid 1001 liquibase && \

# Make /liquibase directory and change owner to liquibase
RUN mkdir /liquibase && chown liquibase /liquibase
WORKDIR /liquibase
WORKDIR /liquibase/changelog

# Copy the /liquibase directory from builder stage into final image
COPY --from=builder /liquibase /liquibase
Expand Down