Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.0 update #21

Merged
merged 2 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
106 changes: 106 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/.angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "myapp"
},
"apps": [
{
"name" : "dist",
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
"app.config.json",
"versions.json",
{
"glob": "**/*",
"input": "../resources",
"output": "./resources"
},
{
"glob": "**/*",
"input": "../node_modules/@alfresco/adf-core/prebuilt-themes",
"output": "./assets/prebuilt-themes"
},
{
"glob": "**/*",
"input": "../node_modules/@alfresco/adf-core/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/@alfresco/adf-insights/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/@alfresco/adf-process-services/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/@alfresco/adf-content-services/bundles/assets",
"output": "./assets/"
},
{ "glob": "pdf.worker.js", "input": "../node_modules/pdfjs-dist/build", "output": "./" }
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"custom-style.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"../node_modules/"
]
},
"scripts": [
"../node_modules/pdfjs-dist/build/pdf.js",
"../node_modules/pdfjs-dist/web/pdf_viewer.js",
"../node_modules/raphael/raphael.min.js",
"../node_modules/moment/min/moment.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {
},
"serve": {
"proxyConfig": "proxy.conf.json",
"port": 4200
}
}
}
13 changes: 13 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
42 changes: 42 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
31 changes: 31 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
dist: trusty
sudo: false

language: node_js
node_js:
- "8"

cache:
directories:
- ./node_modules

install:
- npm install

script:
# Use Chromium instead of Chrome.
- export CHROME_BIN=chromium-browser
- xvfb-run -a npm run test -- --single-run --no-progress --browser=ChromeNoSandbox
#- xvfb-run -a npm run e2e -- --no-progress --config=protractor-ci.conf.js

after_success:
- bash <(curl -s https://codecov.io/bash) -X gcov
#Uncomment this part if you want publish your docker image
# - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
# - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
# - export TAG=`if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $BRANCH ; fi`
# - docker build -t $DOCKER_REPO:$TAG .
# # Publish extra image based on Travis build number
# - docker tag $DOCKER_REPO:$TAG $DOCKER_REPO:travis-$TRAVIS_BUILD_NUMBER
# - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
# - docker push $DOCKER_REPO
6 changes: 6 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM nginx

COPY nginx.conf /etc/nginx/nginx.conf

WORKDIR /usr/share/nginx/html
COPY dist/ .
21 changes: 21 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Denys Vuika

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
97 changes: 97 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# ADF/APS/ACS Application with Angular CLI

Minimal ready-to-use Angular CLI project template pre-configured with ADF 2.0.0 components.

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.0

## Quick start

```sh
npm install
npm start
```

## Supported ADF component libraries

This project has all the existing ADF component libraries already pre-configured.

The main focus of the project is:

- ADF integration and setup
- Basic demonstration of working components

## Development server

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.

### Proxy settings

The template provides certain proxy settings to allow running web application locally without CORS setup.
You can find details in the `proxy.conf.json` file.

List of URLs being proxied:

- `/alfresco` -> `http://0.0.0.0:8080`
- `/activiti-app` -> `http://0.0.0.0:9999`

## Code scaffolding

Run `ng generate component component-name -m app.module` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.

## Build

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.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

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).

# Docker

You can create a Docker image to run your generated app in the container.

## Building from source code

You need to run the following commands to build the project from the source code:

```sh
npm run build
```

That produces a build in the "dist" folder that you can use with a Docker image.

<p class="tip">
Also, you may need to update the `dist/app.config.json` file with the settings relevant to your scenario.
</p>

## Creating an image

The generated app provides a "Dockerfile" file in the repository root.
You can build the image with the following command:

```sh
docker image build -t YOUR_NAME_APP .
```

## Running image in a container

To run the image locally, you can use the following command:

```sh
docker container run -p 80:80 --rm YOUR_NAME_APP
```

Navigate to "http://localhost" to access the running application.

<p class="tip">
(For more information about docker see also)[docker.md]
</p>
62 changes: 62 additions & 0 deletions ADF_2.3.0/upgrade-from-2-2-0/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

## Publishing to Docker Hub

First of all, if you do not have a Docker Hub account, you can register here: https://hub.docker.com/, the registration is absolutely free.

Next, it is recommended that you get a clean build of the application:

```sh
npm install
npm run build
```

The commands above are going to produce a fresh build that is stored in the `dist` folder.
At this point, you can make modifications to the final code in the `dist` folder if needed.
For example you may want to change the `app.config.json` file content.

Now you can build your first version of the image:

```sh
docker image build -t myaccount/my_app_name:1.0 .
```

Where `myaccount` is usually your Docker Hub account name.

<p class="warning">
Please note the ending "." symbol at the end of the command. It instructs the Docker to take current folder where the `Dockerfile` is located.
</p>

To publish the newly created image use the next command:

```sh
docker push myaccount/my_app_name:1.0
```

## Running from Docker Hub

To quickly test the published image, or run it on another machine, use the following command:

```sh
docker container run -p 80:80 --rm myaccount/my_app_name:1.0
```

The `--rm` switch means the Docker will cleanup the container and image data once you stop the process.

<p class="tip">
You may also want to remove your local image before trying out the Docker Hub:<br>
`docker image rm myaccount/my_app_name:1.0`
</p>

## Travis

In order to let Travis publish the image to a registry for you uncomment the relative part in the `.travis.yml`.
The email, username, and password used for login should be stored in the repository settings environment variables, which may be set up through the web or locally via the Travis CLI, e.g.:

```
travis env set DOCKER_USERNAME myusername
travis env set DOCKER_PASSWORD secretsecr
```

For more information [see also Pushing a Docker Image to a Registry ](https://docs.travis-ci.com/user/docker/)