Fork me on GitHub
#off-topic
<
2015-08-04
>
martinklepsch16:08:03

Would like to do something like below in circle ci — anyone an idea?

machine:
  environment:
    SHA: echo $CIRCLE_SHA1 | cut -c1-7

mikeholmesuk16:08:36

Does $CIRCLE_SHA1:1:7} work for you?

martinklepsch16:08:17

@mikeholmesuk: should one of those : be the opening {?

mikeholmesuk16:08:02

Sorry, good spot ${CIRCLE_SHA1:1:7}

martinklepsch16:08:25

Inserting something like this also worked: $(echo $CIRCLE_SHA1 | cut -c1-7)

martinklepsch16:08:31

but will try your suggestion

martinklepsch16:08:05

@mikeholmesuk: sweet that worked. didn’t know that this ${} thing exists simple_smile

mikeholmesuk16:08:03

Yeah, I think I stumbled across it myself. Glad it worked for you though - happy to help 😄