Update CI/CD pipeline and Dockerfile for Flutter web app: rename image tags and adjust output paths
This commit is contained in:
+9
-8
@@ -4,23 +4,24 @@
|
|||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: (dev) build flutter web and push to artifactory
|
name: (main) build flutter web and push to artifactory
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: tag tender-pwa image
|
- name: tag pwa
|
||||||
image: alpine/git:2.40.1
|
image: alpine/git:2.40.1
|
||||||
commands:
|
commands:
|
||||||
- APP_VERSION=pwa-$(git rev-list HEAD --count --no-merges)
|
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
|
||||||
- echo "Flutter PWA Version tags $APP_VERSION"
|
- echo "APP Version tags $APP_VERSION"
|
||||||
- echo -n "$APP_VERSION" > .tags
|
- echo -n "$APP_VERSION" >> .tags
|
||||||
- name: tender pwa push to artifactory
|
|
||||||
|
- name: tm pwa push to artifactory
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
dockerfile: "Dockerfile"
|
dockerfile: "Dockerfile"
|
||||||
username: "cicd"
|
username: "cicd"
|
||||||
password:
|
password:
|
||||||
from_secret: "REGISTRY_PASSWORD"
|
from_secret: "REGISTRY_PASSWORD"
|
||||||
repo: "artifactory.ravanertebat.ir/citizenclub/tm_app"
|
repo: "artifactory.ravanertebat.ir/tm/pwa"
|
||||||
registry: "artifactory.ravanertebat.ir"
|
registry: "artifactory.ravanertebat.ir"
|
||||||
build_args:
|
build_args:
|
||||||
- FLUTTER_VERSION=3.29.3
|
- FLUTTER_VERSION=3.29.3
|
||||||
@@ -31,6 +32,6 @@ node:
|
|||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- dev
|
- main
|
||||||
event:
|
event:
|
||||||
- custom
|
- custom
|
||||||
+2
-2
@@ -35,7 +35,7 @@ WORKDIR /app
|
|||||||
# Clean and get packages
|
# Clean and get packages
|
||||||
RUN flutter clean
|
RUN flutter clean
|
||||||
RUN flutter pub get
|
RUN flutter pub get
|
||||||
RUN flutter build web --release --output=build/tender-pwa
|
RUN flutter build web --release --output=build/tm_pwa
|
||||||
|
|
||||||
# Stage 2 - Runtime with NGINX
|
# Stage 2 - Runtime with NGINX
|
||||||
FROM nginx:${NGINX}
|
FROM nginx:${NGINX}
|
||||||
@@ -49,7 +49,7 @@ RUN apk --no-cache add \
|
|||||||
&& chown nginx:nginx /var/log/app
|
&& chown nginx:nginx /var/log/app
|
||||||
|
|
||||||
# Copy build files from Debian builder
|
# Copy build files from Debian builder
|
||||||
COPY --from=builder /app/build/tender-pwa /usr/tm/nginx/html
|
COPY --from=builder /app/build/tm_pwa /usr/tm/nginx/html
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Reference in New Issue
Block a user