File tree 4 files changed +42
-14
lines changed
4 files changed +42
-14
lines changed Original file line number Diff line number Diff line change
1
+ .bundle /
2
+ .git /
3
+ vendor /
Original file line number Diff line number Diff line change 1
1
* .tgz
2
2
build-dir /buildpacks /*
3
+ .bundle /
4
+ vendor /
Original file line number Diff line number Diff line change @@ -3,3 +3,8 @@ TAG ?= $(shell git rev-parse --abbrev-ref HEAD)
3
3
4
4
build :
5
5
docker build -t " $( IMAGE) :$( TAG) " .
6
+
7
+ test :
8
+ bundle install --deployment
9
+ docker build -t progrium/buildstep .
10
+ bundle exec cucumber --exclude features/apps
Original file line number Diff line number Diff line change @@ -8,21 +8,39 @@ mkdir -p $cache_root
8
8
mkdir -p $buildpack_root
9
9
mkdir -p $build_root /.profile.d
10
10
11
- user_id=$(( RANDOM+ 1000 ))
12
- user_name=" u${user_id} "
11
+ # Use 1000 as default user
12
+ if [[ -n " $DOKKU_RANDOM_USER_ID " ]]; then
13
+ DOKKU_USER_ID=" ${DOKKU_USER_ID:- $((RANDOM+1000))} "
14
+ else
15
+ DOKKU_USER_ID=" ${DOKKU_USER_ID:- 1000} "
16
+ fi
13
17
14
- # Create a random user
15
- /usr/sbin/addgroup --quiet --gid $user_id $user_name
16
- /usr/sbin/adduser --shell /bin/bash \
17
- --disabled-password \
18
- --force-badname \
19
- --no-create-home \
20
- --uid $user_id \
21
- --gid $user_id \
22
- --gecos ' ' \
23
- --quiet \
24
- --home $app_dir \
25
- $user_name
18
+ if [[ " $DOKKU_USER_ID " -ne " 0" ]]; then
19
+ user_id=" $DOKKU_USER_ID "
20
+ user_name=" u${user_id} "
21
+
22
+ echo $' \e [1G----->' " Using $user_name to run an application"
23
+
24
+ # Create a random user
25
+ /usr/sbin/addgroup --quiet --gid $user_id $user_name
26
+ /usr/sbin/adduser --shell /bin/bash \
27
+ --disabled-password \
28
+ --force-badname \
29
+ --no-create-home \
30
+ --uid $user_id \
31
+ --gid $user_id \
32
+ --gecos ' ' \
33
+ --quiet \
34
+ --home $app_dir \
35
+ $user_name
36
+ else
37
+ user_id=" 0"
38
+ user_name=" root"
39
+
40
+ echo $' \e [1G----->' " Using ROOT to run an application (potentially insecure)"
41
+
42
+ /usr/sbin/usermod --home $app_dir root
43
+ fi
26
44
27
45
# Grant the user access to all required paths before
28
46
# running the compile phase as non-privileged user.
You can’t perform that action at this time.
0 commit comments