~hokiegeek/biologist-web

8c657b4402235036792edaebcb2f90f5a49e6452 — HokieGeek 1 year, 1 month ago 21fc5e2 3.0.2
Pushing this to both Hub and GCR, for the time being
3 files changed, 31 insertions(+), 13 deletions(-)

M .build.yml
M Dockerfile
M package.json
M .build.yml => .build.yml +18 -10
@@ 15,9 15,11 @@ environment:
  GCP_PROJ: hokiegeek-net
  GCP_RUN_SVC: life
  CI_COMMIT_TAG: $(git --work-tree=./biologist-web --git-dir=./biologist-web/.git describe)
  CI_REGISTRY: gcr.io
  CI_REGISTRY_USER: hokiegeek-net
  CI_REGISTRY_USER_HUB: hokiegeek
  CI_REGISTRY_GCR: gcr.io
  CI_REGISTRY_USER_GCR: hokiegeek-net
secrets:
  - 1e1af69d-4036-40fd-9eb8-03b367bdb0eb # docker hub
  - 3c7786a3-e027-4018-bc74-42a1492176d5 # gcp key
tasks:
  - docker_setup: |


@@ 46,12 48,18 @@ tasks:
      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/.gcp_cloudrunner_key.json | docker login -u _json_key --password-stdin https://${CI_REGISTRY}
      docker push $IMAGE_TAG
      docker push $IMAGE_LATEST_TAG
      IMAGE_HUB=${CI_REGISTRY_USER_HUB}/${PROJ}
      IMAGE_HUB_TAG=${IMAGE_HUB}:${CI_COMMIT_TAG}
      IMAGE_GCR=${CI_REGISTRY_GCR}/${CI_REGISTRY_USER_GCR}/${PROJ}
      IMAGE_GCR_TAG=${IMAGE_GCR}:${CI_COMMIT_TAG}
      docker build -t ${IMAGE_GCR_TAG} -t ${IMAGE_GCR}:latest -t ${IMAGE_HUB_TAG} -t ${IMAGE_HUB}:latest .
      # Docker Hub
      cat $HOME/.image_registry_token | docker login --username ${CI_REGISTRY_USER_HUB} --password-stdin
      docker push ${IMAGE_HUB_TAG}
      docker push ${IMAGE_HUB}:latest
      # GCR
      cat $HOME/.gcp_cloudrunner_key.json | docker login -u _json_key --password-stdin https://${CI_REGISTRY_GCR}
      docker push ${IMAGE_GCR_TAG}
      docker push ${IMAGE_GCR}:latest
  - deploy: |
      gcloud beta run deploy ${GCP_RUN_SVC} --image ${CI_REGISTRY}/${CI_REGISTRY_USER}/${PROJ} --platform managed --region us-east1 --allow-unauthenticated --memory 512Mi
      gcloud beta run deploy ${GCP_RUN_SVC} --image ${CI_REGISTRY_GCR}/${CI_REGISTRY_USER_GCR}/${PROJ} --platform managed --region us-east1 --allow-unauthenticated --memory 512Mi

M Dockerfile => Dockerfile +12 -2
@@ 1,2 1,12 @@
FROM quay.io/hokiegeek/biologist:latest
COPY dist/* /web/
### Build the code
FROM golang:1.12-alpine
ENV CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64
RUN apk add --update git
RUN go install -v -ldflags="-w -s" git.sr.ht/~hokiegeek/biologist/cmd/biologistd

### Package it up
FROM alpine
EXPOSE 80 8080 443
COPY --from=0 /go/bin/biologistd /
COPY dist/ /web/
ENTRYPOINT ["/biologistd"]

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