# Customize the build rules and the artifacts here. You probably want to adjust # "opam.locked" # We define a cache in order to keep the switch with the dependencies installed, # unless the opam.locked file has changed. build: stage: build image: registry.ocamlpro.com/ocamlpro/ocaml-docker-images:4.12 before_script: - sudo apk add bash openssl-libs-static - if [ -d _opam ]; then opam install . --deps-only --locked --depext-only -td; else opam switch create . ocaml-system --deps-only --locked -td; fi script: - OCAMLPARAM=_,cclib=-static,cclib=-no-pie opam exec -- dune build --profile release @all - opam exec -- dune runtest - mv _build/default/src/server.exe . cache: key: files: - ocpsite.opam.locked paths: - _opam artifacts: paths: - server.exe include: - project: 'OCamlPro/gitlab-deployments' ref: marvin file: deploy.yml # Builds and pushes the Docker image using Kaniko make-image: extends: .make-image # defined in deploy.yml variables: DOCKERFILE: /kaniko/Dockerfile # don't need a local 'git clone' GIT_STRATEGY: "none" before_script: # Write the Dockerfile for the image we want to generate # Here we inherit from nginx and just add the contents of our web-app - | echo "\ FROM bitnami/nginx:latest ADD server.exe /opt/bitnami/nginx/sbin/nginx " > $DOCKERFILE # Deployments are pre-defined in the "dev" environment; they will be stopped # after 3 days unless they are on the default branch (master). # To define production deployments, ensure the domain name is correct, and set # the corresponding DNS record as "CNAME" to "a.ocaml.pro" deploy-prod: extends: .deploy-prod variables: PUBLIC_HOST: www.ocamlpro.com