An application to make managing releases to specific environments easier.
This is a Ruby on Rails app, and should follow our Rails app conventions.
You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.
To see the kubernetes API view you will need to run the Release app on your machine, not in the govuk-docker stack.
If you are just running the tests you can use govuk-docker.
- Before running the app you will need to update the
Trust relationshipfor therelease-assumedrole on the AWSIAMcontrol panel using yourfulladminaccount on theintegrationenvironment. The additional trusted entity that you are adding should look like this -
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::1234567890:role/your.name-developer"
},
"Action": "sts:AssumeRole"
}This step needs to be repeated for the staging environment as the app will show the status for both integration and staging environments.
Note that the production environment is not updated in order to reduce the risk of affecting the production environment if the allowable actions on the kubernetes API changes in the future.
- Finally on the
AWS consoleyou will also need to add the following IAM policy to your developer role inintegration. Under the AWSIAMcontrol panel using yourfulladminaccount, select your developer role and then add a new permission usingCreate inline policyand switch toJSONso that you can paste the following json block -
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": "arn:aws:iam::210287912431:role/release-assumed"
},
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": "arn:aws:iam::696911096973:role/release-assumed"
}
]
}Click on Next to name your new policy, it should probably be something like TestAssumeRole and finally you should be able to click on Create policy.
-
Once the extra trust entity and IAM policy has been added you should be able to run the Release app locally after assuming your developer account.
-
Then ensure that you have
mysql serverrunning on your machine.
brew install mysql # needed if you don't have mysql installed already
mysql.server start- Install the dependencies
npx yarn install # needed if you don't have yarn install alreadybundle install- Setup the database
DATABASE_URL="mysql2://root@localhost/release_development" bin/rails db:setup- Start the Rails server
rails assets:precompile # ensure that you have yarn installed
DATABASE_URL="mysql2://root@localhost/release_development" rails sUse GOV.UK Docker to run any commands that follow.
DATABASE_URL="mysql2://root@localhost/release_development" bundle exec rake- Run a single test
TEST_DATABASE_URL="mysql2://root@localhost/release_test" rake test TEST=test/integration/deploy_page_test.rb