Skip to content

Commit

Permalink
Refactor, docs update and directory update
Browse files Browse the repository at this point in the history
* Update documentation
* Added the build number for the nexus folder creation for the assets
* Added the download link to the html appicon image
* Use log instead of fmt for printing output in cobra
  • Loading branch information
John Bryan Sazon committed Apr 25, 2018
1 parent e1b60bb commit d52a3bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ Upload an APK file to a Nexus Site Repository
--destDir android \
--srcFile pkg/resources/DarkSouls.apk \

uploaded to nexus: http://localhost:8081/repository/site/android/version.json
uploaded to nexus: http://localhost:8081/repository/site/android/1.0.0.10222333/index.html
uploaded to nexus: http://localhost:8081/repository/site/android/1.0.0.10222333/DarkSouls.apk
file uploaded: http://localhost:8081/repository/site/nexus_android_repo/1.0.0/10222333/appicon.png
file uploaded: http://localhost:8081/repository/site/nexus_android_repo/version.json
file uploaded: http://localhost:8081/repository/site/nexus_android_repo/1.0.0/10222333/index.html
file uploaded: http://localhost:8081/repository/site/nexus_android_repo/1.0.0/10222333/DarkSouls.apk
```

You should now be able to install the APK file from your Android Phone by accessing the http://localhost:8081/repository/site/android/1.0.0.10222333/index.html URL.
Access the index.html file url from your Android device!

Uploaded site structure

Expand All @@ -61,13 +62,14 @@ Upload an IPA file to a Nexus Site Repository
--destDir ios \
--srcFile pkg/resources/DarkSouls.ipa \

uploaded to nexus: http://localhost:8081/repository/site/ios/version.json
uploaded to nexus: http://localhost:8081/repository/site/ios/1.0.0.1/DarkSouls.plist
uploaded to nexus: http://localhost:8081/repository/site/ios/1.0.0.1/index.html
uploaded to nexus: http://localhost:8081/repository/site/ios/1.0.0.1/DarkSouls.ipa
file uploaded: http://localhost:8081/repository/site/nexus_ios_repo/1.0.0/4/appicon.png
file uploaded: http://localhost:8081/repository/site/nexus_ios_repo/version.json
file uploaded: http://localhost:8081/repository/site/nexus_ios_repo/1.0.0/4/index.html
file uploaded: http://localhost:8081/repository/site/nexus_ios_repo/1.0.0/4/DarkSouls.ipa
file uploaded: http://localhost:8081/repository/site/nexus_ios_repo/1.0.0/4/app.plist
```

You should now be able to install the IPA file from your iPhone by accessing the http://localhost:8081/repository/site/ios/1.0.0.1/index.html URL.
Access the index.html file url from your iPhone device!

Uploaded site structure

Expand Down
3 changes: 1 addition & 2 deletions cmd/nexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cmd

import (
"fmt"
"log"
"os"

Expand All @@ -39,7 +38,7 @@ var nexusCmd = &cobra.Command{
log.Fatal(err)
}
for _, v := range assets {
fmt.Println("nexus asset url:", v)
log.Println("file uploaded:", v)
}
},
}
Expand Down
6 changes: 3 additions & 3 deletions nexus/nexus_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func (n *Nexus) getRepoURL() string {
// NexusUploadAssets uploads the generated files by the parser package along with the ipa or apk file
func (n *Nexus) NexusUploadAssets(app *parser.MobileApp, dir string) ([]string, error) {
// create the site path names and assume the url before uploaded for templating
appIconPath := app.Version + "/" + parser.AppIconFile
appSitePath := app.Version + "/" + filepath.Base(app.File)
appIndexHTMLSitePath := app.Version + "/" + parser.IndexHTMLFile
appIconPath := app.Version + "/" + app.Build + "/" + parser.AppIconFile
appSitePath := app.Version + "/" + app.Build + "/" + filepath.Base(app.File)
appIndexHTMLSitePath := app.Version + "/" + app.Build + "/" + parser.IndexHTMLFile
app.DownloadURL = n.getRepoURL() + "/" + dir + "/" + appSitePath

// default directory of assets
Expand Down
3 changes: 2 additions & 1 deletion parser/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ var indexHTMLTemplateString = `<html>
</style>
<h1 style="text-align: center;">{{.Name}}</h1>
<img src="appicon.png" id="appIcon">
{{if .IsIOS -}}
<a href="{{.PlistURL}}"><img src="appicon.png" id="appIcon"></a>
<div class="oneRow">
<span class="download" id="ios">
<a href="itms-services://?action=download-manifest&amp;url={{.PlistURL}}" id="text" class="btn btn-lg btn-default" onclick="document.getElementById('finished').id = '';">
Expand All @@ -109,6 +109,7 @@ var indexHTMLTemplateString = `<html>
App is being installed. Close your Browser using the home button.
</p>
{{- else}}
<a href="{{.DownloadURL}}"><img src="appicon.png" id="appIcon"></a>
<div class="oneRow">
<span class="download" id="android">
<a href="{{.DownloadURL}}" id="text" class="btn btn-lg btn-default" onclick="document.getElementById('finished').id = '';">
Expand Down

0 comments on commit d52a3bb

Please sign in to comment.