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

add installing chrome to the build process #542

Open
kirilligum opened this issue Sep 1, 2021 · 1 comment
Open

add installing chrome to the build process #542

kirilligum opened this issue Sep 1, 2021 · 1 comment

Comments

@kirilligum
Copy link

Feature Request

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I have an issue when [...]

add installing chrome to the build process

Describe the solution you'd like
A clear and concise description of what you want to happen. Add any considered drawbacks.

add info from puppeteer/puppeteer#765 (comment) on how to set up yarn build for ubuntu under wsl2 or gitlab ci

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Teachability, Documentation, Adoption, Migration Strategy
If you can, explain how users will be able to use this and possibly write out a version the docs.

@kirilligum
Copy link
Author

kirilligum commented Sep 1, 2021

the setup that i used to run it in gitlab ci

package.json :

{
  "name": "dataportweb",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://xxx.gitlab.io/xxx/",
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "bootstrap": "^5.1.0",
    "chrome": "^0.1.0",
    "puppeteer-core": "^10.2.0",
    "react": "^17.0.2",
    "react-bootstrap": "^1.6.1",
    "react-dom": "^17.0.2",
    "react-router-bootstrap": "^0.25.0",
    "react-router-dom": "^5.2.1",
    "react-scripts": "^4.0.3",
    "react-snap": "^1.23.0",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "postbuild": "react-snap",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "reactSnap": {
    "puppeteerArgs": [
      "--no-sandbox"
    ]
  }
}

cat .gitlab-ci.yml :

image: node:latest # can be upgraded, depending on your node version used

variables:
    PUBLIC_URL: "/xxx" # slash is important

cache:
  paths:
    - /node_modules/

before_script:
  - npm install
  # - npm i -g firebase-tools


# deploy-functions:
#   stage: deploy
#   script:
#     - cd functions
#     - npm install
#     - cd ..
#     - firebase deploy --only functions --token $FIREBASE_TOKEN
#   only:
#     refs:
#       - master
#     changes:
#       - functions/**/*

pages:
  stage: deploy
  script:
    - apt-get update
    - apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
    - CI=true npm run build
    - cp -r build/* public/
    - cp public/index.html public/404.html
  artifacts:
    paths:
      - public # GitLab pages serve from a 'public' directory
  only:
    - master # run on master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant