Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf23d480

Browse files
authored
ci: fix test-migrations target when main branch is not present locally (#13306)
1 parentf66d044 commitf23d480

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,11 @@ test-postgres: test-postgres-docker
797797
test-migrations: test-postgres-docker
798798
echo"--- test migrations"
799799
set -euo pipefail
800-
COMMIT_FROM=$(shell git rev-parse --short HEAD)
801-
COMMIT_TO=$(shell git rev-parse --short main)
800+
COMMIT_FROM=$(shell git log -1 --format='%h' HEAD)
801+
echo"COMMIT_FROM=$${COMMIT_FROM}"
802+
COMMIT_TO=$(shell git log -1 --format='%h' origin/main)
803+
echo"COMMIT_TO=$${COMMIT_TO}"
804+
if [["$${COMMIT_FROM}"=="$${COMMIT_TO}" ]];thenecho"Nothing to do!";exit 0;fi
802805
echo"DROP DATABASE IF EXISTS migrate_test_$${COMMIT_FROM}; CREATE DATABASE migrate_test_$${COMMIT_FROM};"| psql'postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable'
803806
go run ./scripts/migrate-test/main.go --from="$$COMMIT_FROM" --to="$$COMMIT_TO" --postgres-url="postgresql://postgres:postgres@localhost:5432/migrate_test_$${COMMIT_FROM}?sslmode=disable"
804807

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp