static-shim: update for tpo/web/team#34 and tpo/web/team#35 authored by Jérôme Charaoui's avatar Jérôme Charaoui
...@@ -109,6 +109,11 @@ used. To opt-out of Review Apps, define `SKIP_REVIEW_APPS: 1` in the ...@@ -109,6 +109,11 @@ used. To opt-out of Review Apps, define `SKIP_REVIEW_APPS: 1` in the
The active environments linked to Review Apps can be listed by The active environments linked to Review Apps can be listed by
navigating to the project page -> Deployments -> Environments. navigating to the project page -> Deployments -> Environments.
An HTTP authentication is required to access these environments: the
username is `tor-www` and the password is blank. These credentials
should be automatically present in the URLs used to access Review Apps
from the GitLab interface.
Please note that Review Apps do not currently work for Merge Requests Please note that Review Apps do not currently work for Merge Requests
created from personal forks. This is because personal forks do not have created from personal forks. This is because personal forks do not have
access to the SSH private key required to deploy to the static mirror access to the SSH private key required to deploy to the static mirror
...@@ -121,26 +126,26 @@ auto-stopped (deleted) after 1 week without being updated. ...@@ -121,26 +126,26 @@ auto-stopped (deleted) after 1 week without being updated.
## Working with a staging environment ## Working with a staging environment
Some projects such as `blog.torproject.org` have a specific staging area Our web projects have a specific staging area that is separate from
that is separate from GitLab Pages and `review.torproject.net`. GitLab Pages and `review.torproject.net`. Those sites are deployed as
subdomains of `*.staging.torproject.net` on the static mirror system.
For example, the staging URL for `blog.torproject.org` is
`blog.staging.torproject.net`.
Staging environments can be useful in various scenarios, such as when Staging environments can be useful in various scenarios, such as when
the build job for the production environment is different than the one the build job for the production environment is different than the one
for Review Apps, so a staging URL is useful to be able to preview a full for Review Apps, so a staging URL is useful to be able to preview a full
build before being deployed to production. build before being deployed to production.
To enable a staging environment, first a new domain name must be To enable a staging environment, first a DNS entry must be created
created and pointed to `static.torproject.org`. An example is under `*.staging.torproject.net` and pointed to
`blog-staging.torproject.org` for the blog. This step must be done by `static.torproject.org`. Then some configuration changes are needed in
TPA, so please [open a ticket](https://gitlab.torproject.org/tpo/tpa/team/-/issues/new). Puppet so the necessary symlinks and vhosts are created on the static
web mirrors. These steps must be done by TPA, so please
Then, a new SSH key must be added to Puppet, using the same procedure as [open a ticket](https://gitlab.torproject.org/tpo/tpa/team/-/issues/new).
for the production environment (see [above](#deploying-a-static-site-from-gitlab-ci)).
Only in this case, when adding the private key to CI/CD variables, use
`staging` as Environment scope instead of `production`.
Lastly, a `STAGING_URL` variable must be added to `.gitlab-ci.yml` with Lastly, a `STAGING_URL` variable must be added to `.gitlab-ci.yml` with
the staging domain name (eg. `blog-staging.torproject.org`) as its the staging domain name (eg. `blog.staging.torproject.org`) as its
value. value.
Once this is in place, commits added the the default (`main`) branch Once this is in place, commits added the the default (`main`) branch
...@@ -148,6 +153,11 @@ will automatically trigger a deployment to the staging URL and a manual ...@@ -148,6 +153,11 @@ will automatically trigger a deployment to the staging URL and a manual
job for deployment to production. **This manual job must then be job for deployment to production. **This manual job must then be
triggered by hand after the staging deployment is QA-cleared.** triggered by hand after the staging deployment is QA-cleared.**
An HTTP authentication is required to access staging environments: the
username is `tor-www` and the password is blank. These credentials
should be automatically present in the `Open` and `View deployment`
links in the GitLab interface.
# How-to # How-to
## Adding a new static site shim in Puppet ## Adding a new static site shim in Puppet
... ...
......