diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..8b4dcf051 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: "0 5 * * *" + +concurrency: + group: "${{ github.ref }}-${{ github.workflow }}" + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1.3' + bundler-cache: true + - name: Install Just + run: sudo snap install --edge --classic just + - name: Install mdl + run: gem install mdl + - name: Lint + run: just lint + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1.3' + bundler-cache: true + - name: Install Just + run: sudo snap install --edge --classic just + - name: Build + run: just build diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml new file mode 100644 index 000000000..46f42f21f --- /dev/null +++ b/.github/workflows/deploy_prod.yml @@ -0,0 +1,44 @@ +name: Deploy-to-splinter.splinter.dev + +on: + workflow_dispatch: + +concurrency: + group: "${{ github.ref }}-${{ github.workflow }}" + cancel-in-progress: true + +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }} + AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }} + JEKYLL_ENV: 'production' + +jobs: + build: + runs-on: ubuntu-latest + environment: Production + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1.3' + bundler-cache: true + - name: Install Just + run: sudo snap install --edge --classic just + - name: Build + run: just build + - name: "Deploy to AWS S3" + shell: bash + run: | + export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \ + $(aws sts assume-role \ + --role-arn ${{ vars.AWS_ROLE_ARN }} \ + --role-session-name GithubActions \ + --query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \ + --output text)) + aws s3 sync ./_site/ s3://${{ vars.AWS_S3_BUCKET_NAME }} \ + --delete --cache-control max-age=604800 + aws cloudfront create-invalidation \ + --distribution-id ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID }} \ + --paths "/*" diff --git a/.github/workflows/lint-website.yaml b/.github/workflows/lint-website.yaml deleted file mode 100644 index 64ea38fff..000000000 --- a/.github/workflows/lint-website.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint Website - -on: - pull_request: - -env: - CARGO_TERM_COLOR: always - -concurrency: - group: "${{ github.ref }}-${{ github.workflow }}" - cancel-in-progress: true - -jobs: - lint_website: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Display envvars - run: env - - - name: Install Just - run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - - name: Run Lint on Markdown - run: just lint diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml deleted file mode 100644 index afcdee768..000000000 --- a/.github/workflows/merge.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: Merge - -on: - push: - branches: [ main ] - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - -concurrency: - group: "${{ github.ref }}-${{ github.workflow }}" - cancel-in-progress: true - -jobs: - - lint_website: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Display envvars - run: env - - - name: Install Just - run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - - name: Lint Website - run: just lint - - test_docker_build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Display envvars - run: env - - - name: Install Just - run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - - name: Test building website - run: just docker-build - - publish_docker: - needs: [lint_website, test_docker_build] - if: >- - (github.ref == 'refs/heads/main' && github.repository_owner == 'hyperledger') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Display envvars - run: env - - - name: Install Just - run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Build and publish site to dockerhub - run: ./ci/publish-docker - env: - GOOGLE_PSE: ${{ secrets.GOOGLE_PSE }} diff --git a/.github/workflows/test-docker-build.yaml b/.github/workflows/test-docker-build.yaml deleted file mode 100644 index c14bcae7f..000000000 --- a/.github/workflows/test-docker-build.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build Website - -on: - pull_request: - -env: - CARGO_TERM_COLOR: always - -concurrency: - group: "${{ github.ref }}-${{ github.workflow }}" - cancel-in-progress: true - -jobs: - test_docker_build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Display envvars - run: env - - - name: Install Just - run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - - name: Test building website - run: just docker-build diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..a1a3a1196 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.3.1" + +group :jekyll_plugins do + gem "jekyll-default-layout" + gem "jekyll-optional-front-matter" + gem "jekyll-readme-index" + gem "jekyll-redirect-from" + gem "jekyll-seo-tag" + gem "jekyll-target-blank" + gem "jekyll-titles-from-headings" +end diff --git a/README.md b/README.md index 61c481a25..ad8da0c42 100644 --- a/README.md +++ b/README.md @@ -1,85 +1,18 @@ -# sawtooth-website +# Hyperledger Sawtooth -## Preview and Review +This project has moved (see below). -You'll need to install -[Docker and Compose](https://docs.docker.com/compose/install/) +Hyperledger Sawtooth was a project to provide an enterprise solution for +building, deploying, and running distributed ledgers (also called blockchains). -From a local clone of -[the repository](https://github.com/hyperledger/sawtooth-website), run +# Project Status -``` -docker-compose up -``` +This Hyperledger project, Hyperledger Sawtooth, has been archived and is no +longer active within Hyperledger. -Pay attention to the output for markdown syntax errors. Errors will appear on -lines beginning with `linter_1`. - -The site will be available at [`http://localhost:8000`](http://localhost:8000) - -To stop the site, type `[Ctrl]+C` then run - -``` -docker-compose down -v -``` - -## Adding a Post - -To create a post, add a [markdown](https://kramdown.gettalong.org/quickref.html) -or [reStructuredText](http://docutils.sourceforge.net/rst.html) file -to the `generator/source/_posts` directory with the following format: - -``` -YEAR-MONTH-DAY-title.MARKUP -``` - -Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit -numbers, and `MARKUP` is the file extension representing the format used in the -file. For example, the following are examples of valid post filenames: - -``` -2019-04-23-hyperledger-is-awesome.md -2019-09-12-how-to-write-a-how-to.rst -``` - -All post files must begin with front matter which is typically used to set a -layout or other meta data. - -``` ---- -layout: post -title: Hyperledger Sawtooth, Seth and Truffle 101 -categories: [certification, hyperledger] -tags: [cert, calendar] ---- - -Excerpt from [hyperledger.org](https://www.hyperledger.org/blog/2018/07/24 -/hyperledger-sawtooth-seth-and-truffle-101) - -I develop on both Hyperledger Fabric/Sawtooth and Ethereum (to be specified, -Quorum) so I am familiar with the languages available on both platform — -chaincode (Go) and smart contract (Solidity). Often I am asked this question: -“Which platform is better?” To which I will answer, this question is a false -choice as with Hyperledger Sawtooth Seth, you can build your smart contracts in -Solidity and deploy the same smart contract in Hyperledger Sawtooth — Pretty -cool isn’t it? ... -``` - -## Editing Site Content - -Change the content of `/`, `/contact/`, `/about/`, -etc., by editing the files in `/generator/source/`. - -E.g., `/generator/source/index.md`, `/generator/source/contact.md` and -`/generator/source/about.md` - -## LICENSE - -* This documentation and the content herein is covered by [ - Creative Commons Attribution 4.0 International License]( - http://creativecommons.org/licenses/by/4.0/ "license") unless otherwise stated. -* Jekyll (docker-compose.yaml) is used under LICENSE-MIT -* The Jekyll Type theme is used under generator/source/LICENSE (MIT) -* Markdown lint tool (docker-compose.yaml) is used under LICENSE-MIT +Sawtooth is now maintained by the Splinter community. For more information, +visit: https://github.com/splintercommunity/sawtooth-core/ +# License +Hyperledger Sawtooth software is licensed under the [Apache License Version 2.0](LICENSE) software license. diff --git a/justfile b/justfile index 8ceffbd6f..3b4d4a367 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -# Copyright 2018-2020 Cargill Incorporated +# Copyright 2023 Bitwise IO, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,25 +12,71 @@ # See the License for the specific language governing permissions and # limitations under the License. -build: docker-build +build: + #!/usr/bin/env sh + set -e -docker-build: - docker build \ - -t hyperledger/sawtooth-website:main \ - -f ci/website.dockerfile \ - . + if [ $(uname -s) = "Darwin" ]; then + export RUBY_VERSION=3.1.3 + source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh + chruby ruby-$RUBY_VERSION + fi -docker-lint: - docker-compose \ - -f docker/compose/run-lint.yaml \ - up \ - --abort-on-container-exit \ - --build \ - lint-sawtooth-docs + bundle install + bundle exec jekyll build -docker-run: - docker-compose up --build; docker-compose down +clean: + rm -rf \ + .jekyll-metadata/ \ + _site/ \ + Gemfile.lock -lint: docker-lint +install-jekyll-via-brew: + #!/usr/bin/env sh + set -e -run: docker-run + brew install chruby ruby-install xz + + export RUBY_VERSION=3.1.3 + ruby-install ruby $RUBY_VERSION --no-reinstall --cleanup + source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh + chruby ruby-$RUBY_VERSION + + gem install jekyll bundler mdl + +install-mdl: + #!/usr/bin/env sh + set -e + + if [ $(uname -s) = "Darwin" ]; then + export RUBY_VERSION=3.1.3 + source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh + chruby ruby-$RUBY_VERSION + fi + + gem install mdl + +run: + #!/usr/bin/env sh + set -e + + if [ $(uname -s) = "Darwin" ]; then + export RUBY_VERSION=3.1.3 + source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh + chruby ruby-$RUBY_VERSION + fi + + bundle install + bundle exec jekyll serve --incremental + +lint: + #!/usr/bin/env sh + set -e + + if [ $(uname -s) = "Darwin" ]; then + export RUBY_VERSION=3.1.3 + source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh + chruby ruby-$RUBY_VERSION + fi + + mdl -g -i -r ~MD001,~MD002,~MD003,~MD004,~MD005,~MD006,~MD007,~MD009,~MD012,~MD013,~MD014,~MD019,~MD022,~MD024,~MD023,~MD025,~MD026,~MD027,~MD028,~MD029,~MD030,~MD031,~MD032,~MD033,~MD034,~MD035,~MD036,~MD046,~MD047,~MD055,~MD056,~MD057 .