gitlab-ci build fails on assigning bash variable
build-snipppet:
$ echo $(git log --oneline | head -n1)
3e430a7 MyCommitMessage
$ echo $(git log --oneline | head -n1 | sed 's/^\([0-9a-f]*\).*/\1/g')
3e430a7
$ commit=SomeValue
$ commit=$(echo fe38d50)
$ commit=$(git log --oneline | head -n1 | sed 's/^\([0-9a-f]*\).*/\1/g')
ERROR: Build failed: exit code 1
Why does this build fail?
How did I get here: I want to get the commit id (and message and date) to write them into a config file before we deploy (using gitlab ci), so that we can see what version of the webpage is currently deployed.