```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -6,14 +6,6 @@ jobs:

     steps:
       - checkout
-      - add_ssh_keys:
-          fingerprints:
-            - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
-      - run:
-          name: Start ssh-keyscan
-          command: |
-            ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
-
       - run:
           name: Change Amazon Links
           working_directory: /root/project/
@@ -42,3 +34,17 @@ jobs:
             do
               gzip -c ${TARGET} > ${TARGET}.gz
             done
+
+      - add_ssh_keys:
+          fingerprints:
+            - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
+      - run:
+          name: Start ssh-keyscan
+          command: |
+            ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
+
+      - run:
+          name: Deploy
+          command: |
+            ssh -p i${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
+            rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test
```
This commit is contained in:
Kazuhiro MUSASHI 2019-05-04 21:13:59 +08:00
parent 51ea68b3e3
commit c67daed5be
1 changed files with 14 additions and 8 deletions

View File

@ -6,14 +6,6 @@ jobs:
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
- run:
name: Start ssh-keyscan
command: |
ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
- run:
name: Change Amazon Links
working_directory: /root/project/
@ -42,3 +34,17 @@ jobs:
do
gzip -c ${TARGET} > ${TARGET}.gz
done
- add_ssh_keys:
fingerprints:
- "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
- run:
name: Start ssh-keyscan
command: |
ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
- run:
name: Deploy
command: |
ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test