我正在使用 GitLab Pages 部署我的 React 应用程序,它运行良好。
这是我的gitlab-ci.yml:
# Using the node alpine image to build the React app
image: node:alpine
# Announce the URL as per CRA docs
# https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration
variables:
PUBLIC_URL: /
# Cache node modules - speeds up future builds
cache:
paths:
- client/node_modules
# Name the stages involved in the pipeline
stages:
- deploy
# Job name for gitlab to recognise this results in assets for Gitlab Pages
# https://docs.gitlab.com/ee/user/project/pages/introduction.html#gitlab-pages-requirements
pages:
stage: deploy
script:
- …Run Code Online (Sandbox Code Playgroud) 我有一个使用Gulp进行构建的GitLab Pages网站.我的.gitlab-ci.yml文件看起来类似于:
image: node:latest
before_script:
- npm install gulp-cli -g
- npm install gulp [...and a whole bunch of packages] --save-dev
build:
stage: build
script:
- gulp buildsite
artifacts:
paths:
- public
pages:
stage: deploy
script:
- gulp
artifacts:
paths:
- public
cache:
paths:
- node_modules/
Run Code Online (Sandbox Code Playgroud)
在build和pages作业之前,npm install执行命令(在每个作业之前执行一次).由于我有很多包,这通常需要一段时间.
有没有办法只在整个构建中进行一次安装?
我认为这cache应该是有用的,但它似乎仍然会重新下载所有内容.
今天早上我收到了自定义域上托管的每个Gitlab页面的电子邮件,说域验证失败了.
那很好,因为我认为我从来没有在第一时间验证它们 - Gitlab很高兴能够实现这一目标.
当我在每个repo上的Settings> Pages> Domain_Details上面时,我看到了创建以下记录的说明:
_gitlab-pages-verification-code.blog.ollyfg.com TXT gitlab-pages-verification-code={32_digit_long_code}
Run Code Online (Sandbox Code Playgroud)
在创建此记录并单击"验证所有权"按钮时,我收到消息"无法验证域所有权".
我已确保记录的设置,并调用
dig -t txt +short _gitlab-pages-verification-code.blog.ollyfg.com
Run Code Online (Sandbox Code Playgroud)
返回:
"gitlab-pages-verification-code={same_32_digit_long_code}"
Run Code Online (Sandbox Code Playgroud)
这是Gitlab中的一个错误吗?难道我做错了什么?
谢谢!
我正在使用src管道运行一些测试并生成覆盖率报告.
我想要做的是能够将生成的coverage文件夹(包括html页面和gitlab.io文件夹)发布到某个内部my.local.gitlab.server/mynamespace/thepagesproject静态页面,可由某些团队成员查看.
我知道gitlab页面的概念,但步骤表明我必须为此目的使用静态站点生成器.
我的问题如下:
这个概念只有在官方gitlab网站上发布时才可用(index.html或者我可以使用我的内部src安装(即我的网页可用gitlab.io)吗?
我可以上传一个my.local.gitlab.server/mynamespace/thepagesproject包含其内容文件夹的文件并使其可访问吗?
什么是使用EXISTING项目的最佳方式,以便只添加一些html页面(理想情况下我想避免为此目的创建一个新项目)
我正在尝试集成的第三方应用程序,要求将文件放入.well-known文件夹中。我怎样才能从 URL 访问该文件?( example.com/.well-known/token.txt)。站点被部署为 gitlab 页面。我尝试的每一次尝试都会出现 404 错误。
我创建了一个Gitlab CI作业,用于pandoc创建一些HTML和PDF资产,我希望将这些资产部署到由Gitlab Pages托管的Hugo网站上。
在.gitlab-ci.yml我的工作中看起来像这样:
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
stages:
- test
- deploy
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
test:
image: registry.gitlab.com/pages/hugo:latest
stage: test
script:
- hugo
except:
- master
assets:
stage: build
image:
name: pandoc/latex:2.6
entrypoint: ["/bin/sh", "-c"]
before_script:
- apk add bash
- apk add zip
- chmod +x ci-build.sh
script:
- ./ci-build.sh
artifacts:
paths:
- public
pages:
image: registry.gitlab.com/pages/hugo:latest
stage: deploy
script:
- hugo
artifacts:
paths:
- public
only: …Run Code Online (Sandbox Code Playgroud) 如何在.gitlab-ci.yml用于部署到gitlab页面的文件中将PowerShell命令/脚本与Gitlab CI一起使用?
我正在尝试从执行build.ps1文件.gitlab-ci.yml,但是当它到达该build.ps1行时,它给出了一个错误,提示
/ bin / bash:第5行:.build.ps1:找不到命令
我正在尝试使用PowerShell脚本转换我的仓库中的文件,并使用以下命令将转换后的文件部署到gitlab页面 .gitlab-ci.yml
这是我的代码:
.gitlab.yml
pages:
stage: deploy
script:
- mkdir .public
- .\build.ps1
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
Run Code Online (Sandbox Code Playgroud) powershell continuous-integration gitlab gitlab-ci gitlab-pages
我们有一个本地部署的 Gitlab 实例,当时我们无法负担一个 GitLab Runner 来运行 CI/CD 管道。
是否可以在没有 CI/CD 的情况下使用 GitLab Pages?例如,是否可以手动准备 HTML 内容,将其放在public根目录中的文件夹中并使其可访问?
我不知道如何在没有通配符域的自托管 Gitlab 实例上设置 Gitlab 页面。例如,我有1台服务器,有3个公共IP地址和域名:
/etc/gitlab/gitlab.rb然后我像这样设置 Omnibus 配置:
external_url 'https://git.example.com'
nginx['enable'] = true
nginx['listen_addresses'] = ['10.8.0.10']
registry_external_url 'https://registry.example.com'
registry_nginx['enable'] = true
registry_nginx['listen_addresses'] = ['10.8.0.11']
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/git.example.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/git.example.com.key"
pages_external_url 'https://pages.example.com'
pages_nginx['enable'] = false
gitlab_pages['enable'] = true
gitlab_pages['cert'] = "/etc/gitlab/ssl/pages.example.com.crt"
gitlab_pages['cert_key'] = "/etc/gitlab/ssl/pages.example.com.key"
gitlab_pages['external_http'] = ['10.8.0.12:80']
gitlab_pages['external_https'] = ['10.8.0.12:443']
Run Code Online (Sandbox Code Playgroud)
例如,我有一个位于https://git.example.com/somegroupname/project的项目。我可以通过https://registry.example.com/somegroupname/project访问该项目的容器注册表,并使用命令拉取 Docker 映像docker pull registry.example.com/somegroupname/project。
我知道 GitLab Pages …
gitlab-pages ×10
gitlab ×7
gitlab-ci ×4
hugo ×2
dns ×1
git ×1
gitlab-api ×1
gulp ×1
namecheap ×1
node.js ×1
npm-install ×1
pandoc ×1
powershell ×1
self-hosting ×1