From bb1f28ac6e8e8ec70b08cc322977acbca0d5228b Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 16 Nov 2023 10:28:26 +0100 Subject: [PATCH] add ci/cd for smartfit_ web --- .drone.yml | 41 ++++++++++++++++++++++++++++++++++++++++- Dockerfile | 2 ++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml index ca59f89..3724950 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,6 +18,41 @@ steps: - curl -F "file=@$sfm_apk" https://anonfiles.me/api/v1/upload > upload.json - cat upload.json | cut -d '"' -f 12 + - name: build-web + image: ghcr.io/cirruslabs/flutter:3.13.9 + volumes: + - name: web_build + - path: /build + commands: + - flutter build web --web-rendere canvakit + - cp ./build/web/* /build + + - name: build-web-image + image: plugins/docker + volumes: + - name: web_build + - path: /build + settings: + dockerfile: Dockerfile + context: . + registry: hub.codefirst.iut.uca.fr + repo: hub.codefisrt.iut.uca.fr/remi.arnal/smartfit_web + username: + from_secret: cf_username + password: + from_password: cf_password + depends_on: [build-web] + + - name: deploy-web-image + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest + environement: + IMAGENAME: hub.codefirst.iut.uca.fr/remi.arnal/smartfit_web + CONTAINERNAME: smartfit_web + COMMAND: create + OVERWRITE: true + ADMINS: remiarnal,enzojolys,othmanebenjelloun + depends_on: [build-web-image] + - name: code-analysis image: ghcr.io/cirruslabs/flutter:3.13.9 environment: @@ -31,4 +66,8 @@ steps: - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export SONAR_SCANNER_OPTS="-server" - sonar-scanner -D sonar.projectKey=SmartFit_Mobile -D sonar.sources=. -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.login=$${SONAR_TOKEN} - depends_on: [ build-apk ] \ No newline at end of file + depends_on: [ build-apk, build-web ] + +volumes: + - name: web_build + temp: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73d7a1a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM httpd:2.4 +COPY /build/ /usr/local/apache2/htdocs/