Skip to content

Commit cca3d01

Browse files
committed
Optionally use sudo in make targets
as workaround to docker setting root permissions on mounted files
1 parent 27c5b31 commit cca3d01

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ install:
1212
- make deps
1313

1414
script:
15-
- make check
15+
- make check NGSDN_TUTORIAL_SUDO=sudo

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ onos_url := http://localhost:8181/onos
2424
onos_curl := curl --fail -sSL --user onos:rocks --noproxy localhost
2525
app_name := org.onosproject.ngsdn-tutorial
2626

27+
NGSDN_TUTORIAL_SUDO ?=
28+
2729
default:
2830
$(error Please specify a make target (see README.md))
2931

@@ -85,13 +87,13 @@ netcfg:
8587
@echo
8688

8789
reset: stop
88-
-rm -rf ./tmp
90+
-$(NGSDN_TUTORIAL_SUDO) rm -rf ./tmp
8991

9092
clean:
91-
-rm -rf p4src/build
92-
-rm -rf app/target
93-
-rm -rf app/src/main/resources/bmv2.json
94-
-rm -rf app/src/main/resources/p4info.txt
93+
-$(NGSDN_TUTORIAL_SUDO) rm -rf p4src/build
94+
-$(NGSDN_TUTORIAL_SUDO) rm -rf app/target
95+
-$(NGSDN_TUTORIAL_SUDO) rm -rf app/src/main/resources/bmv2.json
96+
-$(NGSDN_TUTORIAL_SUDO) rm -rf app/src/main/resources/p4info.txt
9597

9698
deep-clean: clean
9799
-docker container rm ${app_build_container_name}
@@ -157,11 +159,11 @@ solution-apply:
157159
rsync -r solution/ ./
158160

159161
solution-revert:
160-
rm -rf ./app
161-
rm -rf ./p4src
162-
rm -rf ./ptf
162+
$(NGSDN_TUTORIAL_SUDO) rm -rf ./app
163+
$(NGSDN_TUTORIAL_SUDO) rm -rf ./p4src
164+
$(NGSDN_TUTORIAL_SUDO) rm -rf ./ptf
163165
cp -r working_copy/* ./
164-
rm -rf working_copy/
166+
$(NGSDN_TUTORIAL_SUDO) rm -rf working_copy/
165167

166168
check:
167169
make reset

0 commit comments

Comments
 (0)