Commit Graph

24 Commits

Author SHA1 Message Date
Kazuhiro MUSASHI 2e0944eb93 Update deploy target to `10.0.1.222`. 2023-08-20 20:00:08 +09:00
Kazuhiro MUSASHI 4a0d309c43 Modify `new` task. 2022-10-16 21:23:22 +09:00
Kazuhiro MUSASHI e5d33d6fe6 Modify `demo` task. 2022-10-16 21:23:00 +09:00
Kazuhiro MUSASHI 33247773f4 Modify & create `rake` tasks. 2021-03-06 21:01:40 +09:00
Kazuhiro MUSASHI 0def02e164 Generate .webp instead of .png 2021-03-06 21:01:27 +09:00
Kazuhiro MUSASHI ccc0696ca3 Modify rake task for generating OGP images. 2021-03-06 16:47:41 +09:00
Kazuhiro MUSASHI f5b0aabbc4 Add task for `tcardgen`. 2021-02-27 08:56:35 +09:00
Kazuhiro MUSASHI b32d4c2903 Use `xargs` for the Rake tasks. 2020-05-01 14:30:53 +09:00
Kazuhiro MUSASHI a3985fde39 Gzip the `.html` files. 2020-04-30 23:59:50 +09:00
Kazuhiro MUSASHI 3923fd264c Add `--minify` option to `Rakefile` task. 2020-04-18 23:04:21 +08:00
Kazuhiro MUSASHI 2cb2429110 [ci skip] Change the deployment target servres. 2020-01-05 19:12:34 +08:00
Kazuhiro MUSASHI 3b4bd88c15 オリジナルデータを/home/webadm/works/public配下にコピー
```
--- a/tasks/production.rake
+++ b/tasks/production.rake
@@ -16,5 +16,7 @@ task :prod => [:prep] do
   end

   sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /var/www/blog/*"'
+  sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /home/webadm/works/public/*"'
   sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.234:/var/www/blog'
+  sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.234:/home/webadm/works/public'
 end
```
2019-07-16 19:39:27 +08:00
Kazuhiro MUSASHI a892daa154 Create the production deploy task. 2019-06-29 19:33:48 +08:00
Kazuhiro MUSASHI a93b333da9 Create staging deploy task. 2019-06-29 19:33:32 +08:00
Kazuhiro MUSASHI fc5d0a22c6 Separate the preparation part from the `build.rake`. 2019-06-29 19:33:32 +08:00
Kazuhiro MUSASHI 522b11ce16 Mac OS向けにオプションを変更:
```
--- a/tasks/build.rake
+++ b/tasks/build.rake
@@ -24,12 +24,14 @@ task :build do
     if os == :linux
       sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
       sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'find . -type f -name "*.mde" | xargs --no-run-if-empty rm || true'
+      sh 'find . -type f -name "*.md-e" | xargs --no-run-if-empty rm || true'
     else
-      sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
-      sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'grep -l -r ecx.images-amazon.com . | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
+      sh 'grep -l -r "http://www.amazon.co.jp/exec" . | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'find . -type f -name "*.mde" | xargs rm || true'
+      sh 'find . -type f -name "*.md-e" | xargs rm || true'
     end
-    sh 'find . -type f -name "*.mde" | xargs --no-run-if-empty rm || true'
-    sh 'find . -type f -name "*.md-e" | xargs --no-run-if-empty rm || true'
   end

   cd 'public' do
```
2019-06-16 17:23:16 +07:00
Kazuhiro MUSASHI c06b55ae44 Build the blog site for the staging environment:
```
--- a/tasks/build.rake
+++ b/tasks/build.rake
@@ -36,5 +36,5 @@ task :build do
     sh 'rm -rf *'
   end

-  sh 'hugo'
+  sh 'hugo -e staging -v'
 end
```
2019-05-06 11:13:44 +08:00
Kazuhiro MUSASHI 71876190b9 Deploy blog site to the staging environment:
```
--- a/tasks/deploy.rake
+++ b/tasks/deploy.rake
@@ -12,8 +12,6 @@ task :deploy => [:build] do
     end
   end

-  sh 'rsync -e "ssh -p 10022" -az --delete public webadm@10.0.1.234:~/works'
-
-  sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /var/www/blog/*"'
-  sh 'ssh -p 10022 webadm@10.0.1.234 "cp -pr ~/works/public/* /var/www/blog/"'
+  sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /var/www/test/*"'
+  sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.234:/var/www/test'
 end
```
2019-05-06 11:12:44 +08:00
Kazuhiro MUSASHI 5b797ab092 Delete `test.rake` file. 2019-04-20 14:38:39 +08:00
Kazuhiro MUSASHI 82dffcdc73 Create the new artcle markdown to be generated under content directory
```
--- a/tasks/new.rake
+++ b/tasks/new.rake
@@ -6,7 +6,7 @@ task :new do
   day = Time.now
   title = ARGV.last.downcase

-  postname =  "post/#{day.year}-#{day.strftime("%m")}-#{day.strftime("%d")}-#{title}.md"
+  postname = "#{day.year}-#{day.strftime("%m")}-#{day.strftime("%d")}-#{title}.md"

   # generate the post md file:
   sh "hugo new #{postname}"
```
2019-04-20 14:38:32 +08:00
Kazuhiro MUSASHI 4d0a0b1add Change the grep option/arguments to list up all the markdown files. 2019-04-20 14:36:03 +08:00
Kazuhiro MUSASHI 20da08ecbb Delete the `public` directory before generating the contents.
```
--- a/tasks/build.rake
+++ b/tasks/build.rake
@@ -20,8 +20,6 @@ end

 desc 'Generate the HTML pages'
 task :build do
-  sh 'hugo'
-
   cd 'content/post' do
     if os == :linux
       sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
@@ -33,4 +31,10 @@ task :build do
     sh 'rm *.mde || true'
     sh 'rm *.md-e || true'
   end
+
+  cd 'public' do
+    sh 'rm -rf *'
+  end
+
+  sh 'hugo'
 end
```
2019-04-13 19:03:45 +08:00
Kazuhiro MUSASHI 4feda5305c Delete the unnecessary commands from the new task. 2019-04-02 23:12:33 +07:00
Kazuhiro MUSASHI 3c8b202f54 initial commit 2019-03-31 19:00:21 +08:00