Use wulkanowy manager api

This commit is contained in:
Mikołaj Pich 2021-10-30 16:11:46 +02:00
parent 558f4e7605
commit 9ba5aad183

View file

@ -57,14 +57,14 @@
}, },
methods: { methods: {
async loadMaster() { async loadMaster() {
const redirectorUrl = 'https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/develop/artifacts/0/info'; const redirectorUrl = 'https://manager.wulkanowy.net.pl/v1/build/app/daeff1893f3c8128/branch/develop';
const build = await this.$http.get(redirectorUrl); const build = await this.$http.get(redirectorUrl);
this.master = { this.master = {
released: build.body.finished_at, released: build.body.data.finished_at,
download: build.body.public_install_page_url, download: `https://manager.wulkanowy.net.pl/v1/download/app/daeff1893f3c8128/build/${build.body.data.build_slug}/artifact/${build.body.data.artifact_slug}`,
build: build.body.build_number, build: build.body.data.build_number,
url: build.body.build_url, url: build.body.data.build_url,
commitUrl: build.body.commit_view_url, commitUrl: build.body.data.commit_view_url,
}; };
}, },
async loadMore() { async loadMore() {
@ -74,16 +74,27 @@
const response = await this.$http.get(this.moreLink); const response = await this.$http.get(this.moreLink);
this.versions.push( this.versions.push(
...(await Promise.all(response.body.map(async (release) => { ...(await Promise.all(response.body.map(async (release) => {
const redirectorUrl = `https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/${release.head.ref}/artifacts/0/info`; const redirectorUrl = `https://manager.wulkanowy.net.pl/v1/build/app/daeff1893f3c8128/branch/${release.head.ref}`;
const build = await this.$http.get(redirectorUrl).catch((error) => error); const build = await this.$http.get(redirectorUrl).catch((error) => error);
if (!build.body.success) {
return {
title: release.title,
number: release.number,
github: release.html_url,
avatar: release.user.avatar_url,
user: release.user.login,
commit: release.head.sha,
id: release.id,
};
}
return { return {
title: release.title, title: release.title,
number: release.number, number: release.number,
released: build.body.finished_at,
github: release.html_url, github: release.html_url,
download: build.body.public_install_page_url, released: build.body.data.finished_at,
url: build.body.build_url, download: `https://manager.wulkanowy.net.pl/v1/download/app/daeff1893f3c8128/build/${build.body.data.build_slug}/artifact/${build.body.data.artifact_slug}`,
build: build.body.build_number, url: build.body.data.build_slug,
build: build.body.data.build_number,
avatar: release.user.avatar_url, avatar: release.user.avatar_url,
user: release.user.login, user: release.user.login,
commit: release.head.sha, commit: release.head.sha,