freechat/.gitlab-ci.yml
shockrah 85660e2fc9 - Removing old scripts that aren't useful to anyone but myself
+ Adding new bootstrapping script for Docker testing pipeline
This build-database script is what is going to setup things like our tables for us
so that we can actually run our test queries

! Basically turning off the ci right now since its going through some large breaking changes
It's going to be broken for a while so there's no point in running it into
a wall of predictable failures
2021-04-29 21:32:43 -07:00

151 lines
2.7 KiB
YAML

image: shockrah/freechat-pipeline:latest
stages:
- documentation
- build
- test
workflow:
rules:
- if: '$CI_COMMIT_BRANCH'
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
GIT_SUBMODULE_STRATEGY: recursive
# Not doing strict host checking to avoid writing the host fingerprint anywhere
# This is important because I don't host this gitlab instance, if I did host my
# own gitlab however this wouldn't be here as it would be under my control but
# this isn't the case
# Really we're just trading one security issue for another:
# - keeping fingerprints on someone else's server
# - not verifying the host for my little known service
SHOPTS: "-o StrictHostKeyChecking=no"
before_script:
- export PATH="$CARGO_HOME/bin:$PATH"
build-json-api:
# Literally so expensive that I realy just don't wanna deal with it
stage: build
only:
refs:
- broken
changes:
- json-api/Cargo.*
- json-api/src/*
- json-api/src/testing/*
- json-api/migrations/**/*
- json-api/client-tests/**/*
- json-api/build.sh
- json-api/db/Cargo.*
- json-api/db/src/*.rs
script:
- cd json-api/
- cargo build --release
# primarily used to cache between jobs
# expirey time overwritten later for weekly builds
artifacts:
paths:
- json-api/target/
- $CARGO_HOME
expire_in: 15 mins
test-json-api:
stage: test
needs:
- build-json-api
only:
refs:
- broken
changes:
- json-api/Cargo.*
- json-api/src/*
- json-api/src/testing/*
- json-api/migrations/**/*
- json-api/client-tests/**/*
- json-api/build.sh
- json-api/db/Cargo.*
- json-api/db/src/*
dependencies:
- build-json-api
script:
- cd json-api/
- cargo test --release
artifacts:
paths:
- json-api/target/release/json-api
expire_in: 1 week
name: json-api
build-channer:
stage: build
only:
refs:
- master
changes:
- chan-like/Cargo.*
- chan-like/src/main.rs
script:
- cd chan-like/
- cargo build --release
artifacts:
paths:
- json-api/target/
- $CARGO_HOME
expire_in: 1 week
build-wiki:
image: shockrah/website:latest
only: [ "master" ]
stage: documentation
only:
refs:
- master
changes:
- docs/archetypes/*
- docs/content/**/*
- docs/layouts/partials/*
- docs/config.toml
before_script:
- eval $(ssh-agent -s)
- echo "${SSH_PRIVATE_KEY}" | ssh-add - > /dev/null
- mkdir -p ~/.ssh/
- chmod 700 ~/.ssh/
script:
- cd docs/
- hugo
- ssh $SHOPTS web@shockrah.xyz "rm -rf /var/www/freechat"
- scp $SHOPTS -r public/ web@shockrah.xyz:/var/www/freechat