From ca85d3142dba4aeb3c1216d4893ef42fc11283a6 Mon Sep 17 00:00:00 2001 From: mazyar Date: Sat, 20 Jun 2026 09:12:57 +0000 Subject: [PATCH] Update .drone.yml --- .drone.yml | 76 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 90fee42..3eae804 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,41 +1,61 @@ -################################################################################ -# web -################################################################################ kind: pipeline type: docker -name: (landing) build form and push to artifactory +name: build-and-push-pwa steps: - - name: tag - image: alpine/git:2.40.1 - environment: - GOOS: linux - GOARCH: amd64 - CGO_ENABLED: 0 - settings: - debug: true + - name: build flutter + image: ghcr.io/cirruslabs/flutter:3.38.10 commands: - - APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH - - echo "APP Version tags $APP_VERSION" - - echo -n "$APP_VERSION" >> .tags + - flutter --version + - | + set -e + SHORT_SHA=$(echo "$DRONE_COMMIT_SHA" | cut -c1-8) + IMG_TAG="${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}" + echo -n "$IMG_TAG,$SHORT_SHA" > .tags + echo "Image tags -> $IMG_TAG , $SHORT_SHA" + - rm -rf pwa_dist + - flutter pub get + - flutter build web --release --output=pwa_dist + - ls -ltrh pwa_dist - - name: build landing + - name: push pwa image: plugins/docker settings: - # build_args: - # - BUILD_APP=scraper - username: cicd + registry: git.opplens.se + repo: git.opplens.se/mazyar/pwa + username: + from_secret: registry_username password: - from_secret: REGISTRY_PASSWORD - # dockerfile: Dockerfile-drone - repo: artifactory.ravanertebat.ir/tm/landing - registry: artifactory.ravanertebat.ir + from_secret: registry_password + + - name: deploy-uat + image: appleboy/drone-ssh + settings: + host: 10.0.0.3 + username: mazyar + port: 22 + key: + from_secret: ssh_deploy_key + envs: + - DRONE_BUILD_NUMBER + - DRONE_BRANCH + script: + - set -e + - cd /data/tm-uat + - NEW_TAG="${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}" + - echo "Deploying pwa tag $NEW_TAG" + - sed -i "s/^PWA_IMG_TAG=.*/PWA_IMG_TAG=$NEW_TAG/" .env + - docker compose pull pwa + - docker compose up -d pwa + - docker image prune -f + when: + branch: + - dev -node: - tag: aecde-docker-runner trigger: branch: - - main - - develop + - master + - uat + - dev event: - - custom + - push