openshift-s2i / s2i-wildfly

Source-to-Image template for WildFly applications
http://wildfly.org/
Other
73 stars 145 forks source link

hack/build.sh: line 78: conditional binary operator expected #133

Closed SergioArrighi closed 7 years ago

SergioArrighi commented 7 years ago

Hello, I'm trying to run make command on mac (OS version 10.12.5, bash version 4.4). When running: make build VERSION=10.1 I get: SKIP_SQUASH=0 VERSIONS="8.1 9.0 10.0 10.1" OS=centos7 VERSION=10.1 BASE_IMAGE_NAME=wildfly OPENSHIFT_NAMESPACES="8.1 9.0 10.0 10.1" hack/build.sh hack/build.sh: line 78: conditional binary operator expected I suspect there is an incompatibility level with mac OS. Could you please advice? Best regards

bparees commented 7 years ago

try switching it to single brackets:

if [ -v TEST_MODE ]; then

you'll have to do the same for the other instances of double brackets.

@csrwng is this a mac bash thing?

SergioArrighi commented 7 years ago

Hello thanks, I managed to progress but still I have an error

SKIP_SQUASH=0 VERSIONS="8.1 9.0 10.0 10.1" OS=centos7 VERSION=10.1 BASE_IMAGE_NAME=wildfly OPENSHIFT_NAMESPACES="8.1 9.0 10.0 10.1" hack/build.sh hack/build.sh: line 78: [: -v: unary operator expected -> Building openshift/wildfly-101-centos7 ... Sending build context to Docker daemon 1.363MB Step 1/15 : FROM openshift/base-centos7 ---> 4842f0bd3d61 Step 2/15 : MAINTAINER Ben Parees bparees@redhat.com ---> Using cache ---> b3f27467a32a Step 3/15 : EXPOSE 8080 ---> Using cache ---> 46b001fa77e1 Step 4/15 : ENV WILDFLY_VERSION 10.1.0.Final MAVEN_VERSION 3.3.9 ---> Using cache ---> 611b10085d70 Step 5/15 : LABEL io.k8s.description "Platform for building and running JEE applications on WildFly 10.1.0.Final" io.k8s.display-name "WildFly 10.1.0.Final" io.openshift.expose-services "8080:http" io.openshift.tags "builder,wildfly,wildfly10" io.openshift.s2i.destination "/opt/s2i/destination" com.redhat.deployments-dir "/wildfly/standalone/deployments" ---> Using cache ---> 6a4aeeafdff0 Step 6/15 : RUN INSTALL_PKGS="tar unzip bc which lsof java-1.8.0-openjdk java-1.8.0-openjdk-devel" && yum install -y --enablerepo=centosplus $INSTALL_PKGS && rpm -V $INSTALL_PKGS && yum clean all -y && (curl -v https://www.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -zx -C /usr/local) && ln -sf /usr/local/apache-maven-$MAVEN_VERSION/bin/mvn /usr/local/bin/mvn && mkdir -p $HOME/.m2 && mkdir -p /wildfly && (curl -v https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz | tar -zx --strip-components=1 -C /wildfly) && mkdir -p /opt/s2i/destination ---> Using cache ---> 0f3363d4158c Step 7/15 : ADD ./contrib/wfmodules/ /wildfly/modules/ ---> Using cache ---> dc88f0f2533c Step 8/15 : ADD ./contrib/wfbin/standalone.conf /wildfly/bin/standalone.conf ---> Using cache ---> 49ef2d22850f Step 9/15 : ADD ./contrib/wfcfg/standalone.xml /wildfly/standalone/configuration/standalone.xml ---> Using cache ---> ee0c48ad8b9a Step 10/15 : ADD ./contrib/settings.xml $HOME/.m2/ ---> Using cache ---> 54fb6a65cec0 Step 11/15 : COPY ./s2i/bin/ $STI_SCRIPTS_PATH ---> Using cache ---> 7f633cbbb35d Step 12/15 : RUN chown -R 1001:0 /wildfly && chown -R 1001:0 $HOME && chmod -R ug+rw /wildfly && chmod -R g+rw /opt/s2i/destination ---> Using cache ---> 134c3deaff1f Step 13/15 : USER 1001 ---> Using cache ---> 7e94d7dc7017 Step 14/15 : CMD $STI_SCRIPTS_PATH/usage ---> Using cache ---> ae33273bfa3a Step 15/15 : LABEL io.openshift.builder-version "6299cb9" ---> Using cache ---> 1390fb674baa Successfully built 1390fb674baa Successfully tagged openshift/wildfly-101-centos7:latest hack/build.sh: line 58: /Users/****/.local/bin/docker-squash: No such file or directory make: [build] Error 1

Still have this: line 78: [: -v: unary operator expected And this: hack/build.sh: line 58: /Users/***/.local/bin/docker-squash: No such file or directory

Any idea? Thanks and best regards

bparees commented 7 years ago

can you update your repo? i've removed all the squashing logic, it should work for you now.

bparees commented 7 years ago

it also uses -z instead of -v now which should be mac friendly.

SergioArrighi commented 7 years ago

It worked like a charm! Thanks a lot and sorry for bothering you ;) Best regards

bparees commented 7 years ago

np, thanks for helping us get it cleaned up.