You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.3 KiB
88 lines
2.3 KiB
image: node:latest
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
compile:
|
|
stage: build
|
|
script:
|
|
- npm install
|
|
- npm run grunt
|
|
artifacts:
|
|
expire_in: 6 hours
|
|
paths:
|
|
- dist/*.cfg
|
|
- dist/*.lua
|
|
- dist/**/*.cfg
|
|
- dist/**/*.lua
|
|
only:
|
|
- master
|
|
- develop
|
|
tags:
|
|
- docker
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- echo "Testing happening here"
|
|
only:
|
|
- master
|
|
- develop
|
|
tags:
|
|
- docker
|
|
|
|
development:
|
|
image: panubo/sshd:latest
|
|
stage: deploy
|
|
variables:
|
|
DEPLOY_USER: "deploy"
|
|
DEPLOY_HOST: "sothr.com"
|
|
DEPLOY_PORT: "9140"
|
|
ENVIRONMENT: "Development"
|
|
TARGET_DIRECTORY: "~/download_dir/oc/development"
|
|
DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/development"
|
|
MINIFIED_SOURCE: "false"
|
|
script:
|
|
- echo "Deployment To Development Starting..."
|
|
- eval `ssh-agent -s`
|
|
- ssh-add <(echo "$SSH_DEPLOY_KEY")
|
|
- pushd ./dist
|
|
- find * -type f -exec sed -i -e 's@{ENV}@'"$ENVIRONMENT"'@g' {} \;
|
|
- find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
|
|
- find * -type f -exec sed -i -e 's@{MINIFIED}@'"$MINIFIED_SOURCE"'@g' {} \;
|
|
- popd
|
|
- rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
|
|
only:
|
|
- develop
|
|
tags:
|
|
- docker
|
|
environment: development
|
|
|
|
production:
|
|
image: panubo/sshd:latest
|
|
stage: deploy
|
|
variables:
|
|
DEPLOY_USER: "deploy"
|
|
DEPLOY_HOST: "sothr.com"
|
|
DEPLOY_PORT: "9140"
|
|
ENVIRONMENT: "Release"
|
|
TARGET_DIRECTORY: "~/download_dir/oc/release"
|
|
DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/release"
|
|
MINIFIED_SOURCE: "true"
|
|
script:
|
|
- echo "Deployment To Production Starting..."
|
|
- eval `ssh-agent -s`
|
|
- ssh-add <(echo "$SSH_DEPLOY_KEY")
|
|
- pushd ./dist
|
|
- find * -type f -exec sed -i -e 's@{ENV}@'"$ENVIRONMENT"'@g' {} \;
|
|
- find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
|
|
- find * -type f -exec sed -i -e 's@{MINIFIED}@'"$MINIFIED_SOURCE"'@g' {} \;
|
|
- popd
|
|
- rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
|
|
only:
|
|
- master
|
|
tags:
|
|
- docker
|
|
environment: production
|