+38
-24
@@ -1,43 +1,57 @@
|
|||||||
########### MOODIO TEST ###########
|
|
||||||
###################################
|
|
||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: (pwa-test) build pwa and scp to test server
|
name: build-and-push-pwa
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build flutter
|
- name: build flutter
|
||||||
image: docker-mirror.ravanertebat.ir/ghcr/cirruslabs/flutter:3.38.10
|
image: ghcr.io/cirruslabs/flutter:3.38.10
|
||||||
commands:
|
commands:
|
||||||
- flutter --version
|
- flutter --version
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
case "$DRONE_BRANCH" in
|
SHORT_SHA=$(echo "$DRONE_COMMIT_SHA" | cut -c1-8)
|
||||||
master) echo prod;;
|
IMG_TAG="${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}"
|
||||||
uat) echo uat;;
|
echo -n "$IMG_TAG,$SHORT_SHA" > .tags
|
||||||
dev) echo test;;
|
echo "Image tags -> $IMG_TAG , $SHORT_SHA"
|
||||||
*) echo dev;;
|
|
||||||
esac > .environment
|
|
||||||
- echo "Branch ${DRONE_BRANCH}, Environment $(cat .environment)"
|
|
||||||
- APP_VERSION=$(cat .environment)-${DRONE_BUILD_NUMBER}
|
|
||||||
- echo "APP Version tags $APP_VERSION"
|
|
||||||
- echo -n "$APP_VERSION,latest" >> .tags
|
|
||||||
- mkdir -p ./artifacts/flutter
|
- mkdir -p ./artifacts/flutter
|
||||||
- rm -rf build
|
- rm -rf build
|
||||||
- flutter pub get
|
- flutter pub get
|
||||||
- flutter build web --release --output=build/tm_pwa
|
- flutter build web --release --output=build/tm_pwa
|
||||||
- ls -ltrh build/tm_pwa
|
- ls -ltrh build/tm_pwa
|
||||||
|
|
||||||
- name: build admin and push to artifactory
|
- name: push pwa
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
# dockerfile: Dockerfile-admin
|
registry: git.opplens.se
|
||||||
username: cicd
|
repo: git.opplens.se/mazyar/pwa
|
||||||
|
username:
|
||||||
|
from_secret: registry_username
|
||||||
password:
|
password:
|
||||||
from_secret: REGISTRY_PASSWORD
|
from_secret: registry_password
|
||||||
repo: artifactory.ravanertebat.ir/tm/pwa
|
|
||||||
registry: artifactory.ravanertebat.ir
|
- name: deploy-uat
|
||||||
node:
|
image: appleboy/drone-ssh
|
||||||
tag: aecde-docker-runner
|
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
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
@@ -45,4 +59,4 @@ trigger:
|
|||||||
- uat
|
- uat
|
||||||
- dev
|
- dev
|
||||||
event:
|
event:
|
||||||
- custom
|
- push
|
||||||
|
|||||||
Reference in New Issue
Block a user