Skip to content
eldesh edited this page Jul 13, 2022 · 10 revisions

Welcome to the gatekeeper wiki!

Release Sequence

  1. Read official document
  2. Put your API token to ~/.cargo/credentials
  3. Make a release branch
  4. Bump up version
    1. Update Cargo.toml > version
    2. cargo build (updating Cargo.lock)
  5. Check test passing
    $ cargo build
    $ cargo doc
    $ cargo test
    # expensive test
    $ docker-compose build
    $ docker-compose up -d
    $ cargo test -- --ignored
    
  6. Build and push latest docker image
    • on ARMv7 machine:
      $ cd /path/to/gatekeeper
      $ git checkout release/x.y.z && git pull origin release/x.y.z
      $ docker build -t idein/gatekeeper:latest-arm32v6 -f Dockerfile.arm32v6 .
      $ docker push idein/gatekeeper:latest-arm32v6
      $ docker build -t idein/gatekeeper:latest-arm32v7 -f Dockerfile.arm32v7 .
      $ docker push idein/gatekeeper:latest-arm32v7
      
  7. Check docker image working
    • on ARMv6 machine:
      $ docker pull idein/gatekeeper:latest-arm32v6 && docker run -itd --rm --network=host --userns=host --name=gatekeeper idein/gatekeeper:latest-arm32v6 && sleep 3 && curl -LI google.com --proxy socks5h://127.0.0.1:1080 && docker stop gatekeeper
      
    • on ARMv7 machine:
      $ docker pull idein/gatekeeper:latest-arm32v7 && docker run -itd --rm --network=host --userns=host --name=gatekeeper idein/gatekeeper:latest-arm32v7 && sleep 3 && curl -LI google.com --proxy socks5h://127.0.0.1:1080 && docker stop gatekeeper
      
  8. Check packaging passing
    $ cargo package
    
  9. Push the branch
    $ git push release/x.y.z
    
  10. Make a pull request
  11. Merge the pull request
  12. Sync to master
    $ git checkout master
    $ git pull origin/master
    
  13. Add a new tag like vX.Y.Z
    $ git tag vX.Y.Z
    $ git push origin vX.Y.Z
    
  14. Deploy docker images for arm32v6, arm32v7
    $ ssh <Raspberry PI>
    rpi:~$ cd /path/to/gatekeeper
    rpi:gatekeeper$ git checkout vX.Y.Z
    rpi:gatekeeper$ MAJOR=X
    rpi:gatekeeper$ MINOR=Y
    rpi:gatekeeper$ PATCH=Z
    rpi:gatekeeper$ echo ${MAJOR}.${MINOR}.${PATCH}
    rpi:gatekeeper$ TARGET=arm32v6
    rpi:gatekeeper$ docker build -t idein/gatekeeper:${MAJOR}-${TARGET} -t idein/gatekeeper:${MAJOR}.${MINOR}-${TARGET} -t idein/gatekeeper:${MAJOR}.${MINOR}.${PATCH}-${TARGET} -f Dockerfile.${TARGET} .
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}-${TARGET}
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}.${MINOR}-${TARGET}
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}.${MINOR}.${PATCH}-${TARGET}
    rpi:gatekeeper$ TARGET=arm32v7
    rpi:gatekeeper$ docker build -t idein/gatekeeper:${MAJOR}-${TARGET} -t idein/gatekeeper:${MAJOR}.${MINOR}-${TARGET} -t idein/gatekeeper:${MAJOR}.${MINOR}.${PATCH}-${TARGET} -f Dockerfile.${TARGET} .
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}-${TARGET}
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}.${MINOR}-${TARGET}
    rpi:gatekeeper$ docker push idein/gatekeeper:${MAJOR}.${MINOR}.${PATCH}-${TARGET}
    
  15. Update Readme of the docker image on hub.docker.com:idein/gatekeeper.
  16. Clone to the new working directory
    $ git clone file:///home/idein/gatekeeper newkeeper
    $ cd newkeeper
    $ git checkout vX.Y.Z
    
  17. Packaging (at new working dir)
    newkeeper$ cargo package
    
  18. Calm down
    newkeeper$ cargo publish --dry-run
    
    (This is subtly different from cargo package)
  19. Publish (at new working dir)
    newkeeper$ cargo publish
    
  20. Add owner (only for the 1st time)
    newkeeper$ cargo owner --add github:Idein:Engineers
    
  21. 🎉
Clone this wiki locally