+48
-28
@@ -1,41 +1,61 @@
|
|||||||
################################################################################
|
|
||||||
# web
|
|
||||||
################################################################################
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: (landing) build form and push to artifactory
|
name: build-and-push-pwa
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: tag
|
- name: build flutter
|
||||||
image: alpine/git:2.40.1
|
image: ghcr.io/cirruslabs/flutter:3.38.10
|
||||||
environment:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: amd64
|
|
||||||
CGO_ENABLED: 0
|
|
||||||
settings:
|
|
||||||
debug: true
|
|
||||||
commands:
|
commands:
|
||||||
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
|
- flutter --version
|
||||||
- echo "APP Version tags $APP_VERSION"
|
- |
|
||||||
- echo -n "$APP_VERSION" >> .tags
|
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
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
# build_args:
|
registry: git.opplens.se
|
||||||
# - BUILD_APP=scraper
|
repo: git.opplens.se/mazyar/pwa
|
||||||
username: cicd
|
username:
|
||||||
|
from_secret: registry_username
|
||||||
password:
|
password:
|
||||||
from_secret: REGISTRY_PASSWORD
|
from_secret: registry_password
|
||||||
# dockerfile: Dockerfile-drone
|
|
||||||
repo: artifactory.ravanertebat.ir/tm/landing
|
- name: deploy-uat
|
||||||
registry: artifactory.ravanertebat.ir
|
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:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- master
|
||||||
- develop
|
- uat
|
||||||
|
- dev
|
||||||
event:
|
event:
|
||||||
- custom
|
- push
|
||||||
|
|||||||
Reference in New Issue
Block a user