Commit 387ceb00 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !68
parents e5d9e518 a0e1ef1e
...@@ -29,6 +29,7 @@ out-tsc ...@@ -29,6 +29,7 @@ out-tsc
/e2e/*.js /e2e/*.js
/e2e/*.map /e2e/*.map
/typings /typings
/var
#--- OTHER ---# #--- OTHER ---#
......
stages: stages:
- install - install
- test
- sonar
- build-coverage
- build - build
- deploy - deploy
- deploy-coverage
variables: variables:
VERSION: "3.0"
SONARQUBE_URL: https://sonarqube.lam.fr
CONTAINER_IMAGE: portus.lam.fr/anis/anis-client CONTAINER_IMAGE: portus.lam.fr/anis/anis-client
COVERAGE_IMAGE: portus.lam.fr/anis/anis-client-coverage
install: install:
image: node:11 image: node:11
...@@ -16,11 +23,67 @@ install: ...@@ -16,11 +23,67 @@ install:
cache: cache:
paths: paths:
- dist - dist
- node_modules
policy: push policy: push
only: only:
refs: refs:
- develop - develop
test:
image: portus.lam.fr/ci-tools/angular-testing:latest
stage: test
script:
- ng test --no-watch
cache:
paths:
- dist
- node_modules
- var
policy: pull-push
only:
refs:
- develop
sonar_scanner:
image: portus.lam.fr/ci-tools/sonar-scanner:latest
stage: sonar
script:
- sonar-scanner
-Dsonar.projectKey=anis-client
-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:
paths:
- node_modules
- var
policy: pull
only:
refs:
- develop
build-coverage:
image: docker:stable
stage: build-coverage
script:
- echo "FROM nginx" > var/Dockerfile
- echo "COPY coverage /usr/share/nginx/html" >> var/Dockerfile
- docker login -u fagneray -p $PORTUS_TOKEN portus.lam.fr
- docker pull $COVERAGE_IMAGE:latest || true
- docker build --cache-from $COVERAGE_IMAGE:latest -t $COVERAGE_IMAGE:latest var
- docker push $COVERAGE_IMAGE:latest
cache:
paths:
- var
policy: pull
only:
refs:
- develop
build: build:
image: docker:stable image: docker:stable
stage: build stage: build
...@@ -43,6 +106,16 @@ deploy: ...@@ -43,6 +106,16 @@ deploy:
script: script:
- apk add --update curl - apk add --update curl
- curl -XPOST $DEV_WEBHOOK - curl -XPOST $DEV_WEBHOOK
only:
refs:
- develop
deploy-coverage:
image: alpine
stage: deploy-coverage
script:
- apk add --update curl
- curl -XPOST $COVERAGE_WEBHOOK
only: only:
refs: refs:
- develop - develop
\ No newline at end of file
...@@ -4,21 +4,14 @@ All notable changes to this project will be documented in this file. ...@@ -4,21 +4,14 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.0.0] - yyyy-mm-dd ## [3.0.3] - 2019-10-21
### Added ### Added
- Pour les nouvelles fonctionnalités. - Display anis-client and anis-server versions.
- Add detail page for an object.
### Changed ### Changed
- Pour les changements au sein des fonctionnalités déjà existantes. - Fix ordering by diplay for options in Criteria step.
- Design ouputs selection.
### Deprecated
- Pour les fonctionnalités qui seront supprimées dans la prochaine publication.
### Removed
- Pour les anciennes fonctionnalités Deprecated qui viennent d’être supprimées.
### Fixed ### Fixed
- Pour les corrections de bugs. - Fix bug renderer external links.
\ No newline at end of file
### Security
- Pour encourager les utilisateurs à mettre à niveau afin d’éviter des failles de sécurité.
\ No newline at end of file
FROM nginx FROM nginx
COPY dist /usr/share/nginx/html COPY dist/anis-client /usr/share/nginx/html
\ No newline at end of file COPY conf-dev/nginx.conf /etc/nginx/conf.d/default.conf
\ No newline at end of file
UID := $(shell id -u) UID := $(id -u)
GID := $(shell id -g) GID := $(id -g)
# UID := 1000
# GID := 1000
list: list:
@echo "" @echo ""
...@@ -9,9 +12,10 @@ list: ...@@ -9,9 +12,10 @@ list:
@echo " start > run a dev server for anis client application (in memory)" @echo " start > run a dev server for anis client application (in memory)"
@echo " stop > stop the dev server for anis client application" @echo " stop > stop the dev server for anis client application"
@echo " restart > restart the dev server for anis client (container)" @echo " restart > restart the dev server for anis client (container)"
@echo " test > run anis client tests"
@echo " ng-build > generate the angular dist application (html, css, js)" @echo " ng-build > generate the angular dist application (html, css, js)"
@echo " log > display anis client container logs" @echo " log > display anis client container logs"
@echo " debug > shell into anis client container" @echo " shell > shell into anis client container"
@echo "" @echo ""
install: install:
...@@ -23,18 +27,20 @@ start: ...@@ -23,18 +27,20 @@ start:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \ @docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \ --name anis-client \
-p 4200:4200 \ -p 4200:4200 \
-p 9876:9876 \
-v $(CURDIR):/project -d \ -v $(CURDIR):/project -d \
-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200 -w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200
restart: restart: stop start
docker-compose stop
docker-compose start
stop: stop:
@docker stop anis-client @docker stop anis-client
restart: stop start restart: stop start
test:
@docker exec -ti anis-client ng test --no-watch
ng-build: ng-build:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \ @docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
-v $(CURDIR):/project \ -v $(CURDIR):/project \
...@@ -43,5 +49,5 @@ ng-build: ...@@ -43,5 +49,5 @@ ng-build:
log: log:
@docker logs -f -t anis-client @docker logs -f -t anis-client
debug: shell:
@docker exec -ti anis-client bash @docker exec -ti anis-client bash
3.0.0 3.0.3
\ No newline at end of file \ No newline at end of file
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"cli": { "projects": {
"packageManager": "yarn" "anis-client": {
}, "projectType": "application",
"projects": { "schematics": {},
"anis-v3-client": { "root": "",
"root": "", "sourceRoot": "src",
"sourceRoot": "src", "prefix": "app",
"projectType": "application", "architect": {
"architect": { "build": {
"build": { "builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:browser", "options": {
"options": { "outputPath": "dist/anis-client",
"outputPath": "dist", "index": "src/index.html",
"index": "src/index.html", "main": "src/main.ts",
"main": "src/main.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json", "tsConfig": "tsconfig.app.json",
"polyfills": "src/polyfills.ts", "aot": false,
"assets": [ "assets": [
"src/assets", "src/favicon.ico",
"src/favicon.ico" "src/assets"
], ],
"styles": [ "styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/ngx-toastr/toastr.css", "node_modules/ngx-toastr/toastr.css",
"node_modules/@fortawesome/fontawesome-free/css/all.css", "node_modules/@fortawesome/fontawesome-free/css/all.css",
"node_modules/@ng-select/ng-select/themes/default.theme.css", "node_modules/@ng-select/ng-select/themes/default.theme.css",
"src/styles.css" "node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
], "src/styles.css"
"scripts": [ ],
"node_modules/@fortawesome/fontawesome-free/js/all.js" "scripts": [
] "node_modules/@fortawesome/fontawesome-free/js/all.js"
}, ]
"configurations": { },
"production": { "configurations": {
"optimization": true, "production": {
"outputHashing": "all", "fileReplacements": [
"sourceMap": false, {
"extractCss": true, "replace": "src/environments/environment.ts",
"namedChunks": false, "with": "src/environments/environment.prod.ts"
"aot": true, }
"extractLicenses": true, ],
"vendorChunk": false, "optimization": true,
"buildOptimizer": true, "outputHashing": "all",
"fileReplacements": [ "sourceMap": false,
{ "extractCss": true,
"replace": "src/environments/environment.ts", "namedChunks": false,
"with": "src/environments/environment.prod.ts" "aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "anis-client:build"
},
"configurations": {
"production": {
"browserTarget": "anis-client:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "anis-client:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"codeCoverageExclude": ["node_modules/**", ""],
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"codeCoverage": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "anis-client:serve"
},
"configurations": {
"production": {
"devServerTarget": "anis-client:serve:production"
}
}
} }
]
} }
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "anis-v3-client:build"
},
"configurations": {
"production": {
"browserTarget": "anis-v3-client:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "anis-v3-client:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"assets": [
"src/assets",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"anis-v3-client-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "anis-v3-client:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
} }
}
}
},
"defaultProject": "anis-v3-client",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
}, },
"@schematics/angular:directive": { "defaultProject": "anis-client"
"prefix": "app"
}
}
} }
\ No newline at end of file
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
FROM node:11 FROM node:12-slim
ENV DEBIAN_FRONTEND=noninteractive
# Yarn
RUN yarn global add @angular/cli RUN yarn global add @angular/cli
RUN ng config -g cli.packageManager yarn
# Chromium
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium
ENV CHROME_BIN=chromium
CMD ["bash"] CMD ["bash"]
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
\ No newline at end of file
import { AppPage } from './app.po'; import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('anis-v3-client App', () => { describe('workspace-project App', () => {
let page: AppPage; let page: AppPage;
beforeEach(() => { beforeEach(() => {
...@@ -9,6 +10,14 @@ describe('anis-v3-client App', () => { ...@@ -9,6 +10,14 @@ describe('anis-v3-client App', () => {
it('should display welcome message', () => { it('should display welcome message', () => {
page.navigateTo(); page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!'); expect(page.getTitleText()).toEqual('Welcome to anis-client!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
}); });
}); });
...@@ -2,10 +2,10 @@ import { browser, by, element } from 'protractor'; ...@@ -2,10 +2,10 @@ import { browser, by, element } from 'protractor';
export class AppPage { export class AppPage {
navigateTo() { navigateTo() {
return browser.get('/'); return browser.get(browser.baseUrl) as Promise<any>;
} }
getParagraphText() { getTitleText() {
return element(by.css('app-root h1')).getText(); return element(by.css('app-root h1')).getText() as Promise<string>;
} }
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs", "module": "commonjs",
"target": "es5", "target": "es5",
"types": [