Skip to content

Commit

Permalink
feat: upgrade to images of version 1 (rolling tag) (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
webbertakken authored Apr 3, 2022
1 parent 51c34e4 commit 2338dd0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
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

0 comments on commit 2338dd0

Please sign in to comment.