Commit c08a1950 authored by 郭铭瑶's avatar 郭铭瑶 🤘
parents 31a5033e 526092e1
stages:
- build
- deploy
variables:
GIT_STRATEGY: none
GIT_SSH_COMMAND: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
UPSTREAM_TAG: $CI_COMMIT_TAG
PROJECT_NAME: 'huamu_party_building_3d'
BUILD_COMMAND_PROD: 'npm run build'
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
.build_artifact:
# image: registry-vpc.cn-hangzhou.aliyuncs.com/mdt/ndm_lite:build
image: registry-vpc.cn-hangzhou.aliyuncs.com/delivery/node12_docker:build
stage: build
tags:
- build-docker
script:
# TODO(Deo): deploy prod docker runner
# - git clone -b ${UPSTREAM_TAG} --depth 1 ssh://git@172.16.148.75:9522/haute-couture/huamu/collector_admin.git $PROJECT_NAME
- git clone -b ${UPSTREAM_TAG} --depth 1 ssh://git@gitlab.idatatlas.com:9522/haute-couture/huamu/$PROJECT_NAME.git
$PROJECT_NAME
- cd ./$PROJECT_NAME
- rm -rf .temp
- npm install
# NONTICE: generally all hashed files uploaded to oss for cd used
- $COMMAND
# NOTICE: all real time updated files will be uploaded to nginx
- cd dist
- tar -czvf ../${UPSTREAM_TAG}.tar.gz .
- mv ../${UPSTREAM_TAG}.tar.gz ${CI_PROJECT_DIR}
artifacts:
paths:
- ${UPSTREAM_TAG}.tar.gz
expire_in: 2 days
.deploy_artifact:
stage: deploy
script:
- mkdir -p /var/www/statics/$PROJECT_NAME
- tar --touch -xvf ${UPSTREAM_TAG}.tar.gz -C /var/www/statics/$PROJECT_NAME
- rm -f `find "/var/www/statics/${PROJECT_NAME}" -mtime +3 -type f`
build_prod:
extends: .build_artifact
only:
- /^prod-.*$/
variables:
COMMAND: $BUILD_COMMAND_PROD
deploy_prod:
extends: .deploy_artifact
tags:
- vpc_nginx
only:
- /^prod-.*$/
dependencies:
- build_prod
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "huamu", "name": "huamu_party_building_3d",
"version": "1.0.0", "version": "1.0.0",
"description": "花木街道数字孪生城市", "description": "花木街道数字孪生城市",
"homepage": "/statics/huamu_party_building_3d",
"author": "GuoMingyao", "author": "GuoMingyao",
"private": true, "private": true,
"scripts": { "scripts": {
......
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
TAG: '54344e11-c0d3-40d5-8f99-771066249328', TAG: '54344e11-c0d3-40d5-8f99-771066249328',
GET_AUTH: '988fc63e-fa55-4729-851d-24c4355213f2/storage/grant', GET_AUTH: '988fc63e-fa55-4729-851d-24c4355213f2/storage/grant',
GET_USER_ID: 'https://www.maicedata.com/auth/user/bytoken', GET_USER_ID: 'https://www.maicedata.com/auth/user/bytoken',
USER: '3625616b-7f2c-449a-8306-101aac7b8b97', USER: 'add27775-bbe7-4303-b38a-06b4e3cd88d3',
ORG: 'b47ddc9a-0aa7-45a8-b1b6-6064f888d537', ORG: 'b70f4cca-d7c2-499f-9ccd-243d205847d6 ,
MENU: 'd64f4037-1a0c-4900-a8a1-80a7115e0995', MENU: 'd64f4037-1a0c-4900-a8a1-80a7115e0995',
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment