fox-send/.gitlab-ci.yml

73 lines
2.3 KiB
YAML
Raw Normal View History

stages:
- test
- release
# Build Send, run npm tests
test:
stage: test
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
- 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
script:
- npm ci
- npm run lint
- npm test
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
script:
2022-09-12 10:51:03 +00:00
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker build -t send .
- |
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
docker tag send $image
docker push $image
done
- |
echo "Container image pushed. You can pull it with";
for image in $IMAGE_NAMES; do
echo "docker pull $image"
done