Hacker Public Radio

HPR3823: Gitlab Pages for website hosting


Listen Later

How it works
https://docs.gitlab.com/ee/user/project/pages/
GitLab always deploys your website from a specific folder called
public in your repository. To deploy your site, GitLab uses its built-in
tool called GitLab CI/CD to build your site and publish it to the GitLab
Pages server. The sequence of scripts that GitLab CI/CD runs to
accomplish this task is created from a file named .gitlab-ci.yml, which
you can create and modify. A specific job called pages in the
configuration file makes GitLab aware that you're deploying a GitLab
Pages website.
Overview of Steps
The end state has to be a directory named public that contains the
site contents
Optionally, run a build process in a container to create the
contents of the public directory
There has to be a pages declaration in
.gitlab-ci.yml
Example 1
simple demo
Create the Git repo and site content
Go to gitlab and create new Gitlab repo
Clone it to your workstation
Add public folder with site files
add .gitlab-ci.yml
Commit and push
git clone [email protected]:norrist/simple_pages_demo.git
cd simple_pages_demo/
mkdir public
echo "Hello World" > public/index.html
git add public/
vim .gitlab-ci.yml
git add .gitlab-ci.yml
git commit -am "new page"
git push
.gitlab-ci.yml
pages:
stage: deploy
script:
- echo
artifacts:
paths:
- public
Pages settings
Menu on left, Settings, Pages
Your pages are served under:
Example 2
docs.norrist.xyz
Combine my HPR show notes into a single page
Custom Domain
Verified with TXT record
.gitlab-ci.yml
image: "debian"
before_script:
- apt-get update
- apt-get install -y pandoc
stages:
- build
pages:
stage: build
script:
- bash build_html.sh
artifacts:
paths:
- public
set -euo pipefail
IFS=$'nt'
mkdir -pv public
for MD in $(ls *md)
do
echo
# echo "---"
# echo
# echo "#" $MD
echo
echo "---"
echo
cat $MD
done
|pandoc
-H markdown.header
-B body.header
--toc
--toc-depth=1
-f gfm
-t html
-o public/index.html
Example 3
HPR static
Build the new HPR static site
.gitlab-ci.yml
services:
- mariadb
variables:
MYSQL_DATABASE: hpr_hpr
MYSQL_ROOT_PASSWORD: mysql
connect:
stage: .pre
image: mysql
script:
- echo "SELECT 'OK';" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mariadb "$MYSQL_DATABASE"
pages:
image: debian
before_script:
- apt update
- apt -y install libgetopt-complete-perl libmemory-usage-perl libconfig-std-perl libtemplate-perl libtemplate-plugin-dbi-perl libclass-dbi-perl libtie-dbi-perl libdbd-mysql-perl libdate-calc-perl
- apt -y install curl mariadb-client git
- curl -o hpr.sql http://hackerpublicradio.org/hpr.sql
- mysql --user=root --host=mariadb "$MYSQL_DATABASE" --password="$MYSQL_ROOT_PASSWORD" < hpr.sql
stage: build
script:
- git clone https://gitlab.com/roan.horning/hpr_generator.git
- cd hpr_generator
- git apply ../mysql_settings.patch
- grep "database|user|driver|password" site.cfg
...more
View all episodesView all episodes
Download on the App Store

Hacker Public RadioBy Hacker Public Radio

  • 4.2
  • 4.2
  • 4.2
  • 4.2
  • 4.2

4.2

34 ratings


More shows like Hacker Public Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

289 Listeners

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec by Jerry Bell and Andrew Kalat

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec

373 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

268 Listeners

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast) by Johannes B. Ullrich

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast)

653 Listeners

Curious Cases by BBC Radio 4

Curious Cases

829 Listeners

The Strong Towns Podcast by Strong Towns

The Strong Towns Podcast

422 Listeners

Late Night Linux by The Late Night Linux Family

Late Night Linux

164 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,044 Listeners

Cybersecurity Today by Jim Love

Cybersecurity Today

181 Listeners

CISO Series Podcast by David Spark, Mike Johnson, and Andy Ellis

CISO Series Podcast

189 Listeners

TechCrunch Daily Crunch by TechCrunch

TechCrunch Daily Crunch

42 Listeners

Strict Scrutiny by Crooked Media

Strict Scrutiny

5,799 Listeners

2.5 Admins by The Late Night Linux Family

2.5 Admins

98 Listeners

Cyber Security Headlines by CISO Series

Cyber Security Headlines

139 Listeners

What the Hack? by DeleteMe

What the Hack?

221 Listeners