From 863e8cedbf5813847c42b95ea816d4d98f175ff3 Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sat, 7 Jun 2025 09:04:12 +0200 Subject: [PATCH] Add GitLab CI, Dockerfile, and demo-1 * Configured GitLab CI for Docker image builds and added a Dockerfile with the necessary setup for the main website and demo-1. * Updated URL and removed duplicate entry in `demos.ts` to resolve conflicts. * Integrated `.run` configuration for lawfirm-demo1 to streamline local development. --- .gitlab-ci-template.yml | 10 ++++++++++ .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ .run/lawfirm-demo1.run.xml | 14 ++++++++++++++ Dockerfile | 28 ++++++++++++++++++++++++++++ main-website/app/data/demos.ts | 14 +------------- 5 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 .gitlab-ci-template.yml create mode 100644 .gitlab-ci.yml create mode 100644 .run/lawfirm-demo1.run.xml create mode 100644 Dockerfile diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml new file mode 100644 index 0000000..efbc4a1 --- /dev/null +++ b/.gitlab-ci-template.yml @@ -0,0 +1,10 @@ +.docker-login: + before_script: + - echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin + +docker-build-template: + image: docker:20.10@sha256:2967f0819c84dd589ed0a023b9d25dcfe7a3c123d5bf784ffbb77edf55335f0c + extends: .docker-login + script: + - docker build --build-arg WORKDIR_PATH=$WORKDIR_PATH -t $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_REF_SLUG -f $DOCKERFILE_PATH . + - docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_REF_SLUG diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..97b854d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,28 @@ +image: docker:20.10 + +include: + - local: '.gitlab-ci-template.yml' + +stages: + - dockerize + +variables: + CI_REGISTRY_IMAGE: $CI_REGISTRY/$CI_PROJECT_PATH + PROJECT_NAME: $CI_PROJECT_NAME + TAG: $CI_COMMIT_REF_SLUG + +# Main Website +build_main_website: + stage: dockerize + extends: .docker-build-template + variables: + IMAGE_NAME: main-website + WORKDIR_PATH: ./main-website + +# Demo 1 +build_demo_1: + stage: dockerize + extends: .docker-build-template + variables: + IMAGE_NAME: ld1 + WORKDIR_PATH: ./lawfirm-demos/demo-1 \ No newline at end of file diff --git a/.run/lawfirm-demo1.run.xml b/.run/lawfirm-demo1.run.xml new file mode 100644 index 0000000..dd08480 --- /dev/null +++ b/.run/lawfirm-demo1.run.xml @@ -0,0 +1,14 @@ + + + + + +