This project contains templates for angular app and libraries.
The main repository is hosted in gitlab.com/singletonsd/pipelines/angular but it is automaticaly mirrored to github.com/singletonsd, github.com/patoperpetua and to gitlab.com/patoperpetua. If you are in the Github page it may occur that is not updated to the last version.
This templates already include the templates of npm repository.
If you want to skip reading, you can copy and paste this example file and setup the variables.
To use it, you can include them as following (using repository aproach):
include:
- project: 'singletonsd/pipelines/angular'
file: '/src/.gitlab-ci-app.yml'
Or using remote approach over gitlab repo:
include:
- remote: 'https://gitlab.com/singletonsd/pipelines/angular/raw/master/src/.gitlab-ci-app.yml'
Or using remote approach over gilab pages:
include:
- remote: 'https://singletonsd.gitlab.io/pipelines/angular/latest/.gitlab-ci-app.yml'
Master branch is setup as latest folder. To use an specific version, put the version name before the file name like:
include:
- remote: 'https://singletonsd.gitlab.io/pipelines/angular/1.0.0/.gitlab-ci-app.yml'
- remote: 'https://singletonsd.gitlab.io/singletonsd/pipelines/angular/develop/.gitlab-ci-test-app.yml'
- remote: 'https://singletonsd.gitlab.io/singletonsd/pipelines/angular/feature-new/.gitlab-ci-app.yml'
And also define the stages you want to use, like following:
stages:
- install
- test_static
- build
- test_dynamic
- pre_deploy
- analysis
- deploy
Remember to define the following variables:
variables:
# To execute the jobs with the desired docker image.
GLOBAL_IMAGE_NAME: ""
GLOBAL_IMAGE_TAG: ""
# To deploy content to AWS S3
NG_APP_AWS_S3_DEPLOY: "true"
NG_APP_AWS_S3_REGION: ""
NG_APP_AWS_S3_ACCESS_KEY_ID: ""
NG_APP_AWS_S3_SECRET_ACCESS_KEY: ""
# To execute deploy stage only in the main repository in case you have mirror repositories.
ORIGINAL_REPOSITORY: ""
# To run static tests
TEST_STATIC_ALL: "true"
# To run dynamic tests
TEST_STATIC_ALL: "true"
You can test your .gitlab-ci.yml files by executing the following:
curl -s https://singletonsd.gitlab.io/scripts/gitlab-ci/latest/gitlab-ci_lint_test_standalone.sh | bash /dev/stdin
That script contains the following options:
-h | --help: display help.
-o | --only: the name of the file or folder to test.
Also you can download the script by:
curl -o gitlab-ci_lint_test_standalone.sh -L https://singletonsd.gitlab.io/scripts/gitlab-ci/latest/gitlab-ci_lint_test_standalone.sh
- Fix documentation.
- Add app template.
- Add library template.
- Add script to download test script from gitlab pages.
- Use ci-cd template.
© Singleton SD, Italy, 2019.