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

Bump flyway #30

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
global:
- CGO_ENABLED=0
- GO111MODULE=on
- FLYWAY_VERSION=9.19.4
- FLYWAY_VERSION=10.10.0
- PG_PORT=5439
gobuild_args: -a -tags netgo -ldflags '-w'
go_import_path: github.com/adevinta/vulcan-tracker
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ FROM alpine:3.17.0

WORKDIR /flyway

RUN apk add --no-cache --update openjdk8-jre-base bash gettext libc6-compat
RUN apk add --no-cache --update openjdk17-jre bash gettext libc6-compat

ARG FLYWAY_VERSION=9.19.4
ARG FLYWAY_VERSION=10.10.0

RUN wget https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}.tar.gz \
RUN wget -q https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}.tar.gz \
&& tar -xzf flyway-commandline-${FLYWAY_VERSION}.tar.gz --strip 1 \
&& rm flyway-commandline-${FLYWAY_VERSION}.tar.gz \
&& find ./drivers/ -type f -not -name 'postgres*' -delete \
&& find ./drivers/ -type f | grep -Ev '(postgres|jackson)' | xargs rm \
&& chown -R root:root . \
&& ln -s /flyway/flyway /bin/flyway

Expand Down
2 changes: 1 addition & 1 deletion db/flyway-clean-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Copyright 2023 Adevinta

docker run --net=host flyway/flyway:"${FLYWAY_VERSION:-9.19.4}-alpine" -community \
docker run --net=host flyway/flyway:"${FLYWAY_VERSION:-9.19.4}-alpine" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the old version continue to be used as fallback?

-user=vultrackerdb -password=vultrackerdb -url=jdbc:postgresql://localhost:5439/vultrackerdb -baselineOnMigrate=true -cleanDisabled=false clean
2 changes: 1 addition & 1 deletion db/flyway-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ docker exec vultrackerdb psql -c "ALTER USER vultrackerdb_test WITH SUPERUSER;"
docker exec vultrackerdb psql -c "CREATE DATABASE vultrackerdb_test;" -U vultrackerdb


docker run --net=host --rm -v "$PWD"/sql:/flyway/sql flyway/flyway:"${FLYWAY_VERSION:-9.19.4}-alpine" -community \
docker run --net=host --rm -v "$PWD"/sql:/flyway/sql flyway/flyway:"${FLYWAY_VERSION:-9.19.4}-alpine" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

-user=vultrackerdb -password=vultrackerdb -url=jdbc:postgresql://localhost:5439/vultrackerdb -baselineOnMigrate=true migrate
4 changes: 3 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Copyright 2022 Adevinta

set -e

# Apply env variables
envsubst < config.toml > run.toml

Expand All @@ -13,6 +15,6 @@ fi

flyway -user="$PG_USER" -password="$PG_PASSWORD" \
-url="jdbc:postgresql://$PG_HOST:$PG_PORT/$PG_NAME?sslmode=$PG_SSLMODE" \
-community -baselineOnMigrate=true -locations=filesystem:/app/sql migrate
-baselineOnMigrate=true -locations=filesystem:/app/sql migrate

exec ./vulcan-tracker -c run.toml