Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
TPA
status-site
Commits
951534fa
Commit
951534fa
authored
Jan 26, 2022
by
anarcat
Browse files
Merge branch 'merge-ci-templates' into 'main'
chase changes in ci-templates See merge request
!20
parents
fd9490f2
8bbe2382
Pipeline
#25015
passed with stages
in 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
951534fa
# SERVING CSTATE ON GITLAB PAGES
# Introduced in v4.2.1
#
# This file is very similar to the existing GitLab template, and might need editing before it works on your project.
#
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
SITE_URL
:
status.torproject.org
# All available Hugo versions are listed here:
# https://gitlab.com/pages/hugo/container_registry
#
# cState uses Hugo Extended.
image
:
registry.gitlab.com/pages/hugo/hugo_extended:0.65.3
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
SUBDIR
:
public/
# now from environment
#SITE_URL: status.torproject.org
include
:
project
:
tpo/tpa/ci-templates
file
:
static-shim-deploy.yml
ref
:
simplify
build
:
image
:
registry.gitlab.com/pages/hugo/hugo_extended:0.65.3
stage
:
build
script
:
-
hugo
...
...
@@ -28,52 +15,16 @@ build:
paths
:
-
public
# we'd like to *not* rebuild hugo here, but pages fails with:
#
# jobs pages config should implement a script: or a trigger: keyword
pages
:
stage
:
deploy
script
:
-
hugo
artifacts
:
paths
:
-
public
only
:
-
merge_requests
deploy-static
:
environment
:
name
:
production
include
:
project
:
tpo/tpa/ci-templates
file
:
-
static-shim-deploy.yml
-
pages-deploy.yml
deploy-review
:
stage
:
deploy
variables
:
REMOTE_SUBDIR
:
public/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
environment
:
name
:
review/$CI_COMMIT_REF_SLUG
url
:
https://review.torproject.org/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
on_stop
:
stop-review
auto_stop_in
:
1 week
# use pages for merge requests, not main (which is the default in the
# above template). the logic here is that we want people that do not
# have acess to the repository to still have a preview of their merge
# request.
pages
:
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
$CI_DEFAULT_BRANCH'
when
:
never
-
if
:
'
$CI_COMMIT_BRANCH'
image
:
!reference
[
deploy-static
,
image
]
resource_group
:
!reference
[
deploy-static
,
resource_group
]
before_script
:
!reference
[
.prepare-deploy-static
]
script
:
!reference
[
deploy-static
,
script
]
stop-review
:
environment
:
name
:
review/$CI_COMMIT_REF_SLUG
action
:
stop
variables
:
REMOTE_SUBDIR
:
public/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
when
:
manual
stage
:
deploy
image
:
!reference
[
deploy-static
,
image
]
resource_group
:
!reference
[
deploy-static
,
resource_group
]
before_script
:
!reference
[
.prepare-deploy-static
]
script
:
-
ssh -o UserKnownHostsFile=".ssh/known_hosts" -i ".ssh/private_key" static-gitlab-shim@static-gitlab-shim.torproject.org delete-environment $REMOTE_SUBDIR
-
ssh -o UserKnownHostsFile=".ssh/known_hosts" -i ".ssh/private_key" static-gitlab-shim@static-gitlab-shim.torproject.org static-update-component
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request"'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment