forked from aws/eks-distro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and major refactor of make for releases (aws#722)
* Removed KUBE_GIT_VERSION_FILE code for releases * Fix and major refactor of make for releases * Fixed broken func * Commiting to see if problem fixed * Did dumb things * Fixed weird go issue * Finally got number working * Last commit was a lie * Fixed docs * Docs were, in fact, not fixed * Removed comment out stuff and ran go fmt * Updated comment explaining docs * Minor clean up
- Loading branch information
Kirsten Schumy
authored
Feb 17, 2022
1 parent
cb7936b
commit 44d6813
Showing
22 changed files
with
328 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package internal | ||
|
||
import ( | ||
. "../../utils" | ||
"fmt" | ||
"io/ioutil" | ||
"path/filepath" | ||
"strings" | ||
) | ||
|
||
var ( | ||
gitRootDirectory = GetGitRootDirectory() | ||
|
||
READMEPath = filepath.Join(gitRootDirectory, "README.md") | ||
|
||
docsContentsDirectory = filepath.Join(gitRootDirectory, "docs/contents") | ||
DocsIndexPath = filepath.Join(docsContentsDirectory, "index.md") | ||
) | ||
|
||
// GetKubernetesReleaseGitTag returns the trimmed value of Kubernetes release GIT_TAG | ||
func GetKubernetesReleaseGitTag(releaseBranch string) (string, error) { | ||
fileOutput, err := ioutil.ReadFile(fmt.Sprintf("%s/projects/kubernetes/release/%s/GIT_TAG", gitRootDirectory, releaseBranch)) | ||
if err != nil { | ||
return "", err | ||
} | ||
return strings.TrimSpace(string(fileOutput)), nil | ||
} | ||
|
||
// formatReleaseDocsDirectory returns path to the directory for the docs' directory for provided release. | ||
// Expects branch and number to be non-empty values. Returned path is not guaranteed to exist or be valid. | ||
func formatReleaseDocsDirectory(branch, number string) string { | ||
return filepath.Join(docsContentsDirectory, FormatRelativeReleaseDocsDirectory(branch, number)) | ||
} | ||
|
||
// FormatRelativeReleaseDocsDirectory return relative path to (example: "releases/1-20/1"). | ||
// Expects branch and number to be non-empty values. | ||
func FormatRelativeReleaseDocsDirectory(branch, number string) string { | ||
return filepath.Join("releases", branch, number) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package internal | ||
|
||
import ( | ||
. "../../internal" | ||
. "../../pull_request" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.