forked from awslabs/ssosync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing mixing github variables in goreleaser builds.
- Loading branch information
1 parent
a22b7a3
commit 5ef4a3e
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
export CI=true | ||
export CodeBuild=true | ||
|
||
export GitBranch=`git symbolic-ref HEAD --short 2>/dev/null` | ||
if [ "$GitBranch" == "" ] ; then | ||
GitBranch=`git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }'` | ||
export GitBranch=${GitBranch#remotes/origin/} | ||
fi | ||
|
||
export GitMessage=`git log -1 --pretty=%B` | ||
export GitAuthor=`git log -1 --pretty=%an` | ||
export GitAuthorEmail=`git log -1 --pretty=%ae` | ||
export GitCommit=`git log -1 --pretty=%H` | ||
export GITTag=`git describe --tags --abbrev=0` | ||
|
||
export GitPullRequest=false | ||
if [[ $GitBranch == pr-* ]] ; then | ||
export GitPullRequest=${GitBranch#pr-} | ||
fi | ||
|
||
export GitProject=${APP_NAME} | ||
export CodeBuildUrl=https://$AWS_DEFAULT_REGION.console.aws.amazon.com/codebuild/home?region=$AWS_DEFAULT_REGION#/builds/$CODEBUILD_BUILD_ID/view/new | ||
|
||
echo "==> AWS CodeBuild Extra Environment Variables:" | ||
echo "==> CI = $CI" | ||
echo "==> CodeBuild = $CodeBuild" | ||
echo "==> GitAuthor = $GitAuthor" | ||
echo "==> GitAuthorEmail = $GitAuthorEmail" | ||
echo "==> GitBranch = $GitBranch " | ||
echo "==> GitCommit = $GitCommit" | ||
echo "==> GitMessage = $GitMessage" | ||
echo "==> GitTag = $GITTag" | ||
echo "==> GitProject = $GitProject" | ||
echo "==> GitPullRequest = $GitPullRequest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- .goreleaser.yml 2022-06-15 08:38:24.000000000 +0100 | ||
+++ .goreleaser-codebuild.yml 2022-06-21 12:33:43.000000000 +0100 | ||
@@ -22,7 +22,7 @@ | ||
- goos: windows | ||
goarch: 386 | ||
ldflags: | ||
- - -s -w -X github.com/awslabs/ssosync/cmd.version={{.Version}} -X github.com/awslabs/ssosync/cmd.commit={{.Commit}} -X github.com/awslabs/ssosync/cmd.date={{.Date}} -X github.com/awslabs/ssosync/cmd.builtBy=goreleaser | ||
+ - -s -w -X github.com/awslabs/ssosync/cmd.version={{.Env.GitTag}} -X github.com/awslabs/ssosync/cmd.commit={{.Env.GitCommit}} -X github.com/awslabs/ssosync/cmd.date={{.Date}} -X github.com/awslabs/ssosync/cmd.builtBy=goreleaser -X github.com/awslabs/ssosync/cmd.goversion={{.Env.GoVersion}} | ||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
changelog: |