fix issue when finding language-image file

Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
Luca Stocchi 2020-11-13 12:55:02 +01:00
parent 3043388d5b
commit 2168b4e067
No known key found for this signature in database
GPG key ID: 930BB00F3FCF30A4
6 changed files with 15 additions and 5 deletions

View file

@ -1 +1,8 @@
In testing
# buildah
Buildah is a GitHub Action for building OCI-compatible (Docker- and Kubernetes-compatible) images quickly and easily.
Buildah action works only on Linux distributions, and it is not supported on Windows or Mac platforms at this time.
Note that GitHub's [Ubuntu Environments](https://github.com/actions/virtual-environments#available-environments) (ubuntu-20.04 and ubuntu-18.04) come with buildah 1.17.0 installed. So, if you are not using those Ubuntu environments you need to make sure to install buildah tool in an early step.

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

3
dist/language-image.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"java": "docker.io/fabric8/java-alpine-openjdk11-jre"
}

View file

@ -100,7 +100,7 @@ function getSuggestedBaseImage(languages) {
function getBaseImageByLanguage(language) {
return __awaiter(this, void 0, void 0, function* () {
// eslint-disable-next-line no-undef
const rawData = yield fs_1.promises.readFile(path.join(__dirname, 'language-image.json'), 'utf-8');
const rawData = yield fs_1.promises.readFile(path.join(__dirname, '..', 'language-image.json'), 'utf-8');
const languageImageJSON = JSON.parse(rawData);
return languageImageJSON[language.name];
});

View file

@ -97,7 +97,7 @@ async function getSuggestedBaseImage(languages: Language[]): Promise<string> {
async function getBaseImageByLanguage(language: Language): Promise<string> {
// eslint-disable-next-line no-undef
const rawData = await fs.readFile(path.join(__dirname, 'language-image.json'), 'utf-8');
const rawData = await fs.readFile(path.join(__dirname, '..', 'language-image.json'), 'utf-8');
const languageImageJSON = JSON.parse(rawData);
return languageImageJSON[language.name];
}