Prerequisites:
- You need to have successfully done the previous section Set up your local environment
- You need to have the Codespace created
Objectives:
- Deploy manually a new deployment in a new environment
- (Just a demo) See how an Ephemeral Environment can be created via a Pull Request
Create a new test environment:
humctl create env test --type development --from developmentBecause we just created this new test environment, we don't have any deployment in there yet:
humctl get deploy . --env testUpdate the score.yaml file with the following changes:
...
containers:
...
variables:
...
+ REDIS_ADDR: "${resources.my-redis.host}:${resources.my-redis.port},user=${resources.my-redis.username},password=${resources.my-redis.password}"
resources:
+ my-redis:
+ type: redis
dns:
type: dns
...Let's deploy this new version of the Score file with an existing container image:
CONTAINER_IMAGE=$(humctl get deployment-set . -o yaml | yq '.entity.modules[].spec.containers[].image')
humctl score deploy -f score.yaml --env test --image ${CONTAINER_IMAGE} --waitOnce the deployment is done, let's check the diff between the two environments:
humctl diff sets env/test env/developmentAlso, let's open the new resource graph on this test environment and see that the Redis database is now provisioned:
humctl resources graph deploy . --env testImportant note: this section is just a demo, please see what your presenter is doing to illustrate this. You are not able to perform this specific section because you are not Owner in the GitHub Organization used during this workshop.
Create a new-feature branch:
git checkout -b new-featureCommit your local changes in this new-feature branch:
git add score.yaml
git commit -m "Add Redis database"
git push -u origin new-featureCreate a dedicated Pull Request in GitHub:
gh pr create --title "Add Redis database" --body "Add Redis database"Check the status of this Pull Request:
gh pr status
gh run listOpen this Pull Request in GitHub:
gh pr view --webFrom there, let's highlight what happened, and what the associated GitHub Actions pipeline did.
<< Previous: Set up your local environment | Next: Review of the Platform setup >>

