Commit a2c0e5b5 authored by François Agneray's avatar François Agneray
Browse files

#52 => done

parent 93cb4a3b
Pipeline #4780 passed with stages
in 11 minutes and 24 seconds
......@@ -30,6 +30,7 @@ out-tsc
/e2e/*.map
/typings
/var
/coverage
#--- OTHER ---#
......
stages:
- install
- install_dependencies
- test
- sonar
- build
- dockerize
- deploy
variables:
VERSION: "3.5"
VERSION: "3.6"
SONARQUBE_URL: https://sonarqube.lam.fr
CONTAINER_IMAGE: portus.lam.fr/anis/anis-admin
install:
image: node:13-slim
stage: install
install_dependencies:
image: node:15-slim
stage: install_dependencies
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
policy: pull-push
script:
- yarn global add @angular/cli
- yarn install
- ng build --prod --base-href /admin/
cache:
paths:
- dist
- node_modules
policy: push
only:
refs:
- develop
test:
image: portus.lam.fr/ci-tools/angular-testing:latest
image: node:15-slim
stage: test
script:
- ng test --no-watch
cache:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- dist
- node_modules
- var
policy: pull-push
policy: pull
script:
- apt-get update
- apt-get install -y --no-install-recommends firefox-esr
- yarn global add @angular/cli
- ng test --no-watch --browsers FirefoxHeadlessCI --code-coverage
artifacts:
paths:
- coverage
only:
refs:
- develop
sonar_scanner:
image: portus.lam.fr/ci-tools/sonar-scanner:latest
image: sonarsource/sonar-scanner-cli:latest
stage: sonar
script:
- sonar-scanner
-Dsonar.projectKey=anis-admin
-Dsonar.sources=src
-Dsonar.projectVersion=$VERSION
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN
-Dsonar.exclusions=**.spec.ts
-Dsonar.typescript.lcov.reportPaths=./var/coverage/lcov.info
cache:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
- var
policy: pull
script:
- sonar-scanner
-Dsonar.projectKey=anis-admin
-Dsonar.sources=src
-Dsonar.projectVersion=$VERSION
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN
-Dsonar.exclusions=**.spec.ts
-Dsonar.typescript.lcov.reportPaths=./coverage/client/lcov.info
only:
refs:
- develop
build:
image: docker:stable
image: node:15-slim
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
policy: pull
script:
- docker login -u fagneray -p $PORTUS_TOKEN portus.lam.fr
- docker pull $CONTAINER_IMAGE:latest || true
- docker build --cache-from $CONTAINER_IMAGE:latest -t $CONTAINER_IMAGE:latest .
- docker push $CONTAINER_IMAGE:latest
cache:
- yarn global add @angular/cli
- ng build --prod --base-href /admin/
artifacts:
paths:
- dist
policy: pull
only:
refs:
- develop
dockerize:
image: docker:stable
stage: dockerize
cache: {}
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY/anis/anis-admin/admin:latest || true
- docker build --cache-from $CI_REGISTRY/anis/anis-admin/admin:latest -t $CI_REGISTRY/anis/anis-admin/admin:latest .
- docker push $CI_REGISTRY/anis/anis-admin/admin:latest
only:
refs:
- develop
......@@ -81,6 +101,10 @@ build:
deploy:
image: alpine
stage: deploy
variables:
GIT_STRATEGY: none
cache: {}
dependencies: []
script:
- apk add --update curl
- curl -XPOST $DEV_WEBHOOK
......
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.6.0]
- In progress...
### Changed
- #52: Update dependencies (Angular v11, ngrx v11, ...)
## [3.5.0]
### Added
- #51: Add datasets rights depending on user group
......
......@@ -43,13 +43,13 @@ status:
@docker ps -f name=$(NAME_APP)
test:
@docker exec -ti $(NAME_APP) ng test --no-watch
@docker exec $(NAME_APP) ng test --no-watch --code-coverage
test-watch:
@docker exec -ti $(NAME_APP) ng test
report:
xdg-open var/coverage/index.html
xdg-open coverage/client/index.html
build:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
......
# NewAdminAnis
# Anis Admin
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.18.
[![pipeline status](https://gitlab.lam.fr/anis/anis-admin/badges/develop/pipeline.svg)](https://gitlab.lam.fr/anis/anis-admin/-/commits/develop) [![coverage report](https://gitlab.lam.fr/anis/anis-admin/badges/develop/coverage.svg)](https://gitlab.lam.fr/anis/anis-admin/-/commits/develop)
## Development server
## Introduction
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
AstroNomical Information System is a generic web tool that aims to facilitate the provision of data (Astrophysics), accessible from a database, for the scientific community.
## Code scaffolding
This software allows you to control one or more databases related to astronomical projects and allows access to datasets via URLs.
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
This repository is the `anis-admin` sub-project. It offers a web interface for configuring anis projects.
## Build
ANIS is protected by the CeCILL licence (see LICENCE file at the software root).
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Authors
## Running unit tests
Here is the list of people involved in the development:
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
* `François Agneray` : Laboratoire d'Astrophysique de Marseille (CNRS)
* `Chrystel Moreau` : Laboratoire d'Astrophysique de Marseille (CNRS)
* `Tifenn Guillas` : Laboratoire d'Astrophysique de Marseille (CNRS)
## Running end-to-end tests
## More resources:
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
* [Website](https://anis.lam.fr)
* [Documentation](https://anis.lam.fr/doc/)
## Further help
## Installing and starting the application
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Anis-admin contains a Makefile that helps the developer to install and start the application.
To list all operations availables just type `make` in your terminal at the root of this application.
- To install all dependancies : `make install`
- To start/stop/restart/status all services : `make start|stop|restart|status`
- To display logs for all services : `make logs`
- To open a shell command into anis-admin container : `make shell`
- To execute tests suite : `make test`
- To generate anis-admin application : `make build`
## Web interface
After the start the interface is available at: [http://localhost:4201](http://localhost:4201)
\ No newline at end of file
3.5.0
\ No newline at end of file
3.6.0
\ No newline at end of file
......@@ -44,7 +44,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
......
FROM node:14-slim
FROM node:15-slim
ENV DEBIAN_FRONTEND=noninteractive
......@@ -10,7 +10,10 @@ RUN ng config -g cli.warnings.versionMismatch false
# Chromium
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium
ENV CHROME_BIN=chromium
# Firefox
RUN apt-get update \
&& apt-get install -y --no-install-recommends firefox-esr
CMD ["bash"]
......@@ -8,18 +8,31 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
// dir: require('path').join(__dirname, './coverage/anis-admin'),
dir: require('path').join(__dirname, './var/coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/client'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' },
{ type: 'lcovonly' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
......@@ -27,12 +40,16 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
// browsers: ['Chrome'],
browsers: ['ChromeHeadlessCI'],
browsers: ['ChromeHeadlessCI', 'FirefoxHeadlessCI'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
}
},
FirefoxHeadlessCI: {
base: 'Firefox',
flags: ['-headless'],
}
},
singleRun: false,
restartOnFileChange: true
......
......@@ -11,48 +11,49 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~10.2.3",
"@angular/common": "~10.2.3",
"@angular/compiler": "~10.2.3",
"@angular/core": "~10.2.3",
"@angular/forms": "~10.2.3",
"@angular/platform-browser": "~10.2.3",
"@angular/platform-browser-dynamic": "~10.2.3",
"@angular/router": "~10.2.3",
"@fortawesome/fontawesome-free": "^5.15.1",
"@ngrx/effects": "^10.0.1",
"@ngrx/router-store": "^10.0.1",
"@ngrx/store": "^10.0.1",
"@ngrx/store-devtools": "^10.0.1",
"bootstrap": "^4.5.3",
"jwt-decode": "^3.1.2",
"keycloak-angular": "^8.0.1",
"keycloak-js": "^11.0.3",
"ngx-bootstrap": "^6.1.0",
"ngx-toastr": "^13.1.0",
"@angular/animations": "~11.2.8",
"@angular/common": "~11.2.8",
"@angular/compiler": "~11.2.8",
"@angular/core": "~11.2.8",
"@angular/forms": "~11.2.8",
"@angular/platform-browser": "~11.2.8",
"@angular/platform-browser-dynamic": "~11.2.8",
"@angular/router": "~11.2.8",
"@fortawesome/fontawesome-free": "^5.15.3",
"@ngrx/effects": "^11.1.0",
"@ngrx/router-store": "^11.1.0",
"@ngrx/store": "^11.1.0",
"@ngrx/store-devtools": "^11.1.0",
"bootstrap": "^4.6.0",
"keycloak-angular": "^8.1.0",
"keycloak-js": "^12.0.4",
"ngx-bootstrap": "^6.2.0",
"ngx-toastr": "^13.2.1",
"rxjs": "~6.6.3",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1002.0",
"@angular/cli": "~10.2.0",
"@angular/compiler-cli": "~10.2.3",
"@angular/language-service": "~10.2.3",
"@types/jasmine": "~3.6.1",
"@angular-devkit/build-angular": "~0.1102.7",
"@angular/cli": "~11.2.7",
"@angular/compiler-cli": "~11.2.8",
"@angular/language-service": "~11.2.8",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.1",
"jasmine-core": "~3.5.0",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-firefox-launcher": "^2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~9.0.0",
"tslint": "~6.1.0",
"typescript": "~4.0.5"
"typescript": "~4.1.5"
}
}
......@@ -13,7 +13,7 @@ const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule]
})
export class AppRoutingModule { }
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { NavComponent } from './nav.component';
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { NotFoundPageComponent } from './not-found-page.component';
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment