Commit 3f3226b7 authored by Alexander Sachs's avatar Alexander Sachs

added s3 bucket for deployment

parent 2dc68e68
Pipeline #35658 failed
......@@ -10,24 +10,49 @@ stages:
- build
- deploy
variables:
AWS_DEFAULT_REGION: eu-central-1 # The region of our S3 bucket
BUCKET_NAME: rtlsfrontent # Your bucket name
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
install_dependencies:
install_dependencies_and_build:
stage: build
script:
- npm install
- npm build
artifacts:
expire_in: 1 week
paths:
- node_modules/
- dist/
deploys3:
image: "python:latest" # We use python because there is a well-working AWS Sdk
stage: deploy
dependencies:
- build_site # We want to specify dependencies in an explicit way, to avoid confusion if there are different build jobs
before_script:
- pip install awscli # Install the SDK
script:
- aws s3 cp _site s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive # Replace example-bucket with your bucket
environment:
name: ${CI_COMMIT_REF_SLUG}
url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/${CI_COMMIT_REF_SLUG} # This is the url of the bucket we saved before
on_stop: clean_s3 # When the branch is merged, we clean up after ourself
deploy:prod:
clean_s3:
image: "python:latest"
stage: deploy
before_script:
- pip install awscli
script:
- bash deploy/deploy.sh
only:
- master
- aws s3 rm s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive # Replace example-bucket with your bucket
environment:
name: ${CI_COMMIT_REF_SLUG}
action: stop
when: manual
......@@ -28,7 +28,7 @@ cd /home/ubuntu/rtls_frontend
#install npm packages
echo "Running npm install"
npm install
npm install --no-optional
#Restart the node server
echo "Starting the server with pm2"
......
......@@ -7265,6 +7265,12 @@
"merge-stream": "^1.0.1"
}
},
"jquery": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-1.9.1.tgz",
"integrity": "sha1-5M1INfqu+63lNYV2E8D8P/KtrzQ=",
"dev": true
},
"js-base64": {
"version": "2.4.9",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.9.tgz",
......
......@@ -71,7 +71,8 @@
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
"webpack-merge": "^4.1.0",
"jquery": "1.9.1"
},
"engines": {
"node": ">= 6.0.0",
......
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/rtlsfrontend'
import rtlsfrontend from '@/components/rtlsfrontend'
Vue.use(Router)
......@@ -8,8 +8,8 @@ export default new Router({
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
name: 'rtlsfrontend',
component: rtlsfrontend
}
]
})
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