mirror of https://github.com/docker/docs.git
3.4 KiB
3.4 KiB
Mercury
Develop
- Download Node or install it via homebrew
brew install node - Install React dev tools and Redux dev tools
In order to test user actions you will need to provide JWT authentication.
Add your JWT to your environment variables keyed by DOCKERSTORE_TOKEN
If you have CSRF token, key it in your environment variables by DOCKERSTORE_CSRF
npm install
npm run start
Dockerize
- Download Docker for Mac or Windows
docker build -t docker/mercury-ui .
docker run -p 3000:3000 docker/mercury-ui
Deploy to staging & production
Setup
- Ensure access to Staging and Production VPNs
- Docker Infra adds your developer certificates to the store & hub aws teams.
- Install pip: instructions here
- Install hub-boss (globally for now):
git clone https://github.com/docker/saas-mega
cd saas-mega/tools/hub-boss
sudo pip install -r requirements.txt
sudo pip install -e .
-
Follow the Pass Runbook to install
pass,gpg-agentandpinentry. -
Set up Store TLS certificates to access the staging & production Docker Daemons (see docs)
mkdir -p ~/.docker/certs
cd ~/.docker/certs
# Get ca cert & key from pass
pass show dev/teams/store/docker/store-ca-cert.pem > ca.pem
pass show dev/teams/store/docker/store-ca-key.pem > ca-key.pem
# Generate a client private key
openssl genrsa -out key.pem 4096
# Generate client CSR
openssl req -subj '/CN=client' -new -key key.pem -out client.csr
# Sign the public key
echo extendedKeyUsage = clientAuth > extfile.cnf
openssl x509 -req -days 365 -sha256 -in client.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out cert.pem -extfile extfile.cnf
# Fix permissions
chmod -v 0400 key.pem
chmod -v 0444 ca.pem cert.pem
# cleanup
rm ca-key.pem
rm extfile.cnf
rm client.csr
rm ca.srl
Deploying to Staging
- Bump the app version:
git checkout master
git pull
npm version major # commits change with new major version in package.json, creates new git tag e.g. <v6.0.0>
git push origin master # push bump version commit
git push origin --tags # pushes newly created git tag
- Wait for the new version to build on DockerHub (e.g.
6.0.0) - Connect to the Staging VPN
- Deploy:
./tools/scripts/deploy_stage.sh <old version> <new version> # e.g: 5.0.0 6.0.0
Deploying to Production
- Connect to Production VPN
- Alert the team that you're doing a production deploy
- Deploy to production:
./tools/scripts/deploy_prod.sh <old version> <new version>
Rolling-Back
- Notify team you're doing a UI roll-back:
./tools/scripts/deploy_prod.sh <current version> <previous stable version>