satis icon indicating copy to clipboard operation
satis copied to clipboard

No Ansi flag not respected

Open magikid opened this issue 6 years ago • 5 comments

What I did

I'm running satis in Jenkins with the command /satis/bin/satis build --no-interaction --no-ansi composer.json /build/out

What I expected to happen

I expected there to be no ansi control characters in the the output.

What actually happened

I get the following output with ansi control characters:

[0m [91m
Reading composer.json of 99designs/phumbor (0.1.0)
 [0m [91m
 [0m [91mReading composer.json of 99designs/phumbor (0.1.1) [0m [91m
Reading composer.json of 99designs/phumbor (0.1.2) [0m [91m
Reading composer.json of 99designs/phumbor (0.1.3) [0m [91m
Reading composer.json of 99designs/phumbor (1.0.0) [0m [91m
Reading composer.json of 99designs/phumbor (1.0.1) [0m [91m
Reading composer.json of 99designs/phumbor (1.0.2) [0m [91m
Reading composer.json of 99designs/phumbor (1.1.0) [0m [91m
Reading composer.json of 99designs/phumbor (1.2.0) [0m [91m
Reading composer.json of 99designs/phumbor (1.2.1) [0m [91m
Reading composer.json of 99designs/phumbor (1.2.2) [0m [91m
 [0m [91mReading composer.json of 99designs/phumbor (cloneable-url-builder) [0m [91m
Reading composer.json of 99designs/phumbor (fix-urlencoding)
 [0m [91m
Reading composer.json of 99designs/phumbor (master)
 [0m [91mReading composer.json of squizlabs/php_codesniffer (1.3.1) 

magikid avatar Aug 02 '19 14:08 magikid

I'm using the composer/satis:latest docker image to build.

magikid avatar Aug 02 '19 14:08 magikid

It might be related to https://github.com/composer/composer/issues/8153

antonkomarev avatar Aug 02 '19 14:08 antonkomarev

Possibly but in this case, I'm not using any scripts. I can't post my full composer.json but I can post most of it.

{
    "name": "corp/satis-repo",
    "homepage": "https://satis.corp.com",
    "repositories": [
        { "type": "composer", "url": "http://corp-satis" },
        { "type": "vcs", "url": "corp-bit-bucket/repo-name1" },
        { "type": "vcs", "url": "corp-bit-bucket/repo-name2" },
    ],
    "require": {
        "package1": "*",
        "package2": "^1.4",
    }
    "require-dev-dependencies": true,
    "archive": {
        "directory": "dist",
        "format": "tar"
    },
    "config": {
        "secure-http": false
    }
}

We have about 30 repositories and about 100 packages listed.

magikid avatar Aug 05 '19 15:08 magikid

How are you running satis in jenkins? Can you elaborate more on this?

alcohol avatar Aug 06 '19 07:08 alcohol

I'm using Jenkins to build a satis container. It builds the image using the following docker build command:

docker build -t docker.corp.com/magikid/my-satis:master.$GIT_COMMIT-my-satis -t docker.corp.com/magikid/my-satis:latest -f ./Dockerfile --build-arg BUILD_SSH_KEY=./id_rsa --no-cache --network host ./

And here's the dockerfile that Jenkins is building:

FROM composer/satis:latest as build

WORKDIR /build
RUN apk update --no-cache \
    && apk add --no-cache --virtual buildDeps openssl openssl-dev \
    && echo "Generating dhparams" \
    && openssl dhparam -out dhparam.pem 2048 2>/dev/null \
    && apk del buildDeps

# add credentials on build
RUN mkdir /root/.ssh/
ARG BUILD_SSH_KEY
ADD $BUILD_SSH_KEY /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa

# make sure your domain is accepted
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan -p 7999 owl.corp.com >> /root/.ssh/known_hosts

ADD composer.json .
RUN /satis/bin/satis build --no-interaction --no-ansi composer.json /build/out

FROM nginx:alpine
COPY --from=build /build/out /usr/share/nginx/html
COPY --from=build /build/dhparam.pem /etc/nginx/dhparam.pem
ADD nginx.conf /etc/nginx/nginx.conf

Once the container is built, it pushes it to our internal docker hub and deploys it out to our docker swarm using docker service update.

magikid avatar Aug 06 '19 13:08 magikid