+ New jobs for building both admin and normal docker images

+ New jobs for building both admin and normal binary packages

! NOTE: This commit is likely broken so do not use it to checkout
This commit is contained in:
shockrah 2022-03-27 00:45:07 -07:00
parent 9f78f316c5
commit ba0d75d383

View File

@ -4,6 +4,10 @@ stages:
- build-backend
- deploy
include:
- local: 'ci/cargo.yml'
- local: 'ci/docker.yml'
pages:
image: shockrah/website:latest
stage: pages
@ -22,62 +26,57 @@ pages:
paths:
- public/
# Webpack bundles everything anyway so both admin/non-admin builds have
# the same frontend code.
build-frontend-js:
image: codesignal/typescript:v9.6.0
stage: build-frontend
stage: pages
only:
refs:
- master
script:
- cd ts/
- npm run setup
- npm i
- npm run build
artifacts:
paths:
- api/static/
# Literally both of these fail 99% of the time so I'm forgoing them completely
# for now until I find something doesn't suck
# Builds out the intended zip package
build-server-binaries:
image: rustlang/rust:nightly
stage: build-backend
stage: pages
only:
refs:
- master
build-server-no-admin:
extends: .cargo-builder
script:
- mkdir -p build
- cp api/templates/ api/static/ build/ -r
- cd api/
- cargo build --release
- cd ../
- cp api/target/release/clippable-server build/server
- cp ./scripts/ build/ -r
- cp readme.md build/
- sh ./scripts/default-rocket-toml.sh
artifacts:
paths:
- build/
# Upload built docker image to the local registry
deploy-docker-image:
stage: deploy
image: docker:stable
only:
refs:
- master
needs:
- build-server-binaries
dependencies:
- build-server-binaries
services:
- docker:dind
build-server-admin-enabled:
extends: .cargo-builder
script:
- cd api/
- cargo build --release --features admin
- cd ../
deploy-no-admin-docker:
stage: deploy
extends: .docker-deploy
needs:
- build-server-no-admin
dependencies:
- build-server-no-admin
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker build -t registry.gitlab.com/shockrah/clippable .
- docker push registry.gitlab.com/shockrah/clippable
deploy-admin-docker:
stage: deploy
extends: .docker-deploy
needs:
- build-server-admin-enabled
dependencies:
- build-server-admin-enabled
script:
- docker build -t registry.gitlab.com/shockrah/clippable:admin .
- docker push registry.gitlab.com/shockrah/clippable:admin