mirror of https://github.com/rancher/ui.git
Merge pull request #1687 from biblesyme/cicd-engine-fix-3_2
Pipeline bug fix
This commit is contained in:
commit
54aa8d3334
|
|
@ -20,9 +20,9 @@ export default Component.extend({
|
||||||
}.property('registryFiled'),
|
}.property('registryFiled'),
|
||||||
state: {
|
state: {
|
||||||
registries: [],
|
registries: [],
|
||||||
imageRegistry: 'index.docker.io',
|
imageRegistry: '',
|
||||||
imageRepo: '${CI_PIPELINE_REPOSITORY_NAME}',
|
imageRepo: '',
|
||||||
imageTag: '${CI_PIPELINE_REPOSITORY_BRANCH}',
|
imageTag: '',
|
||||||
registryExist: true,
|
registryExist: true,
|
||||||
savingRegistry: false,
|
savingRegistry: false,
|
||||||
},
|
},
|
||||||
|
|
@ -47,7 +47,7 @@ export default Component.extend({
|
||||||
})),
|
})),
|
||||||
observer: observer('state.imageRepo','state.imageTag','state.imageRegistry',function(){
|
observer: observer('state.imageRepo','state.imageTag','state.imageRegistry',function(){
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
let registryField = this.get('registryFiled');
|
let registryField = this.get('registryField');
|
||||||
let repoName = `${state.imageRepo}:${state.imageRepo}`;
|
let repoName = `${state.imageRepo}:${state.imageRepo}`;
|
||||||
if(registryField&&state.imageRegistry!=='index.docker.io'){
|
if(registryField&&state.imageRegistry!=='index.docker.io'){
|
||||||
repoName = `${state.imageRegistry}/${repoName}`
|
repoName = `${state.imageRegistry}/${repoName}`
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-12">
|
<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}}
|
{{#if state.savingRegistry}}
|
||||||
<i class="icon icon-spin icon-spinner"></i>
|
<i class="icon icon-spin icon-spinner"></i>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class StepType {
|
||||||
this.publishImageConfig = val&&val.publishImageConfig||{
|
this.publishImageConfig = val&&val.publishImageConfig||{
|
||||||
"dockerfilePath": "./Dockerfile",
|
"dockerfilePath": "./Dockerfile",
|
||||||
"buildContext": ".",
|
"buildContext": ".",
|
||||||
"tag": "index.docker.io/${CI_PIPELINE_REPOSITORY}:${CI_BRANCH}"
|
"tag": ""
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -82,7 +82,10 @@ var validationErrors = (module) => {
|
||||||
if (!config.tag||config.tag.trim() === '') {
|
if (!config.tag||config.tag.trim() === '') {
|
||||||
errors.push('"Image Tag" is required!');
|
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!');
|
errors.push('"Dockerfile Path" is required!');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,22 @@ export default Component.extend({
|
||||||
let step = this.get('step');
|
let step = this.get('step');
|
||||||
console.log(step);
|
console.log(step);
|
||||||
}.observes('step.state'),
|
}.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: {
|
actions: {
|
||||||
showLogs: function(stageIndex,stepIndex){
|
showLogs: function(stageIndex,stepIndex){
|
||||||
this.sendAction('showLogsActivity',this.get('activity'), stageIndex,stepIndex)
|
this.sendAction('showLogsActivity',this.get('activity'), stageIndex,stepIndex)
|
||||||
|
|
|
||||||
|
|
@ -13,22 +13,6 @@ export default Ember.Component.extend({
|
||||||
expandFn:function(/*item*/) {
|
expandFn:function(/*item*/) {
|
||||||
// item.toggleProperty('expanded');
|
// 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: {
|
actions: {
|
||||||
sendAction: function (model, action) {
|
sendAction: function (model, action) {
|
||||||
return model.send(action)
|
return model.send(action)
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td data-title="{{dt.repository}}" class="clip text-muted">
|
<td data-title="{{dt.repository}}" class="clip text-muted">
|
||||||
<p class="mt-10 mb-5">{{inst.repository}}</p>
|
<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>
|
||||||
<td data-title="{{dt.runCount}}" class="clip text-muted">
|
<td data-title="{{dt.runCount}}" class="clip text-muted">
|
||||||
{{#if inst.lastExecutionId}}
|
{{#if inst.lastExecutionId}}
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,5 @@ export default Component.extend({
|
||||||
return conditionEnum&&conditionEnum.label||'';
|
return conditionEnum&&conditionEnum.label||'';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}.property('model.sourceCodeConfig.branch')
|
}.property('model.sourceCodeConfig.branchCondition')
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{{#if model.sourceCodeConfig}}
|
{{#if model.sourceCodeConfig}}
|
||||||
{{#tooltip-element style="100%;" inlineBlock=true type="tooltip-basic" tooltipTemplate="tooltip-static" model=model.sourceCodeConfig.url tagName="span" tooltipFor="tooltip-basic"}}
|
{{#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="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}}
|
{{/tooltip-element}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ export default Component.extend({
|
||||||
publishImageConfig: alias('selectedModel.publishImageConfig'),
|
publishImageConfig: alias('selectedModel.publishImageConfig'),
|
||||||
init(){
|
init(){
|
||||||
this._super();
|
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','');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export default Component.extend({
|
||||||
activity_stages.forEach(ele=>{
|
activity_stages.forEach(ele=>{
|
||||||
let initialStepIndex = 0;
|
let initialStepIndex = 0;
|
||||||
let initialStageIndex = 0;
|
let initialStageIndex = 0;
|
||||||
if(ele.status === 'Waiting'){
|
if(ele.executionState === 'Waiting'){
|
||||||
initialStepIndex = -1;
|
initialStepIndex = -1;
|
||||||
initialStageIndex = -1;
|
initialStageIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +33,7 @@ export default Component.extend({
|
||||||
var activity_stages = this.get('filteredPipelineHistory');
|
var activity_stages = this.get('filteredPipelineHistory');
|
||||||
for (var i = 0; i < activity_stages.length; i++) {
|
for (var i = 0; i < activity_stages.length; i++) {
|
||||||
var item = activity_stages[i];
|
var item = activity_stages[i];
|
||||||
if(item.status === 'Waiting'){
|
if(item.executionState === 'Waiting'){
|
||||||
this.get('logStatus').objectAt(i).setProperties({
|
this.get('logStatus').objectAt(i).setProperties({
|
||||||
stepIndex: -1,
|
stepIndex: -1,
|
||||||
stageIndex: -1,
|
stageIndex: -1,
|
||||||
|
|
@ -41,5 +41,5 @@ export default Component.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.observes('filteredPipelineHistory.@each.status'),
|
}.observes('filteredPipelineHistory.@each.executionState'),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ let PipelineExecution = Resource.extend({
|
||||||
if (commitInfo) {
|
if (commitInfo) {
|
||||||
return commitInfo.substr(0, 8)
|
return commitInfo.substr(0, 8)
|
||||||
}
|
}
|
||||||
return
|
return '';
|
||||||
}.property('commitInfo'),
|
}.property('commitInfo'),
|
||||||
repository: function() {
|
repository: function() {
|
||||||
return this.get('pipeline.stages')[0].steps[0].sourceCodeConfig.url
|
return this.get('pipeline.stages')[0].steps[0].sourceCodeConfig.url
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ export function analyzeImageRepo (images) {
|
||||||
let repo = '';
|
let repo = '';
|
||||||
for (var i = 0; i < splited.length-1; i++) {
|
for (var i = 0; i < splited.length-1; i++) {
|
||||||
let item = splited[i];
|
let item = splited[i];
|
||||||
repo += item + '/';
|
if(item.indexOf('.')===-1){
|
||||||
|
repo += item + '/';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
repo+=repoAndTag[0];
|
repo+=repoAndTag[0];
|
||||||
output.repository = repo;
|
output.repository = repo;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ pipelinesPage:
|
||||||
nextRun: NextRun
|
nextRun: NextRun
|
||||||
awaitingWebhook: Awaiting Webhook
|
awaitingWebhook: Awaiting Webhook
|
||||||
triggerManually: Trigger Manually
|
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:
|
pipelinesSetting:
|
||||||
gitAuthentication: Git Authentication
|
gitAuthentication: Git Authentication
|
||||||
authenticateWithGit: Authenticate with git repository
|
authenticateWithGit: Authenticate with git repository
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export default Component.extend({
|
||||||
layout,
|
layout,
|
||||||
app: service(),
|
app: service(),
|
||||||
scope: service(),
|
scope: service(),
|
||||||
|
app: service(),
|
||||||
classNames: ['row border-dash'],
|
classNames: ['row border-dash'],
|
||||||
showNew: true,
|
showNew: true,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue