From 8777a8df7bb1e3cc04e599926f75286278cfa73f Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 30 Jan 2021 20:37:10 +0100 Subject: [PATCH] remove Travis --- .dockerignore | 2 +- .travis.yml | 41 ----------------------------- README.md | 19 +++++++------ package.json | 2 +- scripts/{deploy.sh => deploy-s3.sh} | 39 +++++---------------------- 5 files changed, 17 insertions(+), 86 deletions(-) delete mode 100644 .travis.yml rename scripts/{deploy.sh => deploy-s3.sh} (54%) diff --git a/.dockerignore b/.dockerignore index 7b49a069..8b24d09c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,7 +10,7 @@ LICENSE .vscode public .cache -.travis.yml +.github package-lock.json README.md coverage diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ac4e0487..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -dist: xenial -language: node_js -node_js: node - -git: - depth: 10 - -cache: - npm: true - directories: - - public - -before_install: - - sudo apt-get -qq update - - sudo apt-get install python3-pip - - sudo -H pip3 install --upgrade pip - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - './cc-test-reporter before-build' - -script: - - npm test - - './cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT' - - travis_wait 60 npm run build - -after_success: - - pip install --user awscli - - export PATH=$PATH:$HOME/.local/bin - - npm run deploy - -notifications: - email: false - slack: - template: - - '%{branch} *%{result}* build (<%{build_url}|#%{build_number}>) for <%{compare_url}|%{commit}>' - - 'Execution time: *%{duration}*' - - 'Message: %{message}' - rooms: - - secure: 'Ot7Ryl4PW0/TUo4t4Y3J6AbmxqNUtFOI72vNabNX2IdEiU78q+M3esPEkT2I/z0S2Vda9ogRkRbKa5blE2ZEo74/9CUYRXX/syPSZL9tpHDd600wmiObee469Au8dSO48n8G9U+Dm1q60O6oiEGsrrAR6fNE386QEfDhVqKKwBKHk9RcUocUO2b+0WKI7MJk+j5G4+sxv/5ax8prGx0sD6bRoGRuNpyW/MZ9uylBV2WOdmHfEY9D8GYpzVs2JqTB7xr/OL9d+puZPQSdqGfa7xtc+APFiKK//aW/ffOsNzGa4kygC94nfV4oJceMUO3v0bDpB5aXM1YG02EyQzSwpGCbtnbP9Ei/ANcGqiFjPm1/ZVAiwPzT8XZLWkFjy+sOfmF+xmszUCoRiJBVxfL0tx0d1o/JIvgA5m+/iIpro70ep0nBHTiDt2AoxaGGE9GnIT20uVXJJIdXIwTWhVx4HnkptYsFel9l2/oc24S+CnitRaCtGQCiAMNNCESL1AcHCRot/4gm3uuZLdYEA1juHUvgEEH6jG5T2XWaq4uEbDZKdu8y7YMW105FytEsyNU3Tzem4c024EIAhBshSfg5N/iwVeic47E1QAz/5RtfBNLQaEPY4TGJYJvTOaCevjYC7mKlYBEoZmsfT0uNaWqEXUxUwLg5Ih8JoLQKvH6H4fA=' diff --git a/README.md b/README.md index 5e79cb88..cc858c01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +

🍭 My blog built with Gatsby + TypeScript. Neat. @@ -8,10 +8,9 @@ kremalicious.com

- + -

--- @@ -33,6 +32,7 @@ - [👩‍🔬 Testing](#-testing) - [🎈 Add a new post](#-add-a-new-post) - [🚚 Deployment](#-deployment) + - [S3 Deployment](#s3-deployment) - [🏛 Licenses](#-licenses) - [Posts](#posts) - [Photos & images](#photos--images) @@ -233,19 +233,18 @@ npm run new photo /path/to/photo.jpg ## 🚚 Deployment -Automatic deployments are triggered upon successful tests & builds on Travis: +Every branch or Pull Request is automatically deployed by [Vercel](https://vercel.com) with their GitHub integration. A link to a preview deployment will appear under each Pull Request. -- push to `main` initiates a live deployment -- any Pull Request, and subsequent pushes to it, initiates a beta deployment +The latest deployment of the `main` branch is automatically aliased to `kremalicious.com`. -The deploy command simply calls the [`scripts/deploy.sh`](scripts/deploy.sh) script, syncing the contents of the `public/` folder to S3: +### S3 Deployment + +The deploy command simply calls the [`scripts/deploy-s3.sh`](scripts/deploy-s3.sh) script, syncing the contents of the `public/` folder to S3: ```bash -npm run deploy +npm run deploy:s3 ``` -The deploymeng script can be used locally too, the branch checks are only happening for Travis builds, allowing to deploy any branch from local machine. - ## 🏛 Licenses The MIT License (MIT) diff --git a/package.json b/package.json index dd0455a4..740abc59 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git,coverage}/**/*'", "format": "prettier --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx,md,json,css,scss}'", "tsc": "tsc --noEmit", - "deploy": "./scripts/deploy.sh", + "deploy:s3": "./scripts/deploy.sh", "new": "babel-node ./scripts/new.js" }, "browserslist": [ diff --git a/scripts/deploy.sh b/scripts/deploy-s3.sh similarity index 54% rename from scripts/deploy.sh rename to scripts/deploy-s3.sh index 8a0eb2eb..c755c793 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy-s3.sh @@ -5,7 +5,6 @@ # AWS_SECRET_ACCESS_KEY # AWS_DEFAULT_REGION AWS_S3_BUCKET="kremalicious.com" -AWS_S3_BUCKET_BETA="beta.kremalicious.com" SITEMAP_URL="https%3A%2F%2Fkremalicious.com%2Fsitemap.xml" # @@ -47,36 +46,10 @@ function s3sync { --acl public-read } -## -## check for pull request against main -## -if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "main" ]; then +s3sync $AWS_S3_BUCKET - s3sync $AWS_S3_BUCKET_BETA - -## -## check for main push which is no pull request -## -elif [ "$TRAVIS_BRANCH" == "main" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$TRAVIS" != true ]; then - - s3sync $AWS_S3_BUCKET - - # ping search engines - # returns: HTTP_STATUSCODE URL - curl -sL -w "%{http_code} %{url_effective}\\n" \ - "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \ - "http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null - - echo "---------------------------------------------" - echo " ✓ done deployment " - echo "---------------------------------------------" - - exit; - -else - - echo "---------------------------------------------" - echo " nothing to deploy " - echo "---------------------------------------------" - -fi +# ping search engines +# returns: HTTP_STATUSCODE URL +curl -sL -w "%{http_code} %{url_effective}\\n" \ + "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \ + "http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null \ No newline at end of file