diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..66f423483357b07688a430fe06e84f93ec585dba --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,92 @@ +stages: + - build + - test + - package + - deploy + +build: + stage: build + image: node:12.7-alpine + only: + - master + before_script: + - npm install -g @angular/cli@8.3.26 + - npm ci + script: + - ng build + artifacts: + paths: + - dist/ + expire_in: 1 hours + cache: + paths: + - node_modules/ + tags: + - kubernetes + - register-front + +# unit_test: +# stage: test +# image: node:latest +# only: +# - master +# before_script: +# - apt-get update +# - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +# - apt-get install -y ./google-chrome-stable_current_amd64.deb +# - export CHROME_BIN=/usr/bin/google-chrome +# - npm install -g @angular/cli@8.3.26 +# - npm ci +# script: +# - ng test +# tags: +# - kubernetes +# - register-front + +# e2e_test: +# stage: test +# image: trion/ng-cli-e2e +# only: +# - master +# allow_failure: false +# before_script: +# - npm ci +# script: +# - ng e2e +# tags: +# - kubernetes +# - register-front + +package: + stage: package + image: docker:latest + only: + - master + services: + - docker:dind + before_script: + - version=`cat version` + - echo $version + - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN $CI_REGISTRY + script: + - docker build -t $CI_REGISTRY/$CI_REGISTRY_IMAGE:$version -t $CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_REGISTRY_IMAGE_TAG . + - docker push --all-tags $CI_REGISTRY/$CI_REGISTRY_IMAGE + tags: + - kubernetes + - register-front + +deploy: + stage: deploy + image: bitnami/kubectl:latest + only: + - master + before_script: + - mkdir .kube/ + - echo -n $KUBE_CONFIG | base64 -d > .kube/config + script: + # - kubectl --kubeconfig .kube/config --namespace $KUBE_NAMESPACE set image deployment/$KUBE_DEPLOYMENT $KUBE_CONTAINER=$CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_REGISTRY_IMAGE_TAG + - kubectl --kubeconfig .kube/config --namespace $KUBE_NAMESPACE rollout restart deployment/$KUBE_DEPLOYMENT + tags: + - kubernetes + - register-front diff --git a/karma.conf.js b/karma.conf.js index 41a25682cfaf99e8037ed4919b3b938cd4bcf07e..b3cff13ffa372862436e3f745442feca2f76e9f0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -25,8 +25,14 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], - singleRun: false, + browsers: ['ChromeHeadlessNoSandbox'], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + } + }, + singleRun: true, restartOnFileChange: true }); }; diff --git a/src/app/authentication/admin/account.admin.component.spec.ts b/src/app/authentication/admin/account.admin.component.spec.ts index 70787e000eb853d82fd01377a7d2fea98b6990d0..f8044239c5921d6f80235c257dda38c115d98eb7 100644 --- a/src/app/authentication/admin/account.admin.component.spec.ts +++ b/src/app/authentication/admin/account.admin.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { Account.AdminComponent } from './account.admin.component'; +import { AccountAdminComponent } from './account.admin.component'; -describe('Account.AdminComponent', () => { - let component: Account.AdminComponent; - let fixture: ComponentFixture<Account.AdminComponent>; +describe('AccountAdminComponent', () => { + let component: AccountAdminComponent; + let fixture: ComponentFixture<AccountAdminComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ Account.AdminComponent ] + declarations: [ AccountAdminComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(Account.AdminComponent); + fixture = TestBed.createComponent(AccountAdminComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/authentication/services/auth.guard.spec.ts b/src/app/authentication/services/auth.guard.spec.ts index 68889d22d920e3b78febae9e5d323c717887961e..b16067c532571cb1c35e988264d9bf921d762942 100644 --- a/src/app/authentication/services/auth.guard.spec.ts +++ b/src/app/authentication/services/auth.guard.spec.ts @@ -1,13 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { AuthGuard } from './auth.guard'; +import { AuthGuardService } from './auth.guard'; -describe('AuthGuard', () => { - let guard: AuthGuard; +describe('AuthGuardService', () => { + let guard: AuthGuardService; beforeEach(() => { TestBed.configureTestingModule({}); - guard = TestBed.inject(AuthGuard); + guard = TestBed.inject(AuthGuardService); }); it('should be created', () => { diff --git a/src/app/elasticsearch/elasticsearch.component.ts b/src/app/elasticsearch/elasticsearch.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..b2f9e2abd79c85e602a86902596d960d56f1c376 --- /dev/null +++ b/src/app/elasticsearch/elasticsearch.component.ts @@ -0,0 +1,50 @@ +import { Component, OnInit } from '@angular/core'; +import { AppConfiguration } from '../AppConfiguration'; +import { HttpClient } from '@angular/common/http'; +import { FileSaverService } from 'ngx-filesaver'; +import { FormControl} from '@angular/forms'; +import { FormGroup} from '@angular/forms'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment.prod'; + +@Component({ + selector: 'app-elasticsearch', + templateUrl: './elasticsearch.component.html', + styleUrls: ['./elasticsearch.component.scss'] +}) +export class ElasticsearchComponent implements OnInit { + + + Form = new FormGroup({ + elasticurl: new FormControl(), +}); + + constructor( + private appConfig: AppConfiguration, + private http: HttpClient, + private _FileSaverService: FileSaverService + ) {} + + ngOnInit() { + this.Form.setValue({ + elasticurl: this.appConfig.elasticurl , + }); + } + + + SaveElasticsearchSetting() { + let data: string; + data ='\ + {\n\ + "fdpurl": "'+ this.appConfig.fdpurl +'", \n\ + "fdpemail": "'+ this.appConfig.fdpemail +'", \n\ + "fdppassword": "'+ this.appConfig.fdppassword +'", \n\ + "elasticurl": "'+ this.Form.value.elasticurl +'", \n\ + "smartapiurl": "'+ this.appConfig.smartapiurl +'" \n\ + }' + console.log(data); + return this.http.post("https://"+environment.apiurl+"/api/setting", data,{responseType: 'text'}).subscribe( (r)=>{console.log(r)}) ; + }; + + +} diff --git a/src/app/publishapi/publishapi.component.spec.ts b/src/app/publishapi/publishapi.component.spec.ts index 90a0f3a94d89f3da8ac1a56862e817c744738005..9199320cf19527d781cb8a688d8f414982fb8be9 100644 --- a/src/app/publishapi/publishapi.component.spec.ts +++ b/src/app/publishapi/publishapi.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { PublishapiComponent } from './publishapi.component'; +import { PublishApiComponent } from './publishapi.component'; -describe('PublishapiComponent', () => { - let component: PublishapiComponent; - let fixture: ComponentFixture<PublishapiComponent>; +describe('PublishApiComponent', () => { + let component: PublishApiComponent; + let fixture: ComponentFixture<PublishApiComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PublishapiComponent ] + declarations: [ PublishApiComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(PublishapiComponent); + fixture = TestBed.createComponent(PublishApiComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/swaggereditor/swaggereditor.component.ts b/src/app/swaggereditor/swaggereditor.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..9cc524ec632a405530fe2f46b610669d49c21f6f --- /dev/null +++ b/src/app/swaggereditor/swaggereditor.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; + + +declare const SwaggerEditorBundle: any; +declare const SwaggerEditorStandalonePreset: any; + +@Component({ + selector: 'app-swaggereditor', + templateUrl: './swaggereditor.component.html', + styleUrls: ['./swaggereditor.component.scss'] +}) +export class SwaggereditorComponent implements OnInit { + + + constructor() { } + +ngOnInit(): void { + const editor = SwaggerEditorBundle({ + dom_id: '#swagger-editor', + layout: 'StandaloneLayout', + presets: [ + SwaggerEditorStandalonePreset + ], + url: 'https://rackerlabs.github.io/wadl2swagger/openstack/swagger/dbaas.json' + }); +} + +} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 6b547d4efd3da0fe2ade884853be3b58de53d1ea..888c5f3919440d3d4e8c8d016e69489ed43a8cc5 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,5 +1,9 @@ export const environment = { production: true, +<<<<<<< HEAD smartharvesterUrl: 'https://f2ds.eosc-pillar.eu', fdpUrl: 'https://f2ds.eosc-pillar.eu' +======= + apiurl: 'f2ds.eosc-pillar.eu', +>>>>>>> 204b4c8a0b9295ded53eabe75800df493c9b253b }; diff --git a/version b/version new file mode 100644 index 0000000000000000000000000000000000000000..5edcff03642dbdd807897066639be8d0038fefb1 --- /dev/null +++ b/version @@ -0,0 +1 @@ +v16 \ No newline at end of file