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

Preview environments for maintainers #206

Open
Xerkus opened this issue Sep 7, 2024 · 1 comment
Open

Preview environments for maintainers #206

Xerkus opened this issue Sep 7, 2024 · 1 comment
Assignees

Comments

@Xerkus
Copy link
Member

Xerkus commented Sep 7, 2024

Platform.sh provides a few development environments. It's GitHub integration can automatically create active development environments for Pull Requests, however it is not suitable for us for various reasons.

Instead we resort to a few static preview branches accessible at following URLs:

staging branch is a default branch and a preview environment that does not allow force pushes. All changes must go there.
master branch is a live site and it must only be pushed from staging branch and by Laminas people who have access to the platform.sh console.

preview-1 and preview-2 branches allow force pushes. Pull Requests should be force pushed to one of them if preview in a deployment environment is needed. GitHub cli tool is recommended for the convenient use of preview branches.

Quick setup instructions

Setup repository

Clone the repository:

gh repo clone laminas/getlaminas.org && cd getlaminas.org

Remote origin initially is pointing to laminas/getlaminas.org. It will change.

Tell gh to set laminas/getlaminas.org as a default repository for commands like gh pr list:

gh repo set-default

Now use gh to fork repository to your account and to update remotes: origin will be pointing to your fork while the existing origin pointing to laminas/getlaminas.org will be renamed to upstream :

gh repo fork --remote

Repository is now ready.

Push a PR to preview branch

Find a PR number or use gh to list opened PRs from the terminal:

gh pr list

Checkout the PR and push it to a preview branch:

gh pr checkout <pr number>
git push upstream --force HEAD:preview-1
or 
git push upstream --force HEAD:preview-2

Once platform synchronized the branch and finished the deployment it can be checked using the corresponding URL from above.
This is a manual process. Repeat each time PR updates need to be checked in a preview environment.

Note that deployment status, build and runtime logs can only be checked by a Laminas member with access to platform.sh.

@Xerkus Xerkus self-assigned this Sep 7, 2024
@Xerkus Xerkus pinned this issue Sep 7, 2024
@arhimede
Copy link
Member

arhimede commented Sep 8, 2024

So yeah, you noticed the issue when there are several PR's open and each one need feedback on a preview URL

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

No branches or pull requests

2 participants