Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade to images of version 1 (rolling tag) #84

Merged
merged 1 commit into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ fi
yarn lint-staged
yarn lint
yarn test

yarn build
git add dist
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/model/image-tag.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('ImageTag', () => {
it('returns the correct version', () => {
const image = new ImageTag('2099.1.1111', '');

expect(image.toString()).toStrictEqual(`unityci/editor:2099.1.1111-linux-il2cpp-0`);
expect(image.toString()).toStrictEqual(`unityci/editor:ubuntu-2099.1.1111-linux-il2cpp-1`);
});
});
});
13 changes: 7 additions & 6 deletions src/model/image-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ class ImageTag {
}

get tag() {
return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
const dockerRepoVersion = 1;

const versionAndTargetPlatform = `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');

return `ubuntu-${versionAndTargetPlatform}-${dockerRepoVersion}`;
}

get image() {
Expand All @@ -113,12 +117,9 @@ class ImageTag {
toString() {
const { image, tag, customImage } = this;

if (customImage && customImage !== '') {
return customImage;
}
if (customImage) return customImage;

const dockerRepoVersion = 0;
return `${image}:${tag}-${dockerRepoVersion}`;
return `${image}:${tag}`;
}
}

Expand Down