remove deployment scripts from project

This commit is contained in:
Riku Rouvila
2015-01-15 19:06:32 +02:00
parent c117464987
commit bf30b20214
6 changed files with 1 additions and 89 deletions

View File

@@ -1,18 +0,0 @@
#!/bin/bash
set -e
export ANSIBLE_SSH_ARGS="-o ForwardAgent=yes"
# Install dependencies
if ! which pip > /dev/null; then
echo "Installing pip (requires sudo password)"
sudo apt-get install python-pip || sudo easy_install pip
fi
if ! which ansible > /dev/null; then
echo "Installing ansible (requires sudo password)"
sudo pip install ansible
fi
cd $(dirname $0)
ansible-playbook deploy.yml -i hosts

View File

@@ -1,50 +0,0 @@
---
- name: Deploy koodiklinikka.fi
hosts: all:!localhost
gather_facts: no
vars_files:
- vars.yml
tasks:
- name: Deploy client from git
remote_user: "{{ service_user }}"
action: >
git
repo="{{ repository_url }}"
dest="{{ projects_path }}"
accept_hostkey=True
- name: Install NVM
remote_user: "{{ service_user }}"
action: >
git
repo="https://github.com/creationix/nvm"
dest="{{ nvm_path }}"
- name: Make sure Node.js is installed and properly aliased
command: >
bash -c "source {{ nvm_script }} && nvm install {{ nodejs_version }} && nvm alias {{ project_name }} {{ nodejs_version }}"
register: nvm_result
changed_when: >
"already installed" not in nvm_result.stdout
remote_user: "{{ service_user }}"
- name: Install client NPM dependencies and build assets
command: >
bash -c "source {{ nvm_script }} && nvm use {{ project_name }} && cd {{ projects_path }} && npm install && NODE_ENV=production npm run build"
remote_user: "{{ service_user }}"
- name: Setup nginx vhost
remote_user: "{{ service_user }}"
template: >
src=templates/nginx.j2
dest="/etc/nginx/sites-available/koodiklinikka/{{ public_hostname }}"
mode=664
notify: restart nginx
handlers:
- name: restart nginx
sudo: true
remote_user: "{{ service_user }}"
service: >
name=nginx
state=restarted

View File

@@ -1 +0,0 @@
koodiklinikka.fi

View File

@@ -1,9 +0,0 @@
location / {
root {{ projects_path }}/public;
try_files $uri /index.html;
gzip_static on;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
}

View File

@@ -1,9 +0,0 @@
---
project_name: koodiklinikka.fi
projects_path: /opt/web/koodiklinikka.fi
repository_url: git@github.com:koodiklinikka/koodiklinikka.fi.git
service_user: web
nvm_path: /opt/web/nvm
nvm_script: /opt/web/nvm/nvm.sh
nodejs_version: v0.10.25
public_hostname: koodiklinikka.fi

View File

@@ -9,8 +9,7 @@
"prepublish": "bower install",
"start": "gulp",
"build": "gulp build",
"test": "karma start test/karma.conf.js",
"deploy": "bash deploy/deploy.sh"
"test": "karma start test/karma.conf.js"
},
"keywords": [
"gulp",