diff options
12 files changed, 70 insertions, 41 deletions
diff --git a/tcwg-base/tcwg-build/Dockerfile.in b/tcwg-base/tcwg-build/Dockerfile.in index 39ef4f39..cbf4476b 100644 --- a/tcwg-base/tcwg-build/Dockerfile.in +++ b/tcwg-base/tcwg-build/Dockerfile.in @@ -2,8 +2,9 @@ FROM linaro/ci-#{ARCH}-tcwg-base-ubuntu:#{DISTRO} COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave diff --git a/tcwg-base/tcwg-build/new-user.sh b/tcwg-base/tcwg-build/new-user.sh index d1b18953..7bb022dc 100755 --- a/tcwg-base/tcwg-build/new-user.sh +++ b/tcwg-base/tcwg-build/new-user.sh @@ -7,6 +7,7 @@ usage () exit 1 } +passwd_ent="" group="" key="" user="" @@ -14,6 +15,7 @@ verbose=false while [ $# -gt 0 ]; do case "$1" in + --passwd) passwd_ent="$2" ;; --group) group="$2" ;; --key) key="$2" ;; --user) user="$2" ;; @@ -34,22 +36,40 @@ if [ x"$group" != x"" ]; then fi group_opt="-g $group" +elif [ x"$passwd_ent" != x"" ]; then + gid=$(echo $passwd_ent | cut -d: -f 4) + group_opt="-g $gid" else group_opt="" fi +if [ x"$user" = x"" ]; then + user=$(echo "$passwd_ent" | cut -s -d: -f 1,3) +fi + uid=$(echo "$user" | cut -s -d: -f 2) user=$(echo "$user" | cut -d: -f 1) -useradd -m $group_opt -G kvm ${uid:+-u $uid} $user +if [ x"$user" != x"" ]; then + if [ x"$passwd_ent" != x"" ]; then + comment=$(echo $passwd_ent | cut -d: -f 5) + shell=$(echo $passwd_ent | cut -d: -f 7) + fi -sudoers_file=/etc/sudoers.d/$(echo $user | tr "." "-") -echo "$user ALL = NOPASSWD: ALL" > $sudoers_file -chmod 0440 $sudoers_file + useradd -m $group_opt -G kvm \ + ${uid:+-u $uid} \ + ${comment:+-c "$comment"} \ + ${shell:+-s "$shell"} \ + $user -if [ x"$key" != x"" ] ; then - sudo -i -u $user mkdir -p /home/$user/.ssh - sudo -i -u $user chmod 0700 /home/$user/.ssh - cat "$key" | sudo -i -u $user tee /home/$user/.ssh/authorized_keys > /dev/null - sudo -i -u $user chmod 0600 /home/$user/.ssh/authorized_keys + sudoers_file=/etc/sudoers.d/$(echo $user | tr "." "-") + echo "$user ALL = NOPASSWD: ALL" > $sudoers_file + chmod 0440 $sudoers_file + + if [ x"$key" != x"" ] ; then + sudo -i -u $user mkdir -p /home/$user/.ssh + sudo -i -u $user chmod 0700 /home/$user/.ssh + cat "$key" | sudo -i -u $user tee /home/$user/.ssh/authorized_keys > /dev/null + sudo -i -u $user chmod 0600 /home/$user/.ssh/authorized_keys + fi fi diff --git a/trusty-amd64-tcwg-base/trusty-amd64-tcwg-build/Dockerfile b/trusty-amd64-tcwg-base/trusty-amd64-tcwg-build/Dockerfile index 280e8c91..984c42a1 100644 --- a/trusty-amd64-tcwg-base/trusty-amd64-tcwg-build/Dockerfile +++ b/trusty-amd64-tcwg-base/trusty-amd64-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-amd64-tcwg-base-ubuntu:trusty COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -27,4 +28,4 @@ RUN \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* -# checksum: 847950907becd4d2e0bb2246eed17943 +# checksum: 65209b0c1f6a648cadf5b946d5182849 diff --git a/trusty-arm64-tcwg-base/trusty-arm64-tcwg-build/Dockerfile b/trusty-arm64-tcwg-base/trusty-arm64-tcwg-build/Dockerfile index 91ca9969..c3ba20de 100644 --- a/trusty-arm64-tcwg-base/trusty-arm64-tcwg-build/Dockerfile +++ b/trusty-arm64-tcwg-base/trusty-arm64-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-arm64-tcwg-base-ubuntu:trusty COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -15,4 +16,4 @@ RUN chown -R tcwg-buildslave:tcwg-infra /home/tcwg-buildslave/ \ && chmod 0700 /home/tcwg-buildslave/.ssh/ /home/tcwg-benchmark/.ssh/ \ && chmod 0600 /home/tcwg-buildslave/.ssh/* /home/tcwg-benchmark/.ssh/* -# checksum: d46dab616715909f84717ae49d7542b9 +# checksum: 80c0646d8f957e1f33fd66f3c2c29e48 diff --git a/trusty-armhf-tcwg-base/trusty-armhf-tcwg-build/Dockerfile b/trusty-armhf-tcwg-base/trusty-armhf-tcwg-build/Dockerfile index d1fbe12b..c604beac 100644 --- a/trusty-armhf-tcwg-base/trusty-armhf-tcwg-build/Dockerfile +++ b/trusty-armhf-tcwg-base/trusty-armhf-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-armhf-tcwg-base-ubuntu:trusty COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -15,4 +16,4 @@ RUN chown -R tcwg-buildslave:tcwg-infra /home/tcwg-buildslave/ \ && chmod 0700 /home/tcwg-buildslave/.ssh/ /home/tcwg-benchmark/.ssh/ \ && chmod 0600 /home/tcwg-buildslave/.ssh/* /home/tcwg-benchmark/.ssh/* -# checksum: 719915c4d53c3aaff4bfb874ca144542 +# checksum: e51d292a6d912955404de2b0be008b82 diff --git a/trusty-i386-tcwg-base/trusty-i386-tcwg-build/Dockerfile b/trusty-i386-tcwg-base/trusty-i386-tcwg-build/Dockerfile index b559b08d..9fb066b9 100644 --- a/trusty-i386-tcwg-base/trusty-i386-tcwg-build/Dockerfile +++ b/trusty-i386-tcwg-base/trusty-i386-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-i386-tcwg-base-ubuntu:trusty COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -26,4 +27,4 @@ RUN \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* -# checksum: ba06b8439f636dc78d7968329afbf02e +# checksum: 13525739f5c6692bc5239f5b544ae177 diff --git a/xenial-amd64-tcwg-base/xenial-amd64-tcwg-build/Dockerfile b/xenial-amd64-tcwg-base/xenial-amd64-tcwg-build/Dockerfile index 58b1c170..519add68 100644 --- a/xenial-amd64-tcwg-base/xenial-amd64-tcwg-build/Dockerfile +++ b/xenial-amd64-tcwg-base/xenial-amd64-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-amd64-tcwg-base-ubuntu:xenial COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -27,4 +28,4 @@ RUN \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* -# checksum: c2cb73fc80affc8312b1959673d8767c +# checksum: 4e6ae7dbe4ddff7b1e792d57fda62ff5 diff --git a/xenial-arm64-tcwg-base/xenial-arm64-tcwg-build/Dockerfile b/xenial-arm64-tcwg-base/xenial-arm64-tcwg-build/Dockerfile index 989ef31e..c9750ffa 100644 --- a/xenial-arm64-tcwg-base/xenial-arm64-tcwg-build/Dockerfile +++ b/xenial-arm64-tcwg-base/xenial-arm64-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-arm64-tcwg-base-ubuntu:xenial COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -15,4 +16,4 @@ RUN chown -R tcwg-buildslave:tcwg-infra /home/tcwg-buildslave/ \ && chmod 0700 /home/tcwg-buildslave/.ssh/ /home/tcwg-benchmark/.ssh/ \ && chmod 0600 /home/tcwg-buildslave/.ssh/* /home/tcwg-benchmark/.ssh/* -# checksum: a9bb4838879761da324a80f74d713b07 +# checksum: bce8eb4d75d9d08883da549d0a4a93c1 diff --git a/xenial-arm64-tcwg-base/xenial-arm64-tcwg-llvmbot/Dockerfile b/xenial-arm64-tcwg-base/xenial-arm64-tcwg-llvmbot/Dockerfile index a5327736..fb8fc11f 100644 --- a/xenial-arm64-tcwg-base/xenial-arm64-tcwg-llvmbot/Dockerfile +++ b/xenial-arm64-tcwg-base/xenial-arm64-tcwg-llvmbot/Dockerfile @@ -32,9 +32,9 @@ RUN git clone -b master https://github.com/maxim-kuvyrkov/ninja.git \ # Add current clang for libcxx bots. RUN \ - clang_ver=clang+llvm-5.0.1-aarch64-linux-gnu \ + clang_ver=clang+llvm-6.0.0-aarch64-linux-gnu \ && cd /usr/local \ - && wget --progress=dot:giga http://releases.llvm.org/5.0.1/$clang_ver.tar.xz \ + && wget --progress=dot:giga http://releases.llvm.org/6.0.0/$clang_ver.tar.xz \ && tar xf $clang_ver.tar.xz \ && rm $clang_ver.tar.xz @@ -45,4 +45,4 @@ COPY start.sh . ENTRYPOINT ["/run.sh"] CMD ["start.sh"] -# checksum: e518582a2a434e66d9c9388c0bd2fa91 +# checksum: 765b3adb1b9e9f5ee905e980c41f2a32 diff --git a/xenial-armhf-tcwg-base/xenial-armhf-tcwg-build/Dockerfile b/xenial-armhf-tcwg-base/xenial-armhf-tcwg-build/Dockerfile index d685b29a..3de5b1e9 100644 --- a/xenial-armhf-tcwg-base/xenial-armhf-tcwg-build/Dockerfile +++ b/xenial-armhf-tcwg-base/xenial-armhf-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-armhf-tcwg-base-ubuntu:xenial COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -15,4 +16,4 @@ RUN chown -R tcwg-buildslave:tcwg-infra /home/tcwg-buildslave/ \ && chmod 0700 /home/tcwg-buildslave/.ssh/ /home/tcwg-benchmark/.ssh/ \ && chmod 0600 /home/tcwg-buildslave/.ssh/* /home/tcwg-benchmark/.ssh/* -# checksum: 8dcea6cdeb064fe01ee369351717080c +# checksum: 4e31b90135e10180e50c92a82377abea diff --git a/xenial-armhf-tcwg-base/xenial-armhf-tcwg-llvmbot/Dockerfile b/xenial-armhf-tcwg-base/xenial-armhf-tcwg-llvmbot/Dockerfile index 00ed72eb..51f57671 100644 --- a/xenial-armhf-tcwg-base/xenial-armhf-tcwg-llvmbot/Dockerfile +++ b/xenial-armhf-tcwg-base/xenial-armhf-tcwg-llvmbot/Dockerfile @@ -32,9 +32,9 @@ RUN git clone -b master https://github.com/maxim-kuvyrkov/ninja.git \ # Add current clang for libcxx bots. RUN \ - clang_ver=clang+llvm-5.0.1-armv7a-linux-gnueabihf \ + clang_ver=clang+llvm-6.0.0-armv7a-linux-gnueabihf \ && cd /usr/local \ - && wget --progress=dot:giga http://releases.llvm.org/5.0.1/$clang_ver.tar.xz \ + && wget --progress=dot:giga http://releases.llvm.org/6.0.0/$clang_ver.tar.xz \ && tar xf $clang_ver.tar.xz \ && rm $clang_ver.tar.xz @@ -45,4 +45,4 @@ COPY start.sh . ENTRYPOINT ["linux32", "/run.sh"] CMD ["start.sh"] -# checksum: 478e345cb93c7e7a70535a26606fb9ed +# checksum: fba53876c5cbd698ed2ca6b27da7f04e diff --git a/xenial-i386-tcwg-base/xenial-i386-tcwg-build/Dockerfile b/xenial-i386-tcwg-base/xenial-i386-tcwg-build/Dockerfile index b105a155..c597f700 100644 --- a/xenial-i386-tcwg-base/xenial-i386-tcwg-build/Dockerfile +++ b/xenial-i386-tcwg-base/xenial-i386-tcwg-build/Dockerfile @@ -3,8 +3,9 @@ FROM linaro/ci-i386-tcwg-base-ubuntu:xenial COPY new-user.sh /usr/local/bin/ -RUN new-user.sh --user tcwg-buildslave:11827 --group tcwg-infra:9000 \ - && new-user.sh --user tcwg-benchmark:12326 --group tcwg-infra \ +RUN new-user.sh --group tcwg-infra:9000 \ + && new-user.sh --passwd "tcwg-buildslave:x:11827:9000:TCWG Buildslave::/bin/bash" \ + && new-user.sh --passwd "tcwg-benchmark:x:12326:9000:TCWG Benchmark::/bin/bash" \ && mkdir -p /home/tcwg-buildslave/workspace COPY tcwg-buildslave /home/tcwg-buildslave @@ -26,4 +27,4 @@ RUN \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* -# checksum: c4d98a96007fb76a7e5c6114053a3c87 +# checksum: aa092307b16e193c2a39ef6554ac4f4a |