Sign inSign up

marlous/hexo

By marlous

Updated over 7 years ago

Hexo with CI/CD in Docker

Image
0

131

marlous/hexo repository overview

Hexo with CI/CD in Docker

Summary

  • Ubuntu 18.04.2
  • Nginx 1.14.0
  • Nodejs 8.10.0
  • jenkins 2.164.1

Feature

  • vim-gtk default installed
  • Git default installed
  • Root of website (Nginx default configuration): /var/www/hexo/public

Details

  • Creating a repository which store articles at GitHub. Then pull it to local PC and /var/www/hexo/source/_post in docker container.
  • Configurating Jenkins to automatically pull articles that at GitHub, then execute shell to generate static web code.
  • Visiting website by browser at ip:80.

How to use it

  1. Runing container:
docker volume create hexo
docker run -it -p 80:80 -p 443:443 -p 8080:8080 -p 4000:4000 -v hexo:/var/www/hexo --name container_name marlous/hexo /bin/bash
  1. Starting service:
service nginx start
service jenkins start
  1. Configurating in container:
  • Git:
git config --global user.name "you account name"
git config --global user.email [email protected]
ssh-keygen -t rsa -C "[email protected]" 
  • Hexo:
cd /var/www/hexo/source/_posts (clean _posts)
git init
git remote add origin git@server-name:path/repo-name.git (articles repository at GitHub)
git pull origin master
  • Jenkins:
/*
shell
 */
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/git/bin
cd /var/www/hexo/source/_posts
git pull origin master
cd /var/www/hexo
hexo clean
hexo g

Tag summary

Content type

Image

Digest

Size

774 MB

Last updated

over 7 years ago

docker pull marlous/hexo