From e289de8de8cc28b05350e042795232a5dcced4b0 Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Sat, 5 Feb 2022 15:18:41 +0330 Subject: [PATCH] gitlab ci configuration --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..627df15 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +stages: + - build + - push + - deploy + +build: + script: + - flutter clean + - flutter build web --webrenderer canvaskit + +push: + stage: push + image: docker:latest + services: + - docker:dind + script: + - docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY + - docker build --pull -t registry.gitlab.com/didvan/didvan-panel-server/api:latest . + - docker push registry.gitlab.com/didvan/didvan-panel-server/api:latest + only: + - test + +deploy: + stage: deploy + image: python:3.10.2 + variables: + COLLECT_ERROR: 1 + script: + - pip install fandogh_cli --upgrade + - fandogh login --username=$FAN_USR --password=$FAN_PASS + - fandogh service apply -f ./deployment/config.yaml -p SEC_NAME + only: + - test \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..32d7267 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:latest +COPY ./build/web /usr/share/nginx/html/ +ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file