Commit 44232007 authored by Thomas Boni's avatar Thomas Boni
Browse files

jobs(npm, pnpm, yarn): enable pages composability by default

parent 8c79ceb5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [0.4.0] - 2022-09-20
* Enable pages composability by default

## [0.3.1] - 2022-06-13
* Add docker image tag in variable

+2 −7
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ from your `package.json` file.
| `NPM_BUILD_SCRIPT_NAME` | The build script in the `package.json` that you want to run | `build` |
| `NPM_BUILD_OPTIONS` | Options passed to your build script | ` ` |
| `NPM_BUILD_OUTPUT_FOLDER` | Path to the output produced by the `npm` build script used (path relative from the `PROJECT_ROOT`) | `build` |
| `PAGES_DEPLOY` | Prepare your build result to be deployed on pages (require [pages job](jobs/deploy/pages/)) | `false` |
| `PAGES_FOLDER` | Path where to copy the output to be exposed for deployment on [pages](jobs/deploy/pages/) (path relative from the root of the repository) | `./website_build` |
| `IMAGE_TAG` | The default tag for the docker image | `18-buster`  |

@@ -38,12 +37,8 @@ stages:
  - deploy

include:
  - remote: 'https://jobs.r2devops.io/npm_build.yml'
  - remote: 'https://jobs.r2devops.io/pages.yml'

npm_build:
  variables:
    PAGES_DEPLOY: "true"
  - remote: 'https://api.r2devops.io/job/r/r2devops-bot/pages/latest.yml'
  - remote: 'https://api.r2devops.io/job/r/r2devops-bot/npm_build/latest.yml'
```

## Artifact
+3 −8
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ npm_build:
    NPM_BUILD_SCRIPT_NAME: "build"
    NPM_BUILD_OPTIONS: ""
    NPM_BUILD_OUTPUT_FOLDER: "build"
    PAGES_DEPLOY: "false"
    PAGES_FOLDER: "./website_build"
    IMAGE_TAG: "18-buster"
  script:
@@ -22,17 +21,13 @@ npm_build:
    - cd $PROJECT_ROOT
    - npm install $NPM_INSTALL_OPTIONS
    - npm run $NPM_BUILD_SCRIPT_NAME $NPM_BUILD_OPTIONS
    # To deploy on pages
    - if [ "$PAGES_DEPLOY" == "true" ]; then
    # Pages folder must to be at the root of the repo
    - cd $CI_PROJECT_DIR
    - cp -r ${PROJECT_ROOT}/${NPM_BUILD_OUTPUT_FOLDER} ${CI_PROJECT_DIR}/${PAGES_FOLDER}
    - fi
  artifacts:
    expose_as: "npm build"
    paths:
      - "${PROJECT_ROOT}/${NPM_BUILD_OUTPUT_FOLDER}"
      # To deploy on pages
      - "${PAGES_FOLDER}"
      # Below path is a workaround to provide artifact exposition in MR if
      # default output value is used. See https://r2devops.io/jobs/build/npm_build/#artifact
+4 −1
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [0.2.0] - 2022-09-20
* Enable pages composability by default

## [0.1.0] - 2022-07-11
* Initial version
+0 −6
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ from your `package.json` file. For more information see [the doc]('https://pnpm.
| `PNPM_BUILD_SCRIPT_NAME` | The build script in the `package.json` that you want to run | `build` |
| `PNPM_BUILD_OPTIONS` | Options passed to your build script | ` ` |
| `PNPM_BUILD_OUTPUT_FOLDER` | Path to the output produced by the `pnpm` build script used (path relative from the `PROJECT_ROOT`) | `dist` |
| `PAGES_DEPLOY` | Prepare your build result to be deployed on pages (require [pages job](jobs/deploy/pages/)) | `false` |
| `PAGES_FOLDER` | Path where to copy the output to be exposed for deployment on [pages](jobs/deploy/pages/) (path relative from the root of the repository) | `./website_build` |
| `IMAGE_TAG` | The default tag for the docker image | `18-buster`  |

@@ -37,13 +36,8 @@ stages:
  - deploy

include:
  # It's recommanded to use fixed version of jobs instead of larest. Here is only for example.
  - remote: 'https://api.r2devops.io/job/r/r2devops-bot/pnpm_build/latest.yml'
  - remote: 'https://api.r2devops.io/job/r/r2devops-bot/pages/latest.yaml'

pnpm_build:
  variables:
    PAGES_DEPLOY: "true"
```

## Artifact
Loading