Skip to content

Commit

Permalink
Upgrade Flyway and fix Dockerfile. (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcipriano authored Mar 30, 2022
1 parent 027d853 commit 75c7639
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sandbox/flyway.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
FROM centos

ARG FLYWAY_VERSION=8.5.4

# Get flyway
RUN ["curl", "-O", "https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/6.0.0/flyway-commandline-6.0.0-linux-x64.tar.gz"]
RUN ["yum", "install", "-y", "tar", "java-1.8.0-openjdk", "postgresql-jdbc", "nc", "postgresql"]
RUN ["tar", "-xzf", "flyway-commandline-6.0.0-linux-x64.tar.gz"]
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum install -y tar java-1.8.0-openjdk postgresql-jdbc nc postgresql
RUN curl -O https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}-linux-x64.tar.gz
RUN tar -xzf flyway-commandline-${FLYWAY_VERSION}-linux-x64.tar.gz

WORKDIR flyway-6.0.0
WORKDIR flyway-${FLYWAY_VERSION}

# Copy the postgres driver to its required location
RUN ["cp", "/usr/share/java/postgresql-jdbc.jar", "jars/"]
RUN ["mkdir", "/opt/migrations"]
RUN ["mkdir", "/opt/scripts"]
RUN cp /usr/share/java/postgresql-jdbc.jar jars/
RUN mkdir /opt/migrations
RUN mkdir /opt/scripts
COPY ./cuebot/src/main/resources/conf/ddl/postgres/migrations /opt/migrations
COPY ./cuebot/src/main/resources/conf/ddl/postgres/seed_data.sql /opt/scripts
COPY ./sandbox/migrate.sh /opt/scripts/
Expand Down

0 comments on commit 75c7639

Please sign in to comment.