Skip to content

Commit

Permalink
ansible: create git repo under binary_tmp user (nodejs#3733)
Browse files Browse the repository at this point in the history
Create the `binary_tmp` git repository under the home directory for
the `binary_tmp` user to avoid permissions issues encountered when
previously trying to create it under the `iojs` user.

This change will mean that for any machines that mount expanded
storage as an additional disk, the `binary_tmp` users' home directory
will need to be on the larger storage. In practice this means that
the additional disk should be mounted at `/home/` rather than
`/home/iojs/`.

Fixes: nodejs#3732
  • Loading branch information
richardlau authored May 23, 2024
1 parent 0169b18 commit f5167c7
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
user: "binary_tmp"
key: "{{ lookup('file', '/tmp/nodejs-ci.keys') }}"

# Repository needs to be created in /home/iojs/build because the partition with
# free space might be mounted in a way that does not include /home/binary_tmp
- name: Create repository parent directory
file:
path: "{{ home }}/{{ server_user }}/build/"
Expand All @@ -51,22 +49,12 @@

- name: Create repository directory
file:
path: "{{ home }}/{{ server_user }}/build/binary_tmp.git"
path: "~binary_tmp/binary_tmp.git"
state: directory
owner: "binary_tmp"
group: "binary_tmp"
mode: 0755

- name: Link to repository directory from bintmp home
file:
src: "{{ home }}/{{ server_user }}/build/binary_tmp.git"
dest: "~binary_tmp/binary_tmp.git"
state: link
owner: "binary_tmp"
group: "binary_tmp"
follow: false
mode: 0755

- name: Initialize Git repository
become: true
become_user: binary_tmp
Expand Down Expand Up @@ -115,9 +103,11 @@
- name: Disable automatic garbage collection
become: true
become_user: binary_tmp
command: "git config gc.auto 0"
args:
chdir: "~binary_tmp/binary_tmp.git/"
community.general.git_config:
name: gc.auto
file: "~binary_tmp/binary_tmp.git/config"
scope: file
value: 0

- name: Add nodesource signing key
apt_key:
Expand Down

0 comments on commit f5167c7

Please sign in to comment.