This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
short-link-backend/.gitlab-ci.yml
Thomas Schleicher 15a91ad89b debugging
2024-10-22 20:16:01 +02:00

52 lines
No EOL
1.1 KiB
YAML

stages:
- build
# - test
- package
variables:
BUILD_DIR: "build"
CMAKE_OPTIONS: ""
DOCKER_IMAGE_NAME: "short-link-backend"
DOCKER_IMAGE_TAG: "latest"
build_job:
stage: build
image: gcc:latest
script:
- apt-get update -y
- apt-get install -y --no-install-recommends cmake libboost-all-dev
- mkdir -p ${BUILD_DIR}
- cp dockerfile ${BUILD_DIR}/
- cd ${BUILD_DIR}
- cmake .. ${CMAKE_OPTIONS}
- make -j$(nproc)
artifacts:
paths:
- ${BUILD_DIR}
expire_in: 1 hour
tags:
- docker
# test_job:
# stage: test
# image: gcc:latest
# script:
# - cd ${BUILD_DIR}
# - ctest --output-on-failure
package_job:
stage: package
script:
- cd ${BUILD_DIR}
- docker build -t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} .
- docker save ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} -o ${DOCKER_IMAGE_NAME}.tar
- ls -la
- tree ./
only:
- main
artifacts:
expire_in: "1 days"
paths:
- ${DOCKER_IMAGE_NAME}.tar
tags:
- shell