aws / aws/aws-sam-cli

BuildMethod: makefile not passing Version parameter

Open
#3,158 9 comments 0 reactions 0 assignees View on GitHub
area/build maintainer/need-followup type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:

https://github.com/kaihendry/aws-sam-gateway-example/blob/master/Makefile#L14 does not appear to embed Version set by

VERSION = $(shell git rev-parse --abbrev-ref HEAD)-$(shell git rev-parse --short HEAD)

### Steps to reproduce:

1. git clone https://github.com/kaihendry/aws-sam-gateway-example.git
2. edit Makefile with your AWS PROFILE
3. `make`

### Observed result:
Version appears unset
![image](https://user-images.githubusercontent.com/765871/128800770-d1eb8699-ea2c-458b-86f9-4af690e24835.png)

### Expected result:

go build -ldflags "-X main.Version=foobar" -o foo
PORT=3000 ./foo &
curl -s localhost:3000 | grep Version

Version: foobar

### Additional environment details (Ex: Arch Linux)

1. OS: I use Arch btw
2. If using SAM CLI, SAM CLI, version 1.27.2
3. AWS region: ap-souteast-1

`Add --debug flag to any SAM CLI commands you are running`

```
2021-08-10 10:50:07,209 | Running workflow 'CustomMakeBuilder'
2021-08-10 10:50:07,209 | Running CustomMakeBuilder:CopySource
2021-08-10 10:50:07,217 | CustomMakeBuilder:CopySource succeeded
2021-08-10 10:50:07,217 | Running CustomMakeBuilder:MakeBuild
2021-08-10 10:50:07,217 | Current Artifacts Directory : /home/hendry/tmp/aws-sam-gateway-example/.aws-sam/build/MainFunction
2021-08-10 10:50:07,218 | executing Make: ['make', '--makefile', '/home/hendry/tmp/aws-sam-gateway-example/Makefile', 'build-MainFunction']
2021-08-10 10:50:07,835 | CustomMakeBuilder:MakeBuild succeeded
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.