mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 19:33:10 +00:00
cicd: get pr number earlier
This commit is contained in:
parent
bd6b4c82c5
commit
4d098942d3
1 changed files with 2 additions and 1 deletions
|
@ -168,6 +168,7 @@ run_updater() {
|
||||||
cd "$data_repo/updater" || cleanexit 'fail' "Failed to cd"
|
cd "$data_repo/updater" || cleanexit 'fail' "Failed to cd"
|
||||||
# Wait to be sure PokeAPI/pokeapi's master branch has been updated on Github with the lastest merged PR content
|
# Wait to be sure PokeAPI/pokeapi's master branch has been updated on Github with the lastest merged PR content
|
||||||
sleep 10
|
sleep 10
|
||||||
|
engine_repo_pr_number=$(get_invokator_pr_number)
|
||||||
|
|
||||||
# Build the updater image
|
# Build the updater image
|
||||||
docker build -t pokeapi-updater .
|
docker build -t pokeapi-updater .
|
||||||
|
@ -177,7 +178,7 @@ run_updater() {
|
||||||
|
|
||||||
# Run the updater
|
# Run the updater
|
||||||
docker network create pokeapi
|
docker network create pokeapi
|
||||||
docker run --privileged --network pokeapi --network-alias docker -e REPO_POKEAPI_CHECKOUT_OBJECT="$CIRCLE_SHA1" -e COMMIT_EMAIL="$email" -e COMMIT_NAME="$username" -e BRANCH_NAME="$branch_name" -e REPO_POKEAPI="https://github.com/$org/$engine_repo.git" -e REPO_DATA="https://$MACHINE_USER_GITHUB_API_TOKEN@github.com/$org/$data_repo.git" -e COMMIT_MESSAGE="[Updater Bot] Regenerate data from https://github.com/$org/$engine_repo/pull/$(get_invokator_pr_number)" -e COMMIT_AND_PUSH='true' -e RUN_AS='root' pokeapi-updater
|
docker run --privileged --network pokeapi --network-alias docker -e REPO_POKEAPI_CHECKOUT_OBJECT="$CIRCLE_SHA1" -e COMMIT_EMAIL="$email" -e COMMIT_NAME="$username" -e BRANCH_NAME="$branch_name" -e REPO_POKEAPI="https://github.com/$org/$engine_repo.git" -e REPO_DATA="https://$MACHINE_USER_GITHUB_API_TOKEN@github.com/$org/$data_repo.git" -e COMMIT_MESSAGE="[Updater Bot] Regenerate data from https://github.com/$org/$engine_repo/pull/$engine_repo_pr_number" -e COMMIT_AND_PUSH='true' -e RUN_AS='root' pokeapi-updater
|
||||||
return_code=$?
|
return_code=$?
|
||||||
if [ "$return_code" -eq 2 ]; then
|
if [ "$return_code" -eq 2 ]; then
|
||||||
cleanexit 'no-new-data' "Generated data is the same as old data, skipping deploy"
|
cleanexit 'no-new-data' "Generated data is the same as old data, skipping deploy"
|
||||||
|
|
Loading…
Reference in a new issue