diff --git a/README.md b/README.md index 307dac0..5c9f7d2 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ -# GOTA +# About gota [![Go Report Card](https://goreportcard.com/badge/github.com/bzon/gota)](https://goreportcard.com/report/github.com/bzon/gota) [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/bzon/gota) [![GitHub tag](https://img.shields.io/github/tag/bzon/gota.svg)](https://github.com/bzon/gota/releases/) -Automate the beta testing distribution of your Android and iOS application files with gota. +Automate the beta testing distribution of your Android and iOS application files. -Gota is a [Golang](http://golang.org/) powered Over the Air Installation site creation command line tool. +__gota__ is a just command line tool that you can easily integrate in your current continuous integration workflow with tools such as Fastlane. ![](./docs/gota_workflow.png) -## Features Checklist +__gota__ automatically detects the build information of your ipa or apk files and creates an OTA (over the air) installation site that is uploaded to your desired hosting server. -Supported Static Website Hosting Service +|Android |iOS | +|---------------------------------|-------------------------------| +|![](./docs/samplesite_android.png)|![](./docs/samplesite_ios.png)| + +## Supported Static Hosting Service * [x] Amazon S3 Bucket * [x] Nexus 3 Site Repository @@ -20,13 +24,17 @@ Supported Static Website Hosting Service * [ ] Standalone Gota Server * [ ] Nexus 2 Site Repository -## Installation +## Getting Started + +### Installation -Get the executable binary for your platform from the [Release Page](https://github.com/bzon/gota/releases/). Currently, Linux, macOS and Windows are supported. +Get the executable binary for your platform from the [Release Page](https://github.com/bzon/gota/releases/). + +Currently, Linux, macOS and Windows are supported. If you have Go installed, just run `go get github.com/bzon/gota`. -## User Guide +### Help Flags To see the required flags, use the --help flag. @@ -36,12 +44,7 @@ gota nexus --help gota s3 --help ``` -Gota creates a `gotalink.txt` and `ipalink.txt` (if uploading an ipa) that contains the url or direct download link. - -If you are using a CI server, you can have it read these files for quickly getting the url that you can send to your team. - -### Upload to S3 Bucket - +### Uploading to S3 Bucket ```bash # set the aws credentials @@ -60,7 +63,7 @@ export AWS_SECRET_ACCESS_KEY=xxxxx __NOTE__: Currently, gota assigns an AES256 encryption and a public-read ACL to all files that are uploaded. This may change to be configurable in the future. -### Upload to Nexus +### Uploading to Nexus The repository must be a [Raw Site Repository](https://help.sonatype.com/repomanager3/raw-repositories-and-maven-sites). @@ -83,6 +86,10 @@ file uploaded: http://localhost:8081/repository/site/nexus_android_repo/1.0.0/10 __NOTE__: Currently supports only Nexus 3. +### Extra Features + +__gota__ creates a `gotalink.txt` and `ipalink.txt` (if uploading an ipa) that contains the url or direct download link. If you are using a CI server, you can have it read these files for quickly getting the url that you can send to your team. + ### Site Directory Layout ```bash @@ -96,14 +103,7 @@ destDir \__index.html ``` -## Development Setup - -### Build and Test - -```bash -go get -v ./... -go test -v ./... -``` +## Developers If you are on Windows, ensure to go get spf13/cobra's dependency for it. @@ -113,7 +113,7 @@ go get -v ./... go test -v ./... ``` -### S3 Feature Test +### Testing S3 Feature Set these environment variables before running `go test` in s3 package. @@ -123,7 +123,7 @@ AWS_SECRET_ACCESS_KEY=xxxxx GOTEST_AWS_BUCKET=example-bucket ``` -### Nexus Feature Test +### Testing Nexus Feature You must have a Nexus 3 server running in your machine. @@ -131,7 +131,7 @@ Get it easily via docker command: `docker run -d -p 8081:8081 --name nexus3`. Then, create a Raw Repository with a repository id `site`. -## Inspirations and References +## Motivation * [Fastlane Nexus Upload](https://docs.fastlane.tools/actions/nexus_upload/) * [Fastlane S3 Plugin](https://github.com/joshdholtz/fastlane-plugin-s3/) diff --git a/docs/apk_nexus_uploaded.png b/docs/apk_nexus_uploaded.png deleted file mode 100644 index b9a6481..0000000 Binary files a/docs/apk_nexus_uploaded.png and /dev/null differ diff --git a/docs/gota_html.png b/docs/gota_html.png deleted file mode 100644 index 4068333..0000000 Binary files a/docs/gota_html.png and /dev/null differ diff --git a/docs/ios_nexus_uploaded.png b/docs/ios_nexus_uploaded.png deleted file mode 100644 index f4524e3..0000000 Binary files a/docs/ios_nexus_uploaded.png and /dev/null differ diff --git a/docs/samplesite_android.png b/docs/samplesite_android.png new file mode 100644 index 0000000..1c6e4ae Binary files /dev/null and b/docs/samplesite_android.png differ diff --git a/docs/samplesite_ios.png b/docs/samplesite_ios.png new file mode 100644 index 0000000..761a0c5 Binary files /dev/null and b/docs/samplesite_ios.png differ diff --git a/parser/parser.go b/parser/parser.go index a647d51..85def1a 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -51,6 +51,11 @@ type MobileApp struct { DownloadURL string PlistURL htmltemp.URL File string + Changelogs []Changelog +} + +type Changelog struct { + Author, Date, Subject string } // GenerateAssets creates the site assets that will be uploaded along with the ipa or apk file diff --git a/parser/parser_test.go b/parser/parser_test.go index 0fa430a..4ca4299 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -48,6 +48,18 @@ func TestGenerateAssets(t *testing.T) { app.UploadDate = time.Now().Format(time.RFC1123) app.AppInfo = appInfo app.File = tc.file + app.Changelogs = []Changelog{ + { + Date: time.Now().Format(time.RFC1123), + Author: "doge@doge.com", + Subject: "Dico delectus facilisi cum ad, est soluta populo ne.", + }, + { + Date: time.Now().Add(-24 * time.Hour).Format(time.RFC1123), + Author: "cat@cat.com", + Subject: "Sed ipsum congue quaestio ei, eu mundi iudico accusamus vix.", + }, + } if err := app.GenerateAssets(); err != nil { t.Fatal(err) } diff --git a/parser/templates.go b/parser/templates.go index c98d77f..f9c02de 100644 --- a/parser/templates.go +++ b/parser/templates.go @@ -63,96 +63,140 @@ const plistTemplateString = ` ` -var indexHTMLTemplateString = ` - - - - Install {{.Name}} - - - +var indexHTMLTemplateString = ` + + + + + + + + + +
+ +
+
+ +
{{.Name}}
+
+
+ + + {{if .IsIOS -}} + + + + + + + + + {{else -}} + + + + + + + + + {{end -}} + + + + + + + + + +
CFBundleShortVersion{{.Version}}
CFBundleVersion{{.Build}}
Version Name{{.Version}}
Version Code{{.Build}}
Bundle ID{{.BundleId}}
Upload Date{{.UploadDate}}
+
-

{{.Name}}

- - {{if .IsIOS -}} - -
- - - Install {{.Name}} {{.Version}} ({{.Build}}) - -
-

Uploaded on {{.UploadDate}}

-
-
- -

- App is being installed. Close your Browser using the home button. -

- {{- else}} - -
- - - Install {{.Name}} {{.Version}} ({{.Build}}) - -
-

Uploaded on {{.UploadDate}}

-
-
- -

- App is being installed. You might have to close the browser. -

- - {{- end}} -

- This is a beta version and is not meant for the public. -

- - - -` +
+ {{if .IsIOS -}} + + Install + + {{else -}} + + Install + + {{end -}} +
+
+ +
+
+ + + + + + + + + + + {{range .Changelogs}} + + + + + + {{end}} + +
DateAuthorSubject
{{.Date}}{{.Author}}{{.Subject}}
+
+ + +`