Hexbear is the engine that powers Chapochat. It is a customization of the Lemmy project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
2.2 KiB

stages:
- build
- test # do not remove, dep scan errors the config without
- deploy
include:
- template: Dependency-Scanning.gitlab-ci.yml
default:
tags:
- docker
- shell
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.default_template: &default_template
only:
- chapo-dev
build_dev:
<<: *default_template
stage: build
script:
- sed -i "s/10000000-ffff-ffff-ffff-000000000001/$LEMMY_HCAPTCHA_SITEKEY/g" ui/src/env.ts
- docker build --tag $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest --file docker/prod/Dockerfile .
- docker push $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:latest
build_react-test:
stage: build
script:
- sed -i "s/10000000-ffff-ffff-ffff-000000000001/$LEMMY_HCAPTCHA_SITEKEY/g" ui/src/env.ts
- docker build --tag $CI_REGISTRY_IMAGE:latest-react-test --file docker/prod/Dockerfile .
- docker push $CI_REGISTRY_IMAGE:latest-react-test
only:
- rework/react-v2
# test skeletons for whenever someone gets a chance to write the scripts
# test_backend:
# stage: test
# script:
# rules:
# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "chapo-dev"'
# changes: server/*
# when: on_success
# - when: manual
# test_frontend:
# stage: test
# script:
# rules:
# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "chapo-dev"'
# changes: ui/*
# when: on_success
# - when: manual
deploy_dev:
<<: *default_template
stage: deploy
script:
- docker pull $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest-dev
- docker push $CI_REGISTRY_IMAGE:latest-dev
deploy_react-test_to_dev:
stage: deploy
script:
- docker pull $CI_REGISTRY_IMAGE:latest-react-test
- docker tag $CI_REGISTRY_IMAGE:latest-react-test $CI_REGISTRY_IMAGE:latest-dev
- docker push $CI_REGISTRY_IMAGE:latest-dev
when: manual
deploy_prod:
<<: *default_template
stage: deploy
script:
- docker pull $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:predev-$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest-prod
- docker push $CI_REGISTRY_IMAGE:latest-prod
when: manual