Scripts and config files for provision and deploy transport and required services
To create a new release as a Docker image:
rake get_image_version
to generate the correct tag / release nameOn release creation (see https://github.com/etalab/transport-ops/blob/master/.github/workflows/docker.yml), a build will start, and should normally result into the publication of a GitHub-hosted Docker image named just like the release. You can find the resulting image here: https://github.com/etalab/transport-ops/pkgs/container/transport-ops This image URL can then be used by transport-site.
One major caveat: the workflow must exist at the moment the tag is created (https://github.community/t/workflow-set-for-on-release-not-triggering-not-showing-up/16286/7):
The trigger only executes when a release is created using a tag that contains the workflow.
See https://github.com/etalab/transport-ops/issues/45:
workflow_dispatch
event trigger: go to "actions" / "test and publish the docker image", "run workflow" on the right, pick the right tag.In the past images were named "betagouv/transport:x.y.z".
Now we name them after the Elixir, Erlang and Alpine versions actually used (like the base hexpm
image it uses).
hexpm/elixir:1.10.4-erlang-23.2.7.2-alpine-3.13.3
hexpm/elixir:
by betagouv/transport:elixir-
betagouv/transport:elixir-1.10.4-erlang-23.2.7.2-alpine-3.13.3
You can use rake get_image_version
to build the expected target name out of the Dockerfile
in automated fashion.
The production requires the following services:
transport-site: the web frontend
udata: references and/or stores the datasets and comments
The Transport Site project is tested with CircleCI in a Docker container that is defined in transport-site/Dockerfile
.
:warning: Currently, the auto-build mechanism is broken (see #17). See "Manual build" as a work-around in the mean time.
When updating that Dockerfile, push a git tag in the format a.b.c
and the image will be built by Dockerhub : https://hub.docker.com/r/betagouv/transport/
Then update https://github.com/etalab/transport-site/blob/master/.circleci/config.yml to match the new version.
As a work-around for #17:
IMAGE_VERSION=$(rake get_image_version)
IMAGE_NAME=betagouv/transport:$IMAGE_VERSION
docker build transport-site --no-cache -t $IMAGE_NAME --progress=plain
docker run -it --rm $IMAGE_NAME /bin/bash -c 'node --version'
docker run -it --rm $IMAGE_NAME /bin/bash -c 'elixir --version'
# only major
docker run -it --rm $IMAGE_NAME /bin/bash -c "erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'"
# full version (https://stackoverflow.com/a/34326368)
docker run -it --rm $IMAGE_NME /bin/bash -c "erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), \"releases\", erlang:system_info(otp_release), \"OTP_VERSION\"])), io:fwrite(Version), halt().' -noshell"
docker image ls
docker image ls | grep "betagouv/transport" | grep $IMAGE_VERSION
docker image push $IMAGE_NAME
latest
(but it is currently unused)Before creating a tag, the following commands can be used to verify the versions:
cd transport-site
docker build . -t test:latest --progress=plain
docker run -it --rm test:latest /bin/bash -c 'node --version'
docker run -it --rm test:latest /bin/bash -c 'elixir --version'
docker run -it --rm test:latest /bin/bash -c "erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'"