diff --git a/ansistrano_tasks/after_update.yml b/ansistrano_tasks/after_update.yml index 8d31d17..a4c809b 100644 --- a/ansistrano_tasks/after_update.yml +++ b/ansistrano_tasks/after_update.yml @@ -1,17 +1,6 @@ --- -- name: "Unzip" - ansible.builtin.unarchive: - src: "{{ ansistrano_release_path.stdout }}/projectsend-{{ release }}.zip" - dest: "{{ ansistrano_release_path.stdout }}" - remote_src: true - -- name: "Remove archive" - file: - path: "{{ ansistrano_release_path.stdout }}/projectsend-{{ release }}.zip" - state: absent - -#- name: "Update dependencies" -# include_tasks: "dependencies.yml" +- name: "Update dependencies" + include_tasks: "dependencies.yml" - name: "Configure" include_tasks: "configure.yml" diff --git a/ansistrano_tasks/dependencies.yml b/ansistrano_tasks/dependencies.yml index f5de051..f2f1891 100644 --- a/ansistrano_tasks/dependencies.yml +++ b/ansistrano_tasks/dependencies.yml @@ -4,12 +4,20 @@ command: install working_dir: "{{ ansistrano_release_path.stdout }}" +- name: "Create npm home dir" + file: + path: "/var/www/.npm" + state: directory + owner: www-data + group: www-data + become_user: root + - name: "Install JS dependencies" community.general.npm: path: "{{ ansistrano_release_path.stdout }}" - name: "Compile SCSS" ansible.builtin.command: - cmd: "./node_modules/gulp/bin/gulp.js" + cmd: "./node_modules/gulp/bin/gulp.js build" chdir: "{{ ansistrano_release_path.stdout }}" #Todo: creates: "" diff --git a/hosts.yml b/hosts.yml index 42a1f9a..7d6c5e4 100644 --- a/hosts.yml +++ b/hosts.yml @@ -1,8 +1,10 @@ all: hosts: ubuntu: + scope: "prod" + #ubuntu1: + # scope: "test" vars: - scope: "prod" release: "r1335" db_name: "projectsend_{{ scope }}" db_user: "projectsend_{{ scope }}" diff --git a/playbook-app.yml b/playbook-app.yml index 6cf35fe..607a0d6 100644 --- a/playbook-app.yml +++ b/playbook-app.yml @@ -18,14 +18,15 @@ ansistrano_ensure_basedirs_shared_files_exist: yes # Deployment strategy - method used to deliver code. Options are copy, download, git, rsync, rsync_direct, svn, or s3. - ansistrano_deploy_via: download + ansistrano_deploy_via: git # Copy, download and s3 have an optional step to unarchive the downloaded file which can be used by adding _unarchive. # The rsync_direct strategy omits a file copy on the target offering a slight speed increase if you are deploying to shared hosts, are experiancing bad file-performance, or serve static assets from the same host you deploy your app to and rsync many files. # You can check all the options inside tasks/update-code folder! ansistrano_allow_anonymous_stats: no - ansistrano_get_url: "https://github.com/projectsend/projectsend/releases/download/{{ release }}/projectsend-{{ release }}.zip" + ansistrano_git_repo: "https://github.com/projectsend/projectsend.git" + ansistrano_git_branch: master # Hooks: custom tasks if you need them ansistrano_after_update_code_tasks_file: "{{ playbook_dir }}/ansistrano_tasks/after_update.yml" diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml index 8c7fa4a..7908f94 100644 --- a/roles/mariadb/tasks/main.yml +++ b/roles/mariadb/tasks/main.yml @@ -1,16 +1,20 @@ --- - name: "Install dependencies" ansible.builtin.apt: - name: "mariadb-server" + name: + - "mariadb-server" + - "python3-pymysql" update_cache: true cache_valid_time: 86400 - name: "Create database" - mysql_db: + ansible.builtin.mysql_db: + login_unix_socket: "/var/run/mysqld/mysqld.sock" name: "{{ db_name }}" - name: "Create user" - mysql_user: + ansible.builtin.mysql_user: + login_unix_socket: "/var/run/mysqld/mysqld.sock" name: "{{ db_user }}" password: "{{ db_password }}" priv: "{{ db_name }}.*:ALL"