This repository has been archived by the owner on Apr 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Dyachkov
committed
Feb 24, 2016
1 parent
515eb27
commit c8c74a0
Showing
14 changed files
with
300 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.vagrant/ | ||
/playbooks/pepyatka.vault | ||
dev | ||
/plugins/callback/*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[target] | ||
candy.freefeed.net | ||
|
||
[pepyatka:children] | ||
target | ||
|
||
[nginx:children] | ||
target | ||
|
||
[staging:children] | ||
target | ||
|
||
[staging_secrets:children] | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
--- | ||
|
||
pepyatka_ansible_branch: development | ||
pepyatka_html_branch: temp-enable-signup | ||
pepyatka_lite_branch: development | ||
pepyatka_redis_host: pepyatka-micro.gfaoo9.0001.euw1.cache.amazonaws.com | ||
pepyatka_s3_bucket: freefeed-storage-test | ||
pepyatka_lite_hostname: nanopeppa.freefeed.net | ||
freefeed_recaptcha_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
- name: Deploy pepyatka-html | ||
git: | ||
repo: "{{ pepyatka_html_repo }}" | ||
update: yes | ||
dest: /var/www/pepyatka-html | ||
version: "{{ pepyatka_html_branch }}" | ||
force: yes | ||
register: pepyatka_html | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Save changelog in a file | ||
shell: echo "{{ pepyatka_html.before }}...{{ pepyatka_html.after }}" > /tmp/pepyatka-html-changelog | ||
when: pepyatka_html.before != pepyatka_html.after | ||
tags: pepyatka | ||
|
||
- name: Fetch pepyatka-html changelog | ||
fetch: | ||
src=/tmp/pepyatka-html-changelog | ||
dest=pepyatka-html-changelog/{{ inventory_hostname }} | ||
flat=yes | ||
when: pepyatka_html.before != pepyatka_html.after | ||
tags: pepyatka | ||
|
||
- name: Fix server name in public/js/config.js | ||
replace: | ||
dest: /var/www/pepyatka-html/public/js/config.js | ||
regexp: "host:.*" | ||
replace: "host: \"{{ pepyatka_frontend_scheme }}://{{ pepyatka_html_hostname }}\"," | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Fix siteName in public/js/config.js | ||
replace: | ||
dest: /var/www/pepyatka-html/public/js/config.js | ||
regexp: "siteName:.*" | ||
replace: "siteName: '{{ pepyatka_service_name }}'," | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Fix auth.cookieDomain in public/js/config.js | ||
replace: | ||
dest: /var/www/pepyatka-html/public/js/config.js | ||
regexp: "cookieDomain:.*" | ||
replace: "cookieDomain: '{{ pepyatka_auth_cookie_domain }}'," | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Fix auth.tokenPrefix in public/js/config.js | ||
replace: | ||
dest: /var/www/pepyatka-html/public/js/config.js | ||
regexp: "tokenPrefix:.*" | ||
replace: "tokenPrefix: '{{ pepyatka_auth_token_prefix }}'" | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Update version in public/index.html | ||
replace: | ||
dest: /var/www/pepyatka-html/public/index.html | ||
regexp: "v=.*" | ||
replace: "v={{ pepyatka_html_remote_version.stdout }}\"" | ||
when: pepyatka_html.before != pepyatka_html.after | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Update ga account in public/index.html | ||
replace: | ||
dest: /var/www/pepyatka-html/public/index.html | ||
regexp: "UA.+'" | ||
replace: "{{ pepyatka_ga_account }}'" | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Update server url in public/js/bookmarklet*.js | ||
replace: | ||
dest: "/var/www/pepyatka-html/public/js/{{ item }}" | ||
regexp: "http://localhost:3333" | ||
replace: "{{ pepyatka_frontend_scheme }}://{{ pepyatka_html_hostname }}" | ||
with_items: | ||
- bookmarklet.js | ||
- bookmarklet.min.js | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Read bookmarklet.min.js | ||
shell: cat /var/www/pepyatka-html/public/js/bookmarklet.min.js | ||
register: bookmarklet_min_js_content | ||
changed_when: false | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Populate BOOKMARKLET_PLACEHOLDER | ||
replace: | ||
dest: /var/www/pepyatka-html/public/js/app/layouts/authorizedLayout.handlebars | ||
regexp: "BOOKMARKLET_PLACEHOLDER" | ||
replace: "{{ bookmarklet_min_js_content.stdout }}" | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Cleanup local node_modules | ||
file: path=/var/www/pepyatka-html/node_modules state=absent | ||
when: pepyatka_html.before != pepyatka_html.after | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Install pepyatka-html dependencies | ||
npm: path=/var/www/pepyatka-html state=latest | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Clean up dist | ||
file: path=/var/www/pepyatka-html/dist state=absent | ||
when: pepyatka_html.before != pepyatka_html.after | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Compile css | ||
command: chdir=/var/www/pepyatka-html jake themes | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Compile js | ||
command: chdir=/var/www/pepyatka-html jake compile | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Copy main.js | ||
command: cp /var/www/pepyatka-html/dist/main.js /var/www/pepyatka-html/public/js/main.js | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Copy config.js | ||
command: cp /var/www/pepyatka-html/dist/config.js /var/www/pepyatka-html/public/js/config.js | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
||
- name: Fix pepyatka-html permissions | ||
file: | ||
path: /var/www/pepyatka-html | ||
owner: "{{ www_user }}" | ||
group: "{{ www_group }}" | ||
state: directory | ||
recurse: yes | ||
tags: | ||
- pepyatka | ||
- nginx | ||
|
Oops, something went wrong.