diff --git a/Dockerfile b/Dockerfile index e4b424e12..5b7b82bd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,10 @@ RUN rm -fr pipy/build \ && npm install \ && npm run build \ && cd build \ - && cmake -DPIPY_GUI=OFF -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release .. \ + && export CI_COMMIT_SHA \ + && export CI_COMMIT_TAG=${VERSION}-${REVISION} \ + && export CI_COMMIT_DATE \ + && cmake -DPIPY_GUI=ON -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release .. \ && make -j$(getconf _NPROCESSORS_ONLN) \ && mkdir ${pkg_confdir} \ && cp /pipy/bin/pipy ${pkg_bindir} \ @@ -43,7 +46,6 @@ COPY --from=builder /pipy/bin/pipy /usr/local/bin/pipy COPY --from=builder /etc/pipy /etc/pipy RUN apk add --no-cache ca-certificates libstdc++ libcap su-exec tar curl busybox-extras iptables tzdata socat logrotate RUN adduser -Su 1340 pipy \ - && setcap cap\_net\_admin=eip /usr/local/bin/pipy \ && chmod -R g=u /usr/local/bin/pipy /etc/pipy \ && chown -R pipy:0 /usr/local/bin/pipy /etc/pipy diff --git a/build.sh b/build.sh index 92707f5f6..566f22b40 100755 --- a/build.sh +++ b/build.sh @@ -34,7 +34,7 @@ TEST_CASE=all IMAGE_TAG=${IMAGE_TAG:-latest} DOCKERFILE=${DOCKERFILE:-Dockerfile} -PIPY_GUI=${PIPY_GUI:-OFF} +PIPY_GUI=${PIPY_GUI:-ON} PIPY_TUTORIAL=${PIPY_TUTORIAL:-ON} ##### End Default environment variables ######### @@ -137,7 +137,7 @@ function build() { git pull origin $BRANCH export CC=clang export CXX=clang++ - cd ${PIPY_DIR}/gui + cd ${PIPY_DIR} npm install npm run build mkdir ${PIPY_DIR}/build 2>&1 > /dev/null || true @@ -210,6 +210,7 @@ if ! $TEST_ONLY && $BUILD_RPM; then fi if ! $TEST_ONLY && $BUILD_CONTAINER; then + cd $PIPY_DIR if [ "x"$RELEASE_VERSION != "x" ]; then IMAGE_TAG=$RELEASE_VERSION sudo docker build --rm -t pipy-oss:$IMAGE_TAG \ @@ -217,10 +218,10 @@ if ! $TEST_ONLY && $BUILD_CONTAINER; then --build-arg REVISION=$REVISION \ --build-arg COMMIT_ID=$COMMIT_ID \ --build-arg COMMIT_DATE="$COMMIT_DATE" \ - -f $DOCKERFILE $PIPY_DIR + -f $DOCKERFILE . else - sudo docker build --rm -t pipy-oss:$IMAGE_TAG -f $DOCKERFILE $PIPY_DIR + sudo docker build --rm -t pipy-oss:$IMAGE_TAG -f $DOCKERFILE . fi fi diff --git a/rpm/pipy.spec b/rpm/pipy.spec index bc0d1ca59..38934c062 100644 --- a/rpm/pipy.spec +++ b/rpm/pipy.spec @@ -27,7 +27,7 @@ cd pipy npm install npm run build cd build -CXX=clang++ CC=clang cmake3 -DPIPY_GUI=OFF -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release .. +CXX=clang++ CC=clang cmake3 -DPIPY_GUI=ON -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release .. make -j$(getconf _NPROCESSORS_ONLN) %preun @@ -47,11 +47,9 @@ getent passwd pipy >/dev/null || useradd -r -g pipy -G pipy -d /etc/pipy -s /sbi mkdir -p %{buildroot}%{prefix}/bin mkdir -p %{buildroot}/etc/pipy cp pipy/bin/pipy %{buildroot}%{prefix}/bin -cp -r pipy/etc/* %{buildroot}/etc/ chrpath --delete %{buildroot}%{prefix}/bin/pipy %post -systemctl daemon-reload %postun if [ $1 -eq 0 ] ; then @@ -63,10 +61,5 @@ rm -rf %{buildroot} %files %attr(755, pipy, pipy) %{prefix}/bin/pipy -%attr(755, pipy, pipy) /etc/pipy/ -%attr(644, root, root) /etc/systemd/system/pipy.service -%attr(644, root, root) /etc/sysconfig/pipy - -%config /etc/pipy/pipy.js %changelog