Skip to content

Commit

Permalink
add local deploy nginx script
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed May 21, 2024
1 parent 39c6c02 commit 386b26d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineConfig({
},
vite: {
build: {
sourcemap: true,
sourcemap: false,
},
ssr: {
noExternal: ['react-component-benchmark'],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint": "eslint-config",
"format": "prettier-config",
"clean": "rm -rf node_modules yarn.lock",
"check-types": "tsc --noEmit --pretty"
"check-types": "tsc --noEmit --pretty",
"deploy:nginx": "bash scripts/deploy-nginx-local.sh"
},
"dependencies": {
"@astrojs/mdx": "^3.0.0",
Expand Down
31 changes: 31 additions & 0 deletions scripts/deploy-nginx-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Navigate to the website folder on the remote server and clear contents of the website folder
ssh arm1 'cd ~/traefik-proxy/apps/nmc-nginx-with-volume/website && \
echo "Listing files before clearing:" && \
echo "List before clearing:" && \
ls && \
echo "Count before clearing:" && \
ls -l | grep -v ^l | wc -l && \
echo "Clearing contents of the folder..." && \
rm -rf * && \
echo "List after clearing:" && \
ls && \
echo "Count after clearing:" && \
ls -l | grep -v ^l | wc -l && \
echo "Copying new contents..."'

# Copy new contents
scp -rq ./dist/* arm1:~/traefik-proxy/apps/nmc-nginx-with-volume/website
# rsync -az --progress ./dist/* arm1:~/traefik-proxy/apps/nmc-nginx-with-volume/website


# List all files after copying
ssh arm1 'cd ~/traefik-proxy/apps/nmc-nginx-with-volume/website && \
echo "List after copying:" && \
ls && \
echo "Count after copying:" && \
ls -l | grep -v ^l | wc -l'



0 comments on commit 386b26d

Please sign in to comment.