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

Fix rsync #13

Closed
wants to merge 9 commits into from
Closed

Fix rsync #13

wants to merge 9 commits into from

Conversation

heiglandreas
Copy link
Contributor

This PR should fix that after moving to git the documentation on php.net is still built from SVN.

All references of SVN checkouts have been replaced by the appropriate GIT commands. Additionally it should not be necessary to create the git repositories on the selected boxes by hand when a new language will be added to the $ACTIVE_ONLINE_LANGUAGES array in include/languages.inc – as long as the appropriate repo already exists on git.php.net

Copy link
Contributor

@salathe salathe left a comment

Choose a reason for hiding this comment

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

The rsync.php.net/build-*.sh scripts are ancient and unused. Suggest just deleting them to avoid confusion.

The update-docs-sources script is only used on euk2, so shouldn't be part of this PR.

build-docs-rsync Outdated Show resolved Hide resolved
build-docs-rsync Outdated Show resolved Hide resolved
build-docs-rsync Outdated Show resolved Hide resolved
build-docs-rsync Outdated Show resolved Hide resolved
@heiglandreas heiglandreas force-pushed the fixRsync branch 2 times, most recently from 696b724 to 1ebb365 Compare January 3, 2021 13:18
This removes some outdated commands that are by now obsolete as well as
moving a part of the script ionto a function to make it more readable
git clone https://git.php.net/repository/doc/$2.git $BASE_DIR/$1
fi
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The old svn up output used to get logged to /tmp/log-svn. No logging happens for these git commands; I suggest logging the output somewhere (e.g. /tmp/log-git).

build-docs-rsync Outdated Show resolved Hide resolved
Copy link
Contributor

@salathe salathe left a comment

Choose a reason for hiding this comment

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

It looks like this PR is missing corresponding changes to build-docs-lang-rsync.

build-docs-rsync Outdated
# All translations depend on english being up2date
assertUpToDateRepo en en

cd /home/docbuilder/phpdoc-git
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong directory, should be cd $BASE_DIR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦

build-docs-rsync Outdated
if [ ! -d $BASE_DIR/$1 ]; then
git clone https://git.php.net/repository/doc/$2.git $BASE_DIR/$1
fi
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git 2>&1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git 2>&1
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master >> /tmp/log-git 2>&1

To avoid emptying the log for each assertUpToDateRepo call? Though then we probably should also explicitly clear the log at the start of the script...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I was thinking of using logger to append the messages to the system log and also make use of log turnover etc. but refrained from it to make it as close to the previous version as possible but didn't take into account that it will clear the log every time it runs...

Copy link
Contributor

Choose a reason for hiding this comment

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

For what it's worth, clearing the log on each run was the old behaviour so you're not doing anything worse here.

That way the output of the git reset command will be output into one
file per repo instead of only containing the output of the last
assertion. And it avoids a cleanup at the begining of the script.

An alternative would be using `logger` instead but that would then
preserve the output completely and lead to an increased size of the
syslog. Not sure that makes sense.
@php-pulls php-pulls closed this in 6643326 Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants