added streamline docker compose and build steps

This commit is contained in:
Carter 2025-06-11 10:42:19 -06:00
parent 7a99a44307
commit f6d57ef83b
2 changed files with 127 additions and 0 deletions

View file

@ -316,3 +316,97 @@ deploy:development:
- docker stack deploy --with-registry-auth -c docker-compose.dev.yml webui
when: manual
allow_failure: false
dependencies:streamline:
image: node:$NODE_VERSION
stage: dependencies
only:
refs:
- streamline
# before_script:
# - npm -g config set user root
script:
- npm ci
cache:
key:
files:
- package-lock.json
paths:
- node_modules
artifacts:
expire_in: 1 hour
paths:
- node_modules/
# test:
# image: node:$NODE_VERSION
# stage: setup
# dependencies:
# - dependencies:production
# only:
# - master
# before_script:
# - npm run lint
# script:
# - CI=true npm run test
setup:streamline:
image: node:$NODE_VERSION
stage: setup
dependencies:
- dependencies:streamline
only:
- master
script:
- npm run build:streamline
artifacts:
expire_in: 1 hour
paths:
- build
build:streamline:
image: docker:20.10.21
stage: build
dependencies:
- setup:streamline
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
services:
- docker:20.10.21-dind
only:
- master
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
script:
- docker build -t ${CI_REGISTRY}/brandx/bxt-app/streamline:${CI_COMMIT_SHA} .
- docker tag ${CI_REGISTRY}/brandx/bxt-app/streamline:${CI_COMMIT_SHA} ${CI_REGISTRY}/brandx/bxt-app/production:latest
- docker push ${CI_REGISTRY}/brandx/bxt-app/streamline
deploy:streamline:
image: docker:20.10.21
stage: deploy
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: ssh://deploy@streamline.adaptiveagriculture.ca
DEPLOY_IMAGE: ${CI_REGISTRY}/brandx/bxt-app/streamline:latest
DEPLOY_TARGET: deploy@streamline.adaptiveagriculture.ca
only:
- master
environment:
name: Streamline
url: https://streamline.adaptiveagriculture.ca
before_script: &deploy_tunnel
- "apk --update add openssh-client"
- "eval $(ssh-agent -s)"
- "echo \"$DEPLOY_SSH_PRIV_KEY\" | tr -d '\r' | ssh-add - > /dev/null"
# - "ssh -Mo StrictHostKeyChecking=no -S deploy-ctrl-socket -fnNTL /var/run/docker.sock:/var/run/docker.sock ${DEPLOY_TARGET}"
# - "ssh -S deploy-ctrl-socket -O check ${DEPLOY_TARGET}"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh -o StrictHostKeyChecking=no ${DEPLOY_TARGET}
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker stack deploy --with-registry-auth -c docker-compose.streamline.yml webui
when: manual
allow_failure: false