Skip to content

Commit

Permalink
Merge pull request #21 for aah CLI v0.12.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm authored Aug 18, 2018
2 parents 5660eeb + 37e23ab commit 5eecd18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
13 changes: 8 additions & 5 deletions aah/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,14 @@ func isAuthSchemeSupported(authScheme string) bool {
func checkAndGenerateInitgoFile(importPath, baseDir string) {
initGoFile := filepath.Join(baseDir, "app", "init.go")
if !ess.IsFileExists(initGoFile) {
cliLog.Warn("***** In v0.10 'init.go' file introduced to evolve aah framework." +
" Since its not found, generating 'init.go' file. Please add it to your version control. *****\n")
cliLog.Warn("***** In aah v0.10 'init.go' file introduced to evolve aah framework." +
" Since its not found, generating 'init.go' file. Please add 'init.go' into VCS. *****\n")

aahToolsPath := aahToolsPath()
appTemplatePath := filepath.Join(aahToolsPath.Dir, "app-template")
appTmplBaseDir := inferAppTmplBaseDir()
if ess.IsStrEmpty(appTmplBaseDir) {
aahToolsPath := aahToolsPath()
appTmplBaseDir = filepath.Join(aahToolsPath.Dir, "app-template")
}
appType := typeAPI
if ess.IsFileExists(filepath.Join(baseDir, "views")) {
appType = typeWeb
Expand All @@ -514,7 +517,7 @@ func checkAndGenerateInitgoFile(importPath, baseDir string) {
}

processFile(baseDir, file{
src: filepath.Join(appTemplatePath, "app", "init.go.atmpl"),
src: filepath.Join(appTmplBaseDir, "app", "init.go.atmpl"),
dst: filepath.Join(baseDir, "app", "init.go"),
}, data)
}
Expand Down
10 changes: 5 additions & 5 deletions aah/publish_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ echo "Publish for version: $version"

# Build for macOS
echo "Starting aah CLI build for macOS"
build_dir="/tmp/aah_cli_mac_$version"
build_dir="/tmp/aah-cli-mac-$version"
mkdir -p $build_dir
env GOOS=darwin GOARCH=amd64 go build -o $build_dir/aah -ldflags="-s -w -X main.CliPackaged=true"
cd $build_dir && zip aah_darwin_amd64.zip aah
cd $build_dir && zip aah-darwin-amd64.zip aah

# sha256 and upload to aah server
sha256=$(/usr/bin/shasum -a 256 $build_dir/aah_darwin_amd64.zip | cut -d " " -f 1)
sha256=$(/usr/bin/shasum -a 256 $build_dir/aah-darwin-amd64.zip | cut -d " " -f 1)
echo "sha256 $sha256"
echo "Uploading aah CLI macOS binary to aah server"
ssh [email protected] "mkdir -p /srv/www/aahframework.org/public/releases/cli/$version"
scp $build_dir/aah_darwin_amd64.zip [email protected]:/srv/www/aahframework.org/public/releases/cli/$version
scp $build_dir/aah-darwin-amd64.zip [email protected]:/srv/www/aahframework.org/public/releases/cli/$version

# update homebrew tap
echo "Updating Homebrew Tap for macOS"
if [ ! -d "$GOPATH/src/github.com/go-aah/homebrew-tap" ]; then
git clone [email protected]:go-aah/homebrew-tap.git $GOPATH/src/github.com/go-aah/homebrew-tap
fi
cd $GOPATH/src/github.com/go-aah/homebrew-tap
sed -i '' -e 's/cli\/.*\/aah_darwin_amd64.zip/cli\/'"$version"'\/aah_darwin_amd64.zip/g' ./Formula/aah.rb
sed -i '' -e 's/cli\/.*\/aah-darwin-amd64.zip/cli\/'"$version"'\/aah-darwin-amd64.zip/g' ./Formula/aah.rb
sed -i '' -e 's/sha256 ".*"/sha256 "'"$sha256"'"/g' ./Formula/aah.rb
sed -i '' -e 's/version ".*"/version "'"$version"'"/g' ./Formula/aah.rb
git add -u && git commit -m "brew tap update with $version release" && git push
Expand Down
2 changes: 1 addition & 1 deletion aah/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// Version no. of aah framework CLI tool
const Version = "0.12.1"
const Version = "0.12.2"

var (
errVersionNotExists = errors.New("version not exists")
Expand Down

0 comments on commit 5eecd18

Please sign in to comment.