Skip to content

Commit

Permalink
Fix mysql and refactor jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
m-pilarczyk committed Dec 29, 2022
1 parent 82f42ce commit 206a529
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
7 changes: 3 additions & 4 deletions tasks/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
include_tasks: deploy/init.yaml
when: not service_dir_stat.stat.exists or service_dir_stat.stat.isdir

- name: "{{ service_name }} | deploy | Deploy JWT"
include_tasks: deploy/jwt.yaml
when: copy_jwt or create_jwt

- name: "{{ service_name }} | deploy | Create storage"
include_tasks: deploy/storage.yaml
when: service_storage_dir != None and service_storage_dir and service_storage_dir|length > 0

- name: "{{ service_name }} | deploy | Update service"
include_tasks: deploy/update.yaml

#- name: "{{ service_name }} | deploy | Migrate service"
# include_tasks: deploy/migrate.yaml

- name: "{{ service_name }} | deploy | Build service"
include_tasks: deploy/build.yaml

Expand Down
10 changes: 10 additions & 0 deletions tasks/deploy/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
line: "APP_VERSION={{ git_version }}"
when: service_env_file_local != None and service_env_file_local and service_env_file_local|length > 0

- name: "{{ service_name }} | deploy | build | Get AdServer's public key"
ansible.builtin.copy:
src: "{{ vendor_dir }}/adserver/config/jwt/oauth-public.key"
dest: "{{ deploy_dir }}/config/jwt/oauth-public.key"
remote_src: true
owner: "{{ service_user }}"
group: "{{ service_user }}"
mode: "0644"
when: copy_jwt

- name: "{{ service_name }} | deploy | build | Checking build script"
ansible.builtin.stat:
path: "{{ deploy_dir }}/deploy/build.sh"
Expand Down
10 changes: 0 additions & 10 deletions tasks/deploy/jwt.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/setup/mysql.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "{{ service_name }} | setup | mysql | Add Percona repository" # noqa command-instead-of-module
ansible.builtin.command: |
ansible.builtin.shell: |
wget -q https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
when: "'percona-server-server-5.7' not in ansible_facts.packages"
Expand Down
1 change: 0 additions & 1 deletion vars/adserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ service_env: production
service_env_file_dist: .env.dist
service_env_file_local: .env
service_copy_env_file: true
create_jwt: true
deploy_refresh: "{{ service_dir }}/artisan --no-interaction optimize"
deploy_clear: ~
deploy_services:
Expand Down
1 change: 0 additions & 1 deletion vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ repo_url: "https://github.com/adshares/{{ service_name }}.git"

# Deploy
copy_jwt: false
create_jwt: false
deploy_version: "{{ ansible_date_time.iso8601_basic_short }}"
deploy_dir: "{{ service_dir }}-{{ deploy_version }}"
deploy_refresh: "composer --no-interaction --working-dir={{ service_dir }} dump-env prod"
Expand Down

0 comments on commit 206a529

Please sign in to comment.