Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
David Declerck
www
Commits
d3f96a14
Commit
d3f96a14
authored
Sep 14, 2021
by
Léo Andrès
Browse files
Merge branch 'citest' into 'master'
try to fix CI See merge request
OCamlPro/www!2
parents
c7d32a7d
74cebe0d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
11 deletions
+19
-11
.gitlab-ci.yml
.gitlab-ci.yml
+15
-8
dune-project
dune-project
+1
-1
ocpsite.opam
ocpsite.opam
+1
-1
src/server.ml
src/server.ml
+2
-1
No files found.
.gitlab-ci.yml
View file @
d3f96a14
...
@@ -16,10 +16,17 @@ workflow:
...
@@ -16,10 +16,17 @@ workflow:
# unless the opam.locked file has changed.
# unless the opam.locked file has changed.
build
:
build
:
stage
:
build
stage
:
build
image
:
registry.ocamlpro.com/ocamlpro/ocaml-docker-images:4.12
image
:
debian:buster
before_script
:
before_script
:
-
opam switch create . ocaml-system --deps-only --locked
-
apt update
-
opam clean --switch-cleanup
-
apt install -yqq --no-install-recommends ca-certificates curl opam git pkg-config m4
-
opam init --disable-sandboxing --bare -ya
-
opam switch create ocaml-base-compiler.4.12.0
-
eval "$(opam env)"
-
opam pin add . -y --no-action
-
opam install opam-depext
-
opam depext -y ocpsite
-
opam install ./*.opam -y --deps-only --with-test --with-doc
script
:
script
:
-
opam exec -- dune build --profile release @all
-
opam exec -- dune build --profile release @all
-
opam exec -- dune runtest
-
opam exec -- dune runtest
...
@@ -45,9 +52,11 @@ make-image:
...
@@ -45,9 +52,11 @@ make-image:
# Here we inherit from nginx and just add the contents of our web-app
# Here we inherit from nginx and just add the contents of our web-app
-
|
-
|
echo "\
echo "\
FROM alpine:3.11
FROM bitnami/nginx:latest
ADD server.exe /usr/bin
ADD server.exe /opt/bitnami/nginx/sbin/nginx
RUN apk add libev
USER 0
RUN apt update && apt install -yqq libev4
USER 1001
" > $DOCKERFILE
" > $DOCKERFILE
# Deployments are pre-defined in the "dev" environment; they will be stopped
# Deployments are pre-defined in the "dev" environment; they will be stopped
...
@@ -57,7 +66,5 @@ make-image:
...
@@ -57,7 +66,5 @@ make-image:
# the corresponding DNS record as "CNAME" to "a.ocaml.pro"
# the corresponding DNS record as "CNAME" to "a.ocaml.pro"
deploy-prod
:
deploy-prod
:
extends
:
.deploy-prod
extends
:
.deploy-prod
script
:
-
/usr/bin/server.exe
variables
:
variables
:
PUBLIC_HOST
:
www.ocamlpro.com
PUBLIC_HOST
:
www.ocamlpro.com
dune-project
View file @
d3f96a14
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
(name ocpsite)
(name ocpsite)
(depends
(depends
(ocaml
(ocaml
(>= 4.1
2
))
(>= 4.1
0
))
(dream
(dream
(>= 1.0.0~alpha2))
(>= 1.0.0~alpha2))
(crunch
(crunch
...
...
ocpsite.opam
View file @
d3f96a14
...
@@ -3,7 +3,7 @@ opam-version: "2.0"
...
@@ -3,7 +3,7 @@ opam-version: "2.0"
license: "ISC"
license: "ISC"
depends: [
depends: [
"dune" {>= "2.0"}
"dune" {>= "2.0"}
"ocaml" {>= "4.1
2
"}
"ocaml" {>= "4.1
0
"}
"dream" {>= "1.0.0~alpha2"}
"dream" {>= "1.0.0~alpha2"}
"crunch" {>= "3.2.0"}
"crunch" {>= "3.2.0"}
"omd" {>= "2.0.0~alpha2"}
"omd" {>= "2.0.0~alpha2"}
...
...
src/server.ml
View file @
d3f96a14
...
@@ -31,7 +31,8 @@ let given_article path =
...
@@ -31,7 +31,8 @@ let given_article path =
end
end
let
()
=
let
()
=
Dream
.
run
@@
Dream
.
logger
Dream
.
run
~
interface
:
"0.0.0.0"
@@
Dream
.
logger
@@
Dream
.
router
@@
Dream
.
router
[
Dream
.
get
"/assets/**"
(
Dream
.
static
~
loader
:
asset_loader
""
)
[
Dream
.
get
"/assets/**"
(
Dream
.
static
~
loader
:
asset_loader
""
)
;
Dream
.
get
"/blog/assets/**"
(
Dream
.
static
~
loader
:
blog_asset_loader
""
)
;
Dream
.
get
"/blog/assets/**"
(
Dream
.
static
~
loader
:
blog_asset_loader
""
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment