Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
klaus993 committed Jan 12, 2024
1 parent 8c3ef12 commit 09e7e02
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ansible/playbooks/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
ansible.builtin.git:
repo: [email protected]:lambdaclass/stark_compass_explorer.git
version: "{{ lookup('ansible.builtin.env', 'GIT_BRANCH') }}"
dest: /home/dev/tmp/stark_compass_explorer
dest: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/tmp/stark_compass_explorer"
ssh_opts: "-o StrictHostKeyChecking=no"
key_file: /home/dev/.ssh/id_ed25519
key_file: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/.ssh/id_ed25519"
register: clone_output

- name: Print clone repo output
Expand All @@ -28,7 +28,7 @@
- name: Build
ansible.builtin.shell: |
set -ex
export PATH=${PATH}:/home/dev/.cargo/bin
export PATH=${PATH}:/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/.cargo/bin
mix local.hex --force
mix local.rebar --force
mix deps.get --only $MIX_ENV
Expand All @@ -55,26 +55,26 @@
ENABLE_TESTNET_SYNC: "{{ lookup('ansible.builtin.env', 'ENABLE_TESTNET_SYNC') }}"
ENABLE_GATEWAY_DATA: "{{ lookup('ansible.builtin.env', 'ENABLE_GATEWAY_DATA') }}"
args:
chdir: /home/dev/tmp/stark_compass_explorer
chdir: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/tmp/stark_compass_explorer"
register: build_output

- debug: msg="{{ build_output.stdout_lines + [ build_output.stderr_lines ] }}"

- name: Delete old repo
ansible.builtin.file:
state: absent
path: /home/dev/stark_compass_explorer
path: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/stark_compass_explorer"

- name: Copy repo from tmp dir
ansible.builtin.copy:
remote_src: true
src: /home/dev/tmp/stark_compass_explorer
dest: /home/dev/
src: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/tmp/stark_compass_explorer"
dest: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/"

- name: Create .env file
ansible.builtin.template:
src: .env.j2
dest: /home/dev/.env
dest: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/.env"
vars:
phx_host: "{{ lookup('ansible.builtin.env', 'PHX_HOST') }}"
secret_key_base: "{{ lookup('ansible.builtin.env', 'SECRET_KEY_BASE') }}"
Expand All @@ -97,12 +97,12 @@
- name: Create user systemd directory
ansible.builtin.file:
state: directory
path: /home/dev/.config/systemd/user
path: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/.config/systemd/user"

- name: Install systemd service
ansible.builtin.template:
src: starknet_explorer.service.j2
dest: /home/dev/.config/systemd/user/starknet_explorer.service
dest: "/home/{{ lookup('ansible.builtin.env', 'TS_USER') }}/.config/systemd/user/starknet_explorer.service"

- name: Restart starknet_explorer service
ansible.builtin.systemd:
Expand Down

0 comments on commit 09e7e02

Please sign in to comment.