...
 
Commits (6)
......@@ -13,3 +13,7 @@ uploads/*
yarn-error.log
data
scripts/link.sh
env/Vagrant/centos/\.vagrant/
env/Vagrant/debian/\.vagrant/
......@@ -12,7 +12,7 @@ services:
- POSTGRES_PASSWORD
- POSTGRES_PORT
volumes:
- ./data/postgres:/var/lib/postgresql
- ../data/postgres:/var/lib/postgresql
- ./scripts/test.sql:/docker-entrypoint-initdb.d/test.sql
postgres_test:
......
---
- hosts: localhost, all
gather_facts: yes
become: true
environment:
PUBSWEET_SECRET: 'b023957edabe231aaaef20369b9f02adfe8d31a1752828041645d4fe6677e384641ccd949c6db438e5dee3b7d4627227db7cceaeeac20d4a3f8240b792d4d478'
POSTGRES_USER: '${USER}'
POSTGRES_PASSWORD: 'secretpassword'
POSTGRES_HOST: '0.0.0.0'
POSTGRES_DB: 'editoria_dev'
POSTGRES_PORT: '5432'
SERVER_PORT: '3000'
INK_ENDPOINT: 'http://167.99.161.30:3000/'
INK_USERNAME: 'admin@admin.com'
INK_PASSWORD: 'abc12345'
INK_EDITORIA_TYPESCRIPT: '1'
NODE_ENV: 'development'
roles:
- debian
- basics
- editoria
---
- name: "install vim"
package:
name: vim
state: present
- name: "install tmux"
package:
name: tmux
state: present
- name: "create docker group"
group:
name: docker
state: present
- name: adding the user running the deploy to group sudo
user:
name: vagrant
groups: docker
append: yes
- name: "install pip for docker-compose"
package:
name: python-pip
state: present
- name: "install docker-compose"
pip:
name: docker-compose
state: present
- name: "install n"
npm:
name: n
global: yes
- name: "update node to version 11"
shell: n 11
---
##################################
## Node & NPM For CENTOS ##
##################################
- name: "install Node"
package:
name: "{{ item }}"
state: present
with_items:
- epel-release
- nodejs
- npm
##################################
## Docker For CENTOS ##
##################################
- name: "install requirement"
package:
name: "{{ item }}"
state: present
with_items:
- yum-utils
- device-mapper-persistent-data
- lvm2
- get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644
- name: "install docker"
package:
name: "{{ item }}"
state: present
with_items:
- docker-ce
- docker-ce-cli
- containerd.io
\ No newline at end of file
---
# Set the version of Node.js to install ("6.x", "8.x", "10.x", "11.x", etc.).
# Version numbers from Nodesource: https://github.com/nodesource/distributions
nodejs_version: "10.x"
# The user for whom the npm packages will be installed.
# nodejs_install_npm_user: username
# The directory for global installations.
npm_config_prefix: "/usr/local/lib/npm"
# Set to true to suppress the UID/GID switching when running package scripts. If
# set explicitly to false, then installing as a non-root user will fail.
npm_config_unsafe_perm: "false"
# Define a list of global packages to be installed with NPM.
nodejs_npm_global_packages: []
# # Install a specific version of a package.
# - name: jslint
# version: 0.9.3
# # Install the latest stable release of a package.
# - name: node-sass
# # This shorthand syntax also works (same as previous example).
# - node-sass
# The path of a package.json file used to install packages globally.
nodejs_package_json_path: ""
\ No newline at end of file
---
##################################
## Node & NPM For Debian ##
##################################
- name: Ensure apt-transport-https is installed.
apt: name=apt-transport-https state=present
- name: Add Nodesource apt key.
apt_key:
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
id: "68576280"
state: present
- name: Add NodeSource repositories for Node.js.
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
- "deb-src https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
register: node_repo
- name: Update apt cache if repo was added.
apt: update_cache=yes
when: node_repo.changed
- name: Ensure Node.js and npm are installed.
apt: "name=nodejs={{ nodejs_version|regex_replace('x', '') }}* state=present"
##################################
## Docker For Debian ##
##################################
- name: Ensure apt-transport-https is installed.
apt: name=apt-transport-https state=present
- name: Add Docker apt key.
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker repositories
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
register: docker_repo
- name: Update apt cache if repo was added.
apt: update_cache=yes
when: docker_repo.changed
- name: "install docker"
package:
name: "{{ item }}"
state: present
with_items:
- docker-ce
- docker-ce-cli
- containerd.io
\ No newline at end of file
---
# tasks file for provision/roles/wax
- name: "install latest git version"
package:
name: "git"
state: present
- name: "install yarn"
npm:
name: "yarn"
global: yes
- name: "Install Vim"
package:
name: "vim"
state: present
- name: "install dependencies"
shell: yarn install
args:
chdir: /var/www/plume
- name: Creates directory for docker
file:
path: /var/lib/postgresql/
group: docker
state: directory
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
OS = "centos/7"
OS_VERSION = "1811.01"
PROJECT_NAME = "editoria"
VB_NAME = PROJECT_NAME + "-centos"
FORWARDED_PORT = 7
SHARED_FOLDER_GUEST = "/var/www/plume"
SHARED_FOLDER_HOST = "../../../"
Vagrant.configure("2") do |config|
config.vm.hostname = PROJECT_NAME + "centos"
config.vm.define PROJECT_NAME
config.vm.provider :virtualbox do |vb|
vb.name = VB_NAME
end
config.vm.box = OS
config.vm.box_version = OS_VERSION
config.vm.network "forwarded_port", guest: 80, host: 8000+FORWARDED_PORT
config.vm.network "forwarded_port", guest: 5432, host: 5432+FORWARDED_PORT
config.vm.network "forwarded_port", guest: 3000, host: 3000+FORWARDED_PORT
config.vm.synced_folder SHARED_FOLDER_HOST, SHARED_FOLDER_GUEST
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = SHARED_FOLDER_GUEST + "/env/Ansible/provision/playbook.yml"
ansible.verbose = true
end
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
OS = "debian/stretch64"
OS_VERSION = "9.8.0"
PROJECT_NAME = "monemvasia"
VB_NAME = PROJECT_NAME + "-debian"
FORWARDED_PORT = 4
SHARED_FOLDER_GUEST = "/var/www/plume"
SHARED_FOLDER_HOST = "../../../"
Vagrant.configure("2") do |config|
config.vm.hostname = PROJECT_NAME
config.vm.define PROJECT_NAME
config.vm.provider :virtualbox do |vb|
vb.name = VB_NAME
end
config.vm.box = OS
config.vm.box_version = OS_VERSION
config.vm.network "forwarded_port", guest: 80, host: 8000+FORWARDED_PORT
config.vm.network "forwarded_port", guest: 5432, host: 5432+FORWARDED_PORT
config.vm.network "forwarded_port", guest: 3000, host: 3000+FORWARDED_PORT
config.vm.synced_folder SHARED_FOLDER_HOST, SHARED_FOLDER_GUEST
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = SHARED_FOLDER_GUEST + "/env/Ansible/provision/playbook.yml"
ansible.verbose = true
end
end
cd env/Vagrant/debian/
vagrant up --provision && vagrant ssh -c "cd /var/www/plume && sh scripts/on_going/start_server_first_time.sh"
\ No newline at end of file
#!/usr/bin/env bash
SESSION=$USER
# new to tmux :
# tmux allows you to create multiple session in which you can run command independently
# bonus : you can close your terminal, the session will continue on its own
# https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c404340
# create new session and start servers
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'editoria_servers'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "source config/development.env && yarn start:services" C-m
tmux select-pane -t 1
tmux send-keys "source config/development.env && yarn server" C-m
tmux a
#!/usr/bin/env bash
SESSION=$USER
# new to tmux :
# tmux allows you to create multiple session in which you can run command independently
# bonus : you can close your terminal, the session will continue on its own
# https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c404340
# create new session and start servers
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'editoria_servers'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "source config/development.env && yarn start:services" C-m
tmux select-pane -t 1
tmux send-keys "source config/development.env && yarn resetdb && yarn server" C-m
tmux a
cd env/Vagrant/debian/
vagrant up && vagrant ssh -c "cd /var/www/plume && sh scripts/on_going/start_server.sh"
\ No newline at end of file
This diff is collapsed.