aboutsummaryrefslogtreecommitdiff
path: root/tcwg-base
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-06-05 12:24:55 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-06-05 12:24:55 +0000
commit47bde2dd97c1bf74dfc2614f7427e93a26794169 (patch)
treee221a92b593cda45da3e6dedeccfd0f999955805 /tcwg-base
parent70e4517c8db330f8c30a2faaa4c676c471eecc46 (diff)
tcwg-host: Generalize handling of /home files
Change-Id: I33b65cc9657a399367379eb85543408b4687cc5a
Diffstat (limited to 'tcwg-base')
-rw-r--r--tcwg-base/tcwg-host/Dockerfile.in18
-rwxr-xr-xtcwg-base/tcwg-host/build.sh4
-rw-r--r--tcwg-base/tcwg-host/home/maxim.kuvyrkov/.ssh/authorized_keys (renamed from tcwg-base/tcwg-host/authorized_keys-maxim.kuvyrkov)0
3 files changed, 13 insertions, 9 deletions
diff --git a/tcwg-base/tcwg-host/Dockerfile.in b/tcwg-base/tcwg-host/Dockerfile.in
index e28a08dd..3e876f13 100644
--- a/tcwg-base/tcwg-host/Dockerfile.in
+++ b/tcwg-base/tcwg-host/Dockerfile.in
@@ -1,10 +1,14 @@
FROM linaro/ci-#{ARCH}-tcwg-base-ubuntu:#{DISTRO}
-COPY authorized_keys-* passwd /
+COPY passwd start.sh /
+COPY home/ /home-data/
-RUN new-user.sh --group primary:10000 \
- && while read line; do new-user.sh --passwd "$line"; done </passwd \
- && for key in /authorized_keys-*; do new-user.sh --key "$key"; done \
- && rm /passwd /authorized_keys-*
-
-COPY start.sh /
+RUN new-user.sh --group tcwg-infra:9000 && new-user.sh --group primary:10000 \
+ && while read line; do \
+ new-user.sh --passwd "$line"; \
+ user=$(echo "$line" | cut -d: -f 1); \
+ gid=$(echo "$line" | cut -d: -f 4); \
+ chown -R $user:$gid /home-data/$user/; \
+ rsync -a /home-data/$user/ /home/$user/; \
+ done </passwd \
+ && rm -rf /passwd /home-data/
diff --git a/tcwg-base/tcwg-host/build.sh b/tcwg-base/tcwg-host/build.sh
index 346e0ccc..c0a1e789 100755
--- a/tcwg-base/tcwg-host/build.sh
+++ b/tcwg-base/tcwg-host/build.sh
@@ -6,7 +6,7 @@ trap cleanup_exit INT TERM EXIT
cleanup_exit()
{
- rm -f authorized_keys-* passwd start.sh
+ rm -rf home/ passwd start.sh
}
export LANG=C
@@ -16,7 +16,7 @@ name=$(basename ${PWD} | cut -f3- -d '-')
image=linaro/ci-${arch}-${name}-ubuntu:${distro}
top=$(git rev-parse --show-toplevel)
-cp $top/tcwg-base/tcwg-host/authorized_keys-* ./
+rsync -aL $top/tcwg-base/tcwg-host/home/ ./home/
cp $top/tcwg-base/tcwg-host/passwd ./
cp $top/tcwg-base/tcwg-host/start.sh ./
diff --git a/tcwg-base/tcwg-host/authorized_keys-maxim.kuvyrkov b/tcwg-base/tcwg-host/home/maxim.kuvyrkov/.ssh/authorized_keys
index fa17c380..fa17c380 100644
--- a/tcwg-base/tcwg-host/authorized_keys-maxim.kuvyrkov
+++ b/tcwg-base/tcwg-host/home/maxim.kuvyrkov/.ssh/authorized_keys