Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions app/cmd/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"log"
"net/url"
"os"
"os/exec"
Expand Down Expand Up @@ -45,6 +46,29 @@ new block. If the block already exists, it will update the existing block.
os.Exit(1)
}

// Add as many repo urls as you would like
urls := []string{
"https://gitlab.com/gsei19/nineteen-week/REPO_NAME_HERE",
}
for _, url := range urls {
rp, err := parseHostedGit(url)
if err != nil {
log.Panic(err)
}
fmt.Printf("publishing url %s\n", url)
block, err := learn.API.CreateBlockByRepoName(rp)
if err != nil {
fmt.Printf("Error creating block from learn: %s\n", err)
os.Exit(1)
}
releaseID, err := learn.API.CreateBranchRelease(block.ID, "main")
if err != nil || releaseID == 0 {
fmt.Printf("Release failed. releaseID: %d. Error: %s\n", releaseID, err)
os.Exit(1)
}
fmt.Printf("Block %d:\nreleaseID: %d\n\n", block.ID, releaseID)
}
return
// Start benchmarking the total time spent in publish cmd
startOfCmd := time.Now()

Expand Down