2020-10-15 14:46:14 +00:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- test
|
2020-10-15 17:54:03 +00:00
|
|
|
- release
|
2020-10-15 14:46:14 +00:00
|
|
|
|
2021-02-16 13:12:49 +00:00
|
|
|
# Build Send, run npm tests
|
2020-10-15 14:46:14 +00:00
|
|
|
test:
|
|
|
|
stage: test
|
2022-12-20 18:29:26 +00:00
|
|
|
image: "node:16-slim"
|
2022-09-12 10:51:03 +00:00
|
|
|
only:
|
|
|
|
- api
|
|
|
|
- branches
|
|
|
|
- chat
|
|
|
|
- merge_requests
|
|
|
|
- pushes
|
|
|
|
- schedules
|
|
|
|
- tags
|
|
|
|
- triggers
|
|
|
|
- web
|
|
|
|
before_script:
|
|
|
|
# Install dependencies
|
|
|
|
- apt-get update
|
|
|
|
- apt-get install -y git python3 build-essential libxtst6
|
|
|
|
|
|
|
|
# Prepare Chrome for puppeteer
|
|
|
|
- apt-get install -y wget gnupg
|
|
|
|
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
|
|
- sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
|
|
|
- apt-get update
|
2022-12-20 18:29:26 +00:00
|
|
|
- apt-get install -y 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
|
2022-09-12 10:51:03 +00:00
|
|
|
- apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends
|
2020-10-15 14:46:14 +00:00
|
|
|
script:
|
|
|
|
- npm ci
|
|
|
|
- npm run lint
|
|
|
|
- npm test
|
2020-10-15 17:16:49 +00:00
|
|
|
|
2020-10-15 17:54:03 +00:00
|
|
|
release-docker:
|
|
|
|
stage: release
|
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
only:
|
2022-09-12 10:51:03 +00:00
|
|
|
- api
|
|
|
|
- branches
|
|
|
|
- chat
|
|
|
|
- merge_requests
|
|
|
|
- pushes
|
|
|
|
- schedules
|
|
|
|
- tags
|
|
|
|
- triggers
|
|
|
|
- web
|
2020-10-15 17:54:03 +00:00
|
|
|
script:
|
2022-09-12 10:51:03 +00:00
|
|
|
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
2022-10-25 17:08:27 +00:00
|
|
|
- docker buildx create --name sendBuilder
|
|
|
|
- docker buildx use sendBuilder
|
2022-09-12 10:51:03 +00:00
|
|
|
- |
|
|
|
|
if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then
|
|
|
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE/mr:$CI_MERGE_REQUEST_IID"
|
|
|
|
elif [ "$CI_COMMIT_TAG" != "" ]; then
|
|
|
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG $CI_REGISTRY_IMAGE:latest"
|
|
|
|
else
|
|
|
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHORT_SHA"
|
|
|
|
fi
|
|
|
|
- |
|
|
|
|
for image in $IMAGE_NAMES; do
|
2022-10-25 17:08:27 +00:00
|
|
|
docker buildx build --platform linux/amd64,linux/arm64 -t $image . --push
|
2022-09-12 10:51:03 +00:00
|
|
|
done
|
|
|
|
- |
|
|
|
|
echo "Container image pushed. You can pull it with";
|
|
|
|
for image in $IMAGE_NAMES; do
|
|
|
|
echo "docker pull $image"
|
|
|
|
done
|