diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..fc9970dd547b4efb8f01662083a45713ca37e62d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +image: docker.doit.wisc.edu/registrar/angular-cli-builder:1.2.0 + + +variables: + S3_BUCKET_NAME: dev-enroll-app-frontend + DEV_CFDIST_ID: E2LLRLV3LNB0E3 + +stages: + - build +# - test + - deploy + +build: + stage: build + script: + - npm install + - ng build --prod --base-href /degree-planner + - ng lint + +#test: +# stage: test +# script: +# - npm install +# - ng build --prod + + +deploy: + stage: deploy + script: + - npm install + - ng build --prod --base-href /degree-planner + - aws s3 sync --acl public-read --sse --delete dist/course-search-enroll-fe s3://$S3_BUCKET_NAME + - aws configure set preview.cloudfront true + - aws cloudfront create-invalidation --distribution-id $DEV_CFDIST_ID --paths '/*' + only: + - master@adi-ia/course-search-enroll-fe diff --git a/package.json b/package.json index 8440b26ee0a252d4cb6b785a0e925c07128b24b7..f44e9d9bd4b600151f2cedda7cdf40907248b7a9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", - "build-prod": "npm version patch && node ./update-version.js && ng build --prod" + "build-prod": "npm version patch && node ./update-version.js" }, "private": true, "dependencies": { diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 67ad4915fb5e72a4a919e21bd3218dc1d8edc8fe..f7ade398f9b1aaedbe67a3ce499efbda23a906c7 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -4,12 +4,13 @@ import { Router, RouterModule, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; -import { HomeComponent } from './home/home.component'; import { AppRoutingModule } from './app.routing.module'; const routes: Routes = [ - { path: '', pathMatch: 'full', redirectTo: 'home', }, - { path: 'home', component: HomeComponent } + { + path: '', + loadChildren: './degree-planner/degree-planner.module#DegreePlannerModule' + } ]; @Component({ @@ -29,8 +30,7 @@ describe('AppComponent', () => { imports: [RouterModule, RouterTestingModule.withRoutes(routes)], schemas: [ NO_ERRORS_SCHEMA ], declarations: [ - AppComponent, - HomeComponent + AppComponent ], }).compileComponents(); })); @@ -39,17 +39,7 @@ describe('AppComponent', () => { const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); - it(`should have as title 'Angular Starter'`, async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app'); - })); - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Angular Starter'); - })); + it('should render title in a router-outlet tag', async(() => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); diff --git a/src/app/core/navigation/navigation.component.html b/src/app/core/navigation/navigation.component.html index f346cac2b9d65b8f22a932ef0a0240cc2e55dd68..d95dd8271f70a6715b3ca332b56e35ba82794991 100644 --- a/src/app/core/navigation/navigation.component.html +++ b/src/app/core/navigation/navigation.component.html @@ -5,4 +5,4 @@ <a mat-tab-link routerLink="/degree-planner" routerLinkActive="active" >Degree Planner</a> </nav> -<router-outlet></router-outlet> +