~hokiegeek/biologist-web

ref: 2.1.1 biologist-web/.build.yml -rw-r--r-- 1.6 KiB View raw
e6c182aeHokieGeek Refactored to run as a Cloud Run thingy 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
image: alpine/edge
packages:
  - nodejs
  - npm
  - chromium
  - harfbuzz
  - nss
  - docker
  - shadow
sources:
  - https://git.sr.ht/~hokiegeek/biologist-web
environment:
  PROJ: biologist-web
  CI_COMMIT_TAG: $(git --work-tree=./biologist-web --git-dir=./biologist-web/.git describe)
  CI_REGISTRY: quay.io
  CI_REGISTRY_USER: hokiegeek
secrets:
  - d675b280-e56b-4c0f-9908-549c70a7e2f9
tasks:
  - setup: |
      sudo mount -t tmpfs -o size=4G /dev/null /dev/shm
      sudo service cgroups start
      sleep 2
      sudo nohup dockerd --bip 172.18.0.1/16 </dev/null >/dev/null 2>&1 &
      sleep 5
      sudo addgroup $(whoami) docker
  - install: |
      cd ${PROJ}
      npm install
  - lint: |
      cd ${PROJ}
      npm run lint
  - build: |
      cd ${PROJ}
      npm run build
      version=$(awk 'BEGIN { FS=":"; RS="," } $1 ~ /"version"/ { gsub(/( |")/, "", $0); print $2 }' package.json)
      sed -i '/^<head>$/ a\    <meta name="application-name" content="hokiegeek.net_tea" data-version="'${version}${version_suffix:+":${version_suffix}"}'" />' dist/index.html
  - test: |
      export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
      export CHROME_BIN="/usr/bin/chromium-browser"
      cd ${PROJ}
      npm run test
  - package: |
      cd ${PROJ}
      IMAGE=${CI_REGISTRY}/hokiegeek/${PROJ}
      IMAGE_TAG=${IMAGE}:${CI_COMMIT_TAG}
      IMAGE_LATEST_TAG=${IMAGE}:latest
      docker build -t $IMAGE_TAG -t $IMAGE_LATEST_TAG .
      cat $HOME/.image_registry_token | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
      docker push $IMAGE_TAG
      docker push $IMAGE_LATEST_TAG