Chore: Toolkit fixes to use toolkit for release (#24951)

* Various fixes and requests for toolkit:
1) Added toolkit to the alpine docker image, so we can get latest fixes without having to re-release
2) Removed cp from e2d docker image
3) Change github client to allow to specify an owner so it's not "grafana" only
4) Toolkit refers to grafana-ui and grafana-data "next", rather than canary

* added toolkit to e2e docker image

* Added tools to the e2e image for building/deploying oracle

* added shasum

* removing toolkit from images
This commit is contained in:
Stephanie Closson
2020-05-21 09:41:15 -06:00
committed by GitHub
parent ff465396ab
commit b7d5912ca8
15 changed files with 194 additions and 39 deletions
@@ -1,6 +1,6 @@
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
const grafanaURL = (repo: string) => `https://api.github.com/repos/grafana/${repo}`;
const grafanaURL = (owner: string, repo: string) => `https://api.github.com/repos/${owner}/${repo}`;
const enterpriseURL = 'https://api.github.com/repos/grafana/grafana-enterprise';
// Encapsulates the creation of a client for the Github API
@@ -14,18 +14,19 @@ const enterpriseURL = 'https://api.github.com/repos/grafana/grafana-enterprise';
interface GithubClientProps {
required?: boolean;
enterprise?: boolean;
owner?: string;
repo?: string;
}
class GithubClient {
client: AxiosInstance;
constructor({ required = false, enterprise = false, repo = 'grafana' }: GithubClientProps = {}) {
constructor({ required = false, enterprise = false, owner = 'grafana', repo = 'grafana' }: GithubClientProps = {}) {
const username = process.env.GITHUB_USERNAME;
const token = process.env.GITHUB_ACCESS_TOKEN;
const clientConfig: AxiosRequestConfig = {
baseURL: enterprise ? enterpriseURL : grafanaURL(repo),
baseURL: enterprise ? enterpriseURL : grafanaURL(owner, repo),
timeout: 10000,
};
@@ -41,6 +41,7 @@ class GitHubRelease {
this.git = new GithubClient({
required: true,
owner: username,
repo: repository,
});
}
@@ -57,6 +58,7 @@ class GitHubRelease {
'Content-Type': resolveContentType(path.extname(file)),
'Content-Length': fileStat.size,
},
maxContentLength: fileStat.size * 2 * 1024 * 1024,
});
});
}