Skip to content

Commit

Permalink
feat: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Jan 12, 2019
1 parent c632280 commit 5866fa8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/controller/gw.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ class GwController extends Controller {
async index() {
const ctx = this.ctx;
const { state = BUILD_STATE_SUCCESS, ...data } = ctx.request.body;
// TODO remove
const jobName = ctx.safeGet(data, 'environment.ci.JOB_NAME')
|| ctx.safeGet(data, 'environment.gitlab_ci.JOB_NAME');
const buildNumber = ctx.safeGet(data, 'environment.ci.BUILD_NUMBER')
|| ctx.safeGet(data, 'environment.gitlab_ci.BUILD_NUMBER');

const jobName = ctx.safeGet(data, 'environment.ci.JOB_NAME');
const buildNumber = ctx.safeGet(data, 'environment.ci.BUILD_NUMBER');

if (!jobName || !buildNumber) {
ctx.fail('ERR_RELIABLE_INVALID_PARAM_ERROR', 'environment.ci.JOB_NAME and environment.ci.BUILD_NUMBER are required.');
return;
Expand Down

0 comments on commit 5866fa8

Please sign in to comment.