0

I am running this .yml file

kind: pipeline
type: docker
name: default

steps:
- name: test
  image: ubuntu
  commands:
  - apt-get update
  - apt-get install git -y
  - ./build.sh bin

first, two commands are running correctly but in the last command it fails and the drone doesn't give me a message ![drone messages get while testing][1]

This fails after echo if1

PROJECT_PATH=$PWD
RUN=$1
ENVIRONMENT=${ENVIRONMENT:="local"}
if [ "$ENVIRONMENT" == "local" ]; then
    echo if1
    GIT_AUTHOR="$(git config --global --get user.name)"
    GIT_AUTHOR_EMAIL="$(git config --global --get user.email)"
    GIT_VERSION="$(git describe --tags --always --dirty)"
    VERSION=$GIT_VERSION
    echo endif
else
    echo else1
    DRONE_COMMIT_SHORT=${DRONE_COMMIT:0:8}
    VERSION=${DRONE_TAG:=$DRONE_COMMIT_SHORT}
    echo endelse
``

  [1]: https://i.stack.imgur.com/ChrUo.png

1 Answers1

-1

You need shebang

#!/usr/bin/env bash

Your bash