- This is tutorial about Simple CI/CD system. You can use simple technologies of current system to build it.
- Tools:
- Flyway (https://flywaydb.org/): Version control for your database.
- Backlog: Git server
- Chatwork: Group chat for teams
- Environment:
- OS: Ubuntu 14.04
- Git: 1.9.1
- PHP: 5.5+
- Nginx: 1.4.6
- PostgreSQL: 9.3.16
After you Build environment for server sucessfully.
- Create an API Pull source code automatically has method is POST (index.php): To call bash script file and send message to Chatwork.
- Create and bash script file: Pull latest source code from Git server (Backlog) and run Database migration tool (Flyway). I have written an example (bash_deploy.sh).
- Create ssh key by nginx user (www-data user) and add public key to Backlog server.
- Create a ssh key by nginx user :
sudo -H -u www-data bash -c 'ssh-keygen -t rsa -b 4096 -C "your_email@example.com"'
This creates a new ssh key. Add new ssh to Git server.
- User Backlog git webhook to trigger CI build (https://backlog.com/help/usersguide/git/userguide1710/)
- Install
php-curl
extension on Server.
apt-get install -y php-curl
- Permission for
bash_deploy.sh
file and source codes of project. So web service can read, write and execute them. - Get chatwork access token (http://download.chatwork.com/ChatWork_API_Documentation.pdf).
- Change configuration in API to server can send message to Chatwork.
- You can try create a pulling request on Backlog.
Goodluck!!!