Commit f0cd8a55 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

testing frontend deploy script

parent 88454ec5
Pipeline #9805 passed with stage
in 26 seconds
......@@ -8,33 +8,33 @@ variables:
POSTGRES_DB: doorcode
stages:
- build
# - build
# - test
- deploy
build_web_backend:
stage: build
script:
- src/backend/install-dev.sh
artifacts:
paths:
- src/backend/vendor
- src/backend/.env
- src/backend/composer.lock
# Currently set to build timeout
expire_in: 1 hour
build_web_frontend:
stage: build
script:
- cd src/frontend
- npm install
- npm run build --mode=production --dest=dist
artifacts:
paths:
- src/frontend/dist
expire_in: 30 days
#build_web_backend:
# stage: build
# script:
# - src/backend/install-dev.sh
# artifacts:
# paths:
# - src/backend/vendor
# - src/backend/.env
# - src/backend/composer.lock
# # Currently set to build timeout
# expire_in: 1 hour
#
#build_web_frontend:
# stage: build
# script:
# - cd src/frontend
# - npm install
# - npm run build --mode=production --dest=dist
# artifacts:
# paths:
# - src/frontend/dist
# expire_in: 30 days
#
#test_php_styles:
# stage: test
# script:
......@@ -88,7 +88,9 @@ deploy_frontend_production:
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- "SSH_COMMAND_STRING=\"curl --location --header 'PRIVATE-TOKEN: ${CI_JOB_TOKEN}' '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_BUILD_REF_NAME}/download?job=build_web_frontend' --output test\""
- "SSH_COMMAND_STRING=\"curl --location --header 'PRIVATE-TOKEN: ${CI_DEPLOY_PASSWORD}' '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_BUILD_REF_NAME}/download?job=build_web_frontend' --output frontend.zip\""
- SSH_COMMAND_STRING+=" && unzip frontend.zip && mv src/frontend/dist/ doorcode/src/frontend/"
- SSH_COMMAND_STRING+=" && rm -rf src/ frontend.zip"
- echo "$SSH_COMMAND_STRING"
# Execute the deploy
- ssh $SSH_USER@$SSH_HOST "${SSH_COMMAND_STRING}"
......
Supports Markdown
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