Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
MiteshShah committed Mar 1, 2017
2 parents c3433f4 + 2c26c87 commit 323ba4f
Show file tree
Hide file tree
Showing 43 changed files with 1,114 additions and 114 deletions.
47 changes: 47 additions & 0 deletions .github/release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Prerequisites
The release require the following tools installed on your development system:

- Installation
- Linux
Follow this guide https://github.com/nvie/gitflow/wiki/Linux

- OSX

``` brew install git-flow ```

- Initialize git-flow for the project

``` git checkout master && git-flow init -d ```

# Understanding Branches Structure

- master => production ready code
- develop => pre-production code can be deployed on staging instances and well tested by devs before merging their respective Branches
- feature/author/feature-name => these branches will be used by devs who are working on independent modules
- release/v* => branches taken out of develop at some point for releasing a set of feature.
- hotfix/* => branches forked for releasing immediate fixes


# To get started with a new release
Create a branch, update version, and add release notes by running `make-branch`

```
./github/scripts/release/make-branch
```

As part of this script you'll be asked to:
1. Write release notes in CHANGELOG.txt

Almost every feature enhancement should be mentioned, with the most visible/exciting ones first. Use descriptive sentences and give context where appropriate.

Bug fixes are worth mentioning if it's likely that they've affected lots of people, or if they were regressions in the previous version.

Improvements to the code are not worth mentioning.

# To release a version
```
./github/scripts/releases/push-release
```

# Versioning
- we use semantic Versioning
25 changes: 25 additions & 0 deletions .github/release/make-branch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

if [[ "$OSTYPE" == "linux-gnu" ]]; then
GITFLOW_COMMAND="git flow"
elif [[ "$OSTYPE" == "darwin"* ]]; then
GITFLOW_COMMAND="git-flow"
fi

echo "It is assumed that you have merged your changes into develop branch."
echo "Creating a release branch release/$RELEASE_VERSION from develop branch"
git checkout develop

echo "Write release notes in CHANGELOG.txt"
$editor CHANGELOG.txt

RELEASE_VERSION=$(head -n1 CHANGELOG.txt | awk '{ print $1 }')
${GITFLOW_COMMAND} release start ${RELEASE_VERSION}

git diff
echo "Verify changes before commit."
git commit -a -m "Bump ${RELEASE_VERSION}" --signoff --no-verify


echo "Push branch to git remote"
${GITFLOW_COMMAND} release publish ${RELEASE_VERSION}
17 changes: 17 additions & 0 deletions .github/release/push-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

function lib_error() {
#statements
echo -e "$(tput setaf 1)$@$(tput sgr0)"
exit $2
}

if [[ "$OSTYPE" == "linux-gnu" ]]; then
GITFLOW_COMMAND="git flow"
elif [[ "$OSTYPE" == "darwin"* ]]; then
GITFLOW_COMMAND="git-flow"
fi
RELEASE_VERSION=$(head -n1 CHANGELOG.txt | awk '{ print $1 }')
${GITFLOW_COMMAND} release finish ${RELEASE_VERSION} || lib_error "\tIssue occured while publishing commits to master branch. \n\tAfter you resolve issue run following command to finish release. \n\t\t# git checkout master && git push\n\t\t# git push --tags " $?
git checkout master && git push || lib_error "\tIssue occured while publishing commits to master branch. \n\tAfter you resolve issue run following command to finish release. \n\t\t# git checkout master && git push\n\t\t# git push --tags " $?
git push --tags
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.log
*.retry
*.DS_Store
13 changes: 13 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
v0.1.0-beta - March 1, 2017
- First Beta Release
- NGINX PageSpeed Support
- PHP7.1 Support
- Shared Hosting Model
- Setup Following Websites
1. HTML
2. PHP
3. MySQL
4. WordPress
5. WordPress W3TC (W3 Total Cache)
6. WordPress FastCGI Cache

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 AnsiPress
Copyright (c) 2017 AnsiPress

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# AnsiPress

[![saythanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/MiteshShah) [![Join AnsiPress Slack Channel](https://ansipress.herokuapp.com/badge.svg)](https://ansipress.herokuapp.com/)

## Quick Start

#### Ansible - [Install Ansible] (https://miteshshah.github.io/devops/ansible/ansible-installation/)
Expand All @@ -8,15 +10,29 @@

```
$ git clone [email protected]:AnsiPress/AnsiPress.git
$ git checkout develop
$ cd AnsiPress
```

#### Setup SSH Server Login Details

* AnsiPress required you can login to remote server via `ssh AnsiPress.local`
* Change the [AnsiPerss.local] (https://github.com/AnsiPress/AnsiPress/blob/develop/hosts#L2) server name
* Make sure you are able to connect server via `ssh example.com`
* Refer - [SSH Configuration] (https://miteshshah.github.io/linux/ssh/ssh-tips-and-tricks/#ssh-config)

#### Run the AnsiPress Playbook

```
$ ansible-playbook -i hosts setup.yml --extra-vars="username=AnsiPress" -v
$ ansible-playbook -i hosts setup.yml --extra-vars="username=html website_name=html.com website_type=html"
$ ansible-playbook -i hosts setup.yml --extra-vars="username=php website_name=php.com website_type=php"
$ ansible-playbook -i hosts setup.yml --extra-vars="username=mysql website_name=mysql.com website_type=mysql"
$ ansible-playbook -i hosts setup.yml --extra-vars="username=wp website_name=wp.com website_type=wp"
$ ansible-playbook -i hosts setup.yml --extra-vars="username=wp website_name=w3tc.com website_type=w3tc"
$ ansible-playbook -i hosts setup.yml --extra-vars="username=wp website_name=wpfc.com website_type=wpfc"
```

#### Donation
[![PayPal Donate](https://cloud.githubusercontent.com/assets/1223371/20793214/ec6ffca2-b7eb-11e6-9614-d893ff77a565.png)] (https://paypal.me/AnsiPress)

Yes you can! Just click on the image above ;)
Expand Down
7 changes: 7 additions & 0 deletions group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
remote_user: root
ansible_python_interpreter: /usr/bin/python3


# AnsiPress Server TimeZone
# Why you need UTC TimeZone -
# http://yellerapp.com/posts/2015-01-12-the-worst-server-setup-you-can-make.html
timezone: Etc/UTC

# Create New User Account
# We can also pass username variable value using following command
# ansible-playbook -i hosts -e user_name=mi setup.yml --extra-vars="username=AnsiPress" -v
Expand All @@ -20,5 +26,6 @@ packages:
- coreutils
- python3-dev
- python3-pip
- python3-passlib
- python-software-properties
- software-properties-common
1 change: 1 addition & 0 deletions roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- include: roles/libs/tasks/ping.yml
- include: roles/libs/tasks/hostname.yml
- include: roles/libs/tasks/timezone.yml
- include: roles/libs/tasks/apt/update.yml
- include: roles/libs/tasks/apt/dist_upgrade.yml
- include: roles/libs/tasks/apt/install.yml
5 changes: 5 additions & 0 deletions roles/libs/tasks/php_pool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Calculate PHP Pool Number for Username
- name: Calculate PHP Pool Number, Hold on...
shell: echo $(id -u {{ username | lower }} )+8010 | bc
register: php_pool
5 changes: 5 additions & 0 deletions roles/libs/tasks/ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
# Make sure Ansible is connect to the server
- name: Executing ping command, Hold on...
ping:

# Make sure remote system nameserver was properly configure
# And remote system able to reach public network
- name: Checking Network Connection, Hold on...
shell: ping -c2 google.com
4 changes: 0 additions & 4 deletions roles/libs/tasks/service.yml

This file was deleted.

4 changes: 4 additions & 0 deletions roles/libs/tasks/timezone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
# Setup TimeZone
- name: Setup Timezone to UTC, Hold on...
timezone: name={{ timezone }}
5 changes: 0 additions & 5 deletions roles/mariadb/handlers/main.yml

This file was deleted.

41 changes: 0 additions & 41 deletions roles/mariadb/tasks/main.yml

This file was deleted.

5 changes: 0 additions & 5 deletions roles/nginx/handlers/main.yml

This file was deleted.

17 changes: 0 additions & 17 deletions roles/nginx/tasks/main.yml

This file was deleted.

5 changes: 0 additions & 5 deletions roles/php/handlers/main.yml

This file was deleted.

30 changes: 0 additions & 30 deletions roles/php/tasks/main.yml

This file was deleted.

4 changes: 2 additions & 2 deletions roles/user/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
# Setup User Account
- name: Setting up User Account, Hold on...
user: name={{ username }} shell=/bin/bash
- name: Setup User Account, Hold on...
user: name={{ username | lower }} shell=/bin/bash
9 changes: 9 additions & 0 deletions roles/website/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: service nginx reload
service: name=nginx state=reloaded

- name: service php7.1-fpm reload
service: name=php7.1-fpm state=reloaded

- name: service mysql restart
service: name=mysql state=restarted
Loading

0 comments on commit 323ba4f

Please sign in to comment.