~hokiegeek/biologist-web

21fc5e225603de84547184e7d6e82b75b4b71f05 — HokieGeek 9 months ago 74bc25e 3.0.1
Deploying to Google Cloud Run now
2 files changed, 17 insertions(+), 11 deletions(-)

M .build.yml
M package.json
M .build.yml => .build.yml +16 -10
@@ 1,4 1,4 @@
image: alpine/edge
image: archlinux
packages:
  - nodejs
  - npm


@@ 7,23 7,27 @@ packages:
  - nss
  - docker
  - shadow
  - google-cloud-sdk
sources:
  - https://git.sr.ht/~hokiegeek/biologist-web
environment:
  PROJ: biologist-web
  GCP_PROJ: hokiegeek-net
  GCP_RUN_SVC: life
  CI_COMMIT_TAG: $(git --work-tree=./biologist-web --git-dir=./biologist-web/.git describe)
  CI_REGISTRY: quay.io
  CI_REGISTRY_USER: hokiegeek
  CI_REGISTRY: gcr.io
  CI_REGISTRY_USER: hokiegeek-net
secrets:
  - d675b280-e56b-4c0f-9908-549c70a7e2f9
  - 3c7786a3-e027-4018-bc74-42a1492176d5 # gcp key
tasks:
  - setup: |
  - docker_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
      sudo gpasswd -a $(whoami) docker
  - gcloud_setup: |
      gcloud auth activate-service-account --key-file=$HOME/.gcp_cloudrunner_key.json
      gcloud config set project ${GCP_PROJ}
      yes | gcloud auth configure-docker
  - install: |
      cd ${PROJ}
      npm install


@@ 46,6 50,8 @@ tasks:
      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}
      cat $HOME/.gcp_cloudrunner_key.json | docker login -u _json_key --password-stdin https://${CI_REGISTRY}
      docker push $IMAGE_TAG
      docker push $IMAGE_LATEST_TAG
  - deploy: |
      gcloud beta run deploy ${GCP_RUN_SVC} --image ${CI_REGISTRY}/${CI_REGISTRY_USER}/${PROJ} --platform managed --region us-east1 --allow-unauthenticated --memory 512Mi

M package.json => package.json +1 -1
@@ 1,6 1,6 @@
{
  "name": "biologist-web",
  "version": "3.0.0",
  "version": "3.0.1",
  "license": "MIT",
  "scripts": {
    "ng": "ng",