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

Automate the correction of website #298

Merged
merged 9 commits into from
Jan 17, 2021
Merged

Automate the correction of website #298

merged 9 commits into from
Jan 17, 2021

Conversation

ibuibu
Copy link
Contributor

@ibuibu ibuibu commented Jan 14, 2021

Please check the type of change your PR introduces

  • Other (please describe):

Summary

  • Automate the correction of website version information.
  • Check the version of the example and readme at release time.

Supplement

The SSH Key is set in the project of circleCI.

Check point

  • Check merge target branch
  • ( For SkyWay team ) This is public repository Please Check AGAIN before publish

@ibuibu ibuibu requested review from a team, riosu and d-matsui and removed request for a team January 14, 2021 07:19
@@ -34,3 +54,62 @@ async function hasChangeLog(version) {
rl.once('close', () => resolve(false));
});
}

async function checkExampleSdkVersion(version, file) {
Copy link
Contributor

Choose a reason for hiding this comment

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

To use this function in isCorrectReadmeVersion, We can change this function as follows:

function isSdkVersionURLCorrect(version, filepath) {
    const data = fs.readFileSync(filepath, "utf8");
    const matches =  data.matchAll(/cdn\.webrtc\.ecl\.ntt\.com\/skyway-([0-9]+\.[0-9]+\.[0-9]+)(\.min)?\.js/g);
    for (const match of matches) {
        if (match[1] !== version) {
            return false;
        }
    }
    return true;    
}

isSdkVersionURLCorrect("4.2.0", "README.md");

echo "Website is up to date. Skip updating website."
exit 0
fi
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/documents/javascript-sdk.md
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to narrow down the scope of regular expressions a bit.

exit 0
fi
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/documents/javascript-sdk.md
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/en/documents/javascript-sdk.md
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, when there are two digits, as in 1.4.41, they are not replaced.

@ibuibu ibuibu requested a review from riosu January 15, 2021 05:57
@d-matsui d-matsui merged commit 3889570 into staging Jan 17, 2021
@d-matsui d-matsui deleted the ops/auto-update-web branch January 17, 2021 23:37
@d-matsui d-matsui mentioned this pull request Jan 19, 2021
4 tasks
This was referenced Jan 25, 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.

4 participants