]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Add jenkins-build user to mock group during slave setup 1420/head
authorDavid Galloway <dgallowa@redhat.com>
Wed, 23 Oct 2019 13:18:49 +0000 (09:18 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 23 Oct 2019 13:18:49 +0000 (09:18 -0400)
Instead of during each individual job

Signed-off-by: David Galloway <dgallowa@redhat.com>
ansible/examples/slave.yml
ansible/examples/slave_libvirt.yml
ansible/examples/slave_libvirt_static.yml
ansible/examples/slave_static.yml
ceph-ansible-rpm/build/build
ceph-medic-release/build/build_rpm
ceph-medic-rpm/build/build

index 320f54265f0061a3655dc291faea3adae0d7cc4a..aeba5e06bb307b459a54c7893c3b727a7790a4b5 100644 (file)
         - rpmdevtools
         - openssl-devel
         - libffi-devel
+        - mock
       when: ansible_os_family == "RedHat"
 
     - name: install packages from epel (<=7)
         (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'precise') or
         (ansible_distribution == 'Debian' and ansible_distribution_release == 'wheezy')
 
+    - name: "add {{ jenkins_user }} to mock group"
+      user:
+        name: "{{ jenkins_user }}"
+        groups: mock
+        append: yes
+      when: ansible_os_family == "RedHat"
+
     - name: ensure the rpmmacros file exists to fix centos builds
       file:
         path: "/home/{{ jenkins_user }}/.rpmmacros"
index 03ecccfe27f972f4c12431392712a759293cf285..4d800926e73cfa7633c62f5d4882189056b087a4 100644 (file)
         - openssl-devel
         - redhat-lsb-core
         - iproute
+        - mock
       when: ansible_os_family == "RedHat"
 
     - name: install packages from epel
         state: directory
         owner: "{{ jenkins_user }}"
 
+    - name: "add {{ jenkins_user }} to mock group"
+      user:
+        name: "{{ jenkins_user }}"
+        groups: mock
+        append: yes
+      when: ansible_os_family == "RedHat"
+
     - name: Create .ssh directory
       file:
         path: "/home/{{ jenkins_user }}/.ssh"
index 76c77b9212bba27fcd4b30609afe22aeb0824116..a6ace7ad694f8623a7bde8fc2d321043c734bfc5 100644 (file)
         - python-virtualenv
         - openssl-devel
         - redhat-lsb-core
+        - mock
       when: ansible_os_family == "RedHat"
 
     - name: install packages from epel
         state: directory
         owner: "{{ jenkins_user }}"
 
+    - name: "add {{ jenkins_user }} to mock group"
+      user:
+        name: "{{ jenkins_user }}"
+        groups: mock
+        append: yes
+      when: ansible_os_family == "RedHat"
+
     - name: Create .ssh directory
       file:
         path: "/home/{{ jenkins_user }}/.ssh"
index cfb1e8ad09ee34b1a450ab5f2983d15b97982888..2849350455a85f86f9e730cad7e7d5e56f322e16 100644 (file)
         - rpmdevtools
         - openssl-devel
         - libffi-devel
+        - mock
       when:
         - ansible_os_family == "RedHat"
 
         (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'precise') or
         (ansible_distribution == 'Debian' and ansible_distribution_release == 'wheezy')
 
+    - name: "add {{ jenkins_user }} to mock group"
+      user:
+        name: "{{ jenkins_user }}"
+        groups: mock
+        append: yes
+      when: ansible_os_family == "RedHat"
+
     - name: ensure the rpmmacros file exists to fix centos builds
       file: path="/home/{{ jenkins_user }}/.rpmmacros" owner="{{ jenkins_user }}" state=touch
 
index 1f642545521cbf4abf8cf04037929c20db143049..907c20422332f80d31aa6883a62349e3a3215df7 100644 (file)
@@ -12,10 +12,6 @@ PACKAGE=${JOB_NAME%-rpm}
 sudo yum -y install epel-release
 sudo yum -y install fedpkg mock
 
-# Add the Jenkins slave UID to the mock group.
-sudo usermod -a -G mock $(whoami)
-newgrp mock
-
 # Attempt the build. If it fails, print the mock logs to STDOUT.
 make rpm || ( tail -n +1 {root,build}.log && exit 1 )
 
index 4d52823040d7a0a3b6cb95513b1ce832b679e917..1d87ebea43ff37d3d2394ea77e2c3cfa8b36a955 100644 (file)
@@ -10,10 +10,6 @@ set -ex
 sudo yum -y install epel-release
 sudo yum -y install fedpkg mock
 
-# Add the Jenkins slave UID to the mock group.
-sudo usermod -a -G mock $(whoami)
-newgrp mock
-
 # Attempt the build. If it fails, print the mock logs to STDOUT.
 make rpm || ( tail -n +1 {root,build}.log && exit 1 )
 
index 1f642545521cbf4abf8cf04037929c20db143049..907c20422332f80d31aa6883a62349e3a3215df7 100644 (file)
@@ -12,10 +12,6 @@ PACKAGE=${JOB_NAME%-rpm}
 sudo yum -y install epel-release
 sudo yum -y install fedpkg mock
 
-# Add the Jenkins slave UID to the mock group.
-sudo usermod -a -G mock $(whoami)
-newgrp mock
-
 # Attempt the build. If it fails, print the mock logs to STDOUT.
 make rpm || ( tail -n +1 {root,build}.log && exit 1 )