Started reimplementing scheduler
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
ORG_ID=Shuffle
|
||||
ENVIRONMENT_NAME=Shuffle
|
||||
|
||||
# Different locations etc
|
||||
APP_DOWNLOAD_LOCATION=https://github.com/frikky/shuffle-apps
|
||||
APP_DOWNLOAD_AUTH_USERNAME=""
|
||||
APP_DOWNLOAD_AUTH_PASSWORD=""
|
||||
|
||||
# Other configs
|
||||
BACKEND_HOSTNAME=shuffle-backend
|
||||
BACKEND_PORT=5010
|
||||
|
||||
+22
-3
@@ -51,6 +51,7 @@ import (
|
||||
// Web
|
||||
// "github.com/gorilla/handlers"
|
||||
"github.com/gorilla/mux"
|
||||
http2 "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
|
||||
// Old items (cloud)
|
||||
// "google.golang.org/appengine"
|
||||
// "google.golang.org/appengine/memcache"
|
||||
@@ -5658,9 +5659,27 @@ func runInit(ctx context.Context) {
|
||||
log.Printf("Apps: loading TEST")
|
||||
fs := memfs.New()
|
||||
storer := memory.NewStorage()
|
||||
r, err := git.Clone(storer, fs, &git.CloneOptions{
|
||||
URL: "https://github.com/frikky/shuffle-apps",
|
||||
})
|
||||
|
||||
url := os.Getenv("APP_DOWNLOAD_LOCATION")
|
||||
if len(url) == 0 {
|
||||
url = "https://github.com/frikky/shuffle-apps"
|
||||
}
|
||||
|
||||
username := os.Getenv("APP_DOWNLOAD_AUTH_USERNAME")
|
||||
password := os.Getenv("APP_DOWNLOAD_AUTH_PASSWORD")
|
||||
cloneOptions := &git.CloneOptions{
|
||||
URL: url,
|
||||
}
|
||||
|
||||
if len(username) > 0 && len(password) > 0 {
|
||||
cloneOptions.Auth = &http2.BasicAuth{
|
||||
Username: username,
|
||||
Password: password,
|
||||
}
|
||||
}
|
||||
log.Printf("Getting apps from %s", url)
|
||||
|
||||
r, err := git.Clone(storer, fs, cloneOptions)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Failed loading repo into memory: %s", err)
|
||||
|
||||
@@ -39,6 +39,7 @@ services:
|
||||
environment:
|
||||
- ORG_ID=${ORG_ID}
|
||||
- DATASTORE_EMULATOR_HOST=shuffle-database:8000
|
||||
- APP_DOWNLOAD_LOCATION=${APP_DOWNLOAD_LOCATION}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- database
|
||||
|
||||
Reference in New Issue
Block a user