Usually when we organize an event, we need a website and assign several people to take care of it. At PyCon, I believe in collaboration, so I made the PyCon ID 2019 website become Open Source. Let's see on github for the source code and pycon.id for live website.
I will save how I manage the projects for another post, here we talk about the tech stack and CI/CD. The pycon.id built with pelican - static site generator, so there are two components here: theme and content. Because the generated website are static site (html + css + js only), we utilize free hosting from github pages and deploy it using free CI service from travis-ci for open source.
After we enable our repo in travis "watch list", then every time we push to our remote repo travis will do something. What to do? It depends how you define it in .travis.yml
. For example, this is our code:
language: python
dist: trusty
python:
- '3.5'
before_install:
- pip install -U pip
- pip install -U setuptools
- pip install -r requirements.txt
script:
- make html
after_success:
- rm -rf .git/
- git init
- git config user.name "PyconID"
- git config user.email "pyconid@pycon.id"
- git config --global push.default simple
- git remote add origin https://$GITHUB_TOKEN@github.com/pyconid/pyconid2019
- make github
branches:
only:
- master
We are using gitflow for this project. Everyone that want to contribute must fork the repo and add a pull request. We will evaluate the code, merge to master and let travis do the deployment.
Pelican is python base module, so we use python language as base for the CI. We simply install all dependency and make generated html. If no error occured, we push our newly created html in our gh-pages
branch using make github
command.
It's fun to see how this simple approach, with limited number of Pycon committees, we can invite several people to contribute both in making themes, making words and so on. As a core committee, I and the team will focus more on planning, evaluating and merging to master. I will apply this concept to the next community conference, interested in contributing?