Merge pull request #1687 from biblesyme/cicd-engine-fix-3_2

Pipeline bug fix
This commit is contained in:
Vincent Fiduccia 2018-03-02 11:19:11 -07:00 committed by GitHub
commit 54aa8d3334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 39 additions and 34 deletions

View File

@ -20,9 +20,9 @@ export default Component.extend({
}.property('registryFiled'),
state: {
registries: [],
imageRegistry: 'index.docker.io',
imageRepo: '${CI_PIPELINE_REPOSITORY_NAME}',
imageTag: '${CI_PIPELINE_REPOSITORY_BRANCH}',
imageRegistry: '',
imageRepo: '',
imageTag: '',
registryExist: true,
savingRegistry: false,
},
@ -47,7 +47,7 @@ export default Component.extend({
})),
observer: observer('state.imageRepo','state.imageTag','state.imageRegistry',function(){
let state = this.get('state');
let registryField = this.get('registryFiled');
let registryField = this.get('registryField');
let repoName = `${state.imageRepo}:${state.imageRepo}`;
if(registryField&&state.imageRegistry!=='index.docker.io'){
repoName = `${state.imageRegistry}/${repoName}`

View File

@ -35,7 +35,7 @@
</div>
</div>
<div class="col span-12">
<button class="btn bg-primary" {{action "saveRegistry"}} disabled={{state.savingRegistry}}>
<button class="btn bg-primary" {{action "saveRegistry"}} disabled={{or state.imageRegistry state.savingRegistry}}>
{{#if state.savingRegistry}}
<i class="icon icon-spin icon-spinner"></i>
{{/if}}

View File

@ -40,7 +40,7 @@ class StepType {
this.publishImageConfig = val&&val.publishImageConfig||{
"dockerfilePath": "./Dockerfile",
"buildContext": ".",
"tag": "index.docker.io/${CI_PIPELINE_REPOSITORY}:${CI_BRANCH}"
"tag": ""
};
break;
default:
@ -82,7 +82,10 @@ var validationErrors = (module) => {
if (!config.tag||config.tag.trim() === '') {
errors.push('"Image Tag" is required!');
}
if (!config.dockerFilePath||config.dockerFilePath.trim() === '') {
if (!config.buildContext||config.buildContext.trim() === '') {
errors.push('"Image Tag" is required!');
}
if (!config.dockerfilePath||config.dockerfilePath.trim() === '') {
errors.push('"Dockerfile Path" is required!');
}
break;

View File

@ -9,6 +9,22 @@ export default Component.extend({
let step = this.get('step');
console.log(step);
}.observes('step.state'),
dateNow: null,
dateInterval: null,
didInsertElement(){
this._super(...arguments);
Ember.run.once(()=>{
var interval = window.setInterval(()=>{
this.set('dateNow',Date.now())
},1000);
this.set('dateInterval',interval);
});
},
willDestroyElement(){
this._super(...arguments);
var interval = this.get('dateInterval');
interval&&window.clearInterval(interval);
},
actions: {
showLogs: function(stageIndex,stepIndex){
this.sendAction('showLogsActivity',this.get('activity'), stageIndex,stepIndex)

View File

@ -13,22 +13,6 @@ export default Ember.Component.extend({
expandFn:function(/*item*/) {
// item.toggleProperty('expanded');
},
dateNow: null,
dateInterval: null,
didInsertElement(){
this._super(...arguments);
Ember.run.once(()=>{
var interval = window.setInterval(()=>{
this.set('dateNow',Date.now())
},1000);
this.set('dateInterval',interval);
});
},
willDestroyElement(){
this._super(...arguments);
var interval = this.get('dateInterval');
interval&&window.clearInterval(interval);
},
actions: {
sendAction: function (model, action) {
return model.send(action)

View File

@ -34,7 +34,7 @@
</td>
<td data-title="{{dt.repository}}" class="clip text-muted">
<p class="mt-10 mb-5">{{inst.repository}}</p>
<p class="mt-5 mb-10"><b>{{inst.branchConditionLabel}}</b> {{inst.branch}}</p>
<p class="mt-5 mb-10"><b>{{inst.branchConditionLabel}}</b> {{#if (not-eq inst.branchConditionLabel 'All branches')}}{{inst.branch}}{{/if}}</p>
</td>
<td data-title="{{dt.runCount}}" class="clip text-muted">
{{#if inst.lastExecutionId}}

View File

@ -9,5 +9,5 @@ export default Component.extend({
return conditionEnum&&conditionEnum.label||'';
}
return '';
}.property('model.sourceCodeConfig.branch')
}.property('model.sourceCodeConfig.branchCondition')
});

View File

@ -2,7 +2,7 @@
{{#if model.sourceCodeConfig}}
{{#tooltip-element style="100%;" inlineBlock=true type="tooltip-basic" tooltipTemplate="tooltip-static" model=model.sourceCodeConfig.url tagName="span" tooltipFor="tooltip-basic"}}
<p class="mt-0 mb-0 clip" style="width: 100%;">{{model.sourceCodeConfig.url}}</p>
<p class="text-small mt-0 mb-0 clip italian text-italic" style="width: 100%;"><b>{{branchCondition}}</b> {{model.sourceCodeConfig.branch}}</p>
<p class="text-small mt-0 mb-0 clip italian text-italic" style="width: 100%;"><b>{{branchCondition}}</b> {{#if (not-eq model.sourceCodeConfig.branchCondition 'all')}}{{model.sourceCodeConfig.branch}}{{/if}}</p>
{{/tooltip-element}}
{{/if}}

View File

@ -8,6 +8,6 @@ export default Component.extend({
publishImageConfig: alias('selectedModel.publishImageConfig'),
init(){
this._super();
this.get('publishImageConfig').tag||this.set('publishImageConfig.tag','${CICD_GIT_REPOSITORY_NAME}:${CICD_GIT_BRANCH}');
this.get('publishImageConfig').tag||this.set('publishImageConfig.tag','');
},
});

View File

@ -16,7 +16,7 @@ export default Component.extend({
activity_stages.forEach(ele=>{
let initialStepIndex = 0;
let initialStageIndex = 0;
if(ele.status === 'Waiting'){
if(ele.executionState === 'Waiting'){
initialStepIndex = -1;
initialStageIndex = -1;
}
@ -33,7 +33,7 @@ export default Component.extend({
var activity_stages = this.get('filteredPipelineHistory');
for (var i = 0; i < activity_stages.length; i++) {
var item = activity_stages[i];
if(item.status === 'Waiting'){
if(item.executionState === 'Waiting'){
this.get('logStatus').objectAt(i).setProperties({
stepIndex: -1,
stageIndex: -1,
@ -41,5 +41,5 @@ export default Component.extend({
});
}
}
}.observes('filteredPipelineHistory.@each.status'),
}.observes('filteredPipelineHistory.@each.executionState'),
});

View File

@ -81,7 +81,7 @@ let PipelineExecution = Resource.extend({
if (commitInfo) {
return commitInfo.substr(0, 8)
}
return
return '';
}.property('commitInfo'),
repository: function() {
return this.get('pipeline.stages')[0].steps[0].sourceCodeConfig.url

View File

@ -24,7 +24,9 @@ export function analyzeImageRepo (images) {
let repo = '';
for (var i = 0; i < splited.length-1; i++) {
let item = splited[i];
repo += item + '/';
if(item.indexOf('.')===-1){
repo += item + '/';
}
}
repo+=repoAndTag[0];
output.repository = repo;

View File

@ -41,7 +41,7 @@ pipelinesPage:
nextRun: NextRun
awaitingWebhook: Awaiting Webhook
triggerManually: Trigger Manually
notDeployed: Pipeline is not enabled, click <a href="{route}" target="_blank">here</a> to enable Pipline
notDeployed: Pipeline is not enabled, click <a href="{route}">here</a> to enable Pipline
pipelinesSetting:
gitAuthentication: Git Authentication
authenticateWithGit: Authenticate with git repository

View File

@ -6,7 +6,7 @@ export default Component.extend({
layout,
app: service(),
scope: service(),
app: service(),
classNames: ['row border-dash'],
showNew: true,
disabled: false,