| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- ---
- ################
- # SECRETS #
- ################
-
- # push_deploy_key: id_rsa from DRONE host machine
-
-
- ################
- # Build & Test #
- ################
-
- kind: pipeline
- name: run_tests
-
- steps:
- # Test the vue theme
- - name: test
- image: node
- commands:
- - pwd
- - cd ./vue-theme
- - npm install
- - npm test
- volumes:
- # Link node_modules cache from host filesystem into container at the expected location
- - name: node_cache
- path: /drone/src/vue-theme/node_modules
-
- - name: build
- image: node
- commands:
- - cd ./vue-theme
- - rm -Rf ./build/*
- - npm run build
- - ls ./build
- volumes:
- # Link node_modules cache from host filesystem into container at the expected location
- - name: node_cache
- path: /drone/src/vue-theme/node_modules
- - name: build
- path: /drone/src/vue-theme/build
-
- volumes:
- - name: node_cache
- host:
- path: /tmp/cache/drone/node_modules
- - name: build
- host:
- path: /tmp/cache/drone/build
- ---
- ########################
- # Deploy to Production #
- ########################
-
- kind: pipeline
- name: deploy
- depends_on:
- # Must run after the first pipeline
- - run_tests
- trigger:
- status:
- # Only runs if the first pipeline was fully successful
- - success
-
- steps:
- # post-receive hook
- - name: push commit
- image: appleboy/drone-git-push:0.2.0-linux-amd64
- settings:
- branch: master
- remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
- remote_name: staging
- force: true
- ssh_key:
- # !: id_rsa from DRONE machine
- from_secret: push_deploy_key
-
- volumes:
- - name: node_cache
- host:
- path: /tmp/cache/drone/node_modules
- - name: build
- host:
- path: /tmp/cache/drone/build
|