Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve azure deploy process (version-control & consolidate config) #2834

Closed
7 of 12 tasks
patcon opened this issue May 20, 2022 · 6 comments · Fixed by #3570
Closed
7 of 12 tasks

Improve azure deploy process (version-control & consolidate config) #2834

patcon opened this issue May 20, 2022 · 6 comments · Fixed by #3570
Assignees
Labels
debt Refactor or improve existing code. deployment Requires a change during deployment infrastructure Related to Azure server infrastructure.

Comments

@patcon
Copy link
Contributor

patcon commented May 20, 2022

Re-ticketed from #2683

Goals:

  • consolidate config files with development in content and location (.htaccess)
  • consolidate config files between environments (htaccess)
  • as much as possible, have deploy processes for all environments in version control (azure-pipelines.yml, htaccess, deploy.sh)
  • if possible, use setup.sh scripts in deploy.sh

Potential To Dos

Open Questions

  1. Is there a separate azure-pipeline.yml for staging and production pipelines? If so, do we want the other in here?
  2. Where are environment variables for apache stored in the deploy? Are they in azure-pipeline.yml? If not, can they be?
@patcon
Copy link
Contributor Author

patcon commented May 21, 2022

  • fence off indigenous apprenticeship endpoints with FEATURE_IAP feature flag
Click to see diff...
diff --git a/frontend/.apache_env b/frontend/.apache_env
index 4c1a4ac55..d3f7d78e9 100644
--- a/frontend/.apache_env
+++ b/frontend/.apache_env
@@ -5,4 +5,6 @@ OAUTH_POST_LOGOUT_REDIRECT="http://localhost:8000/admin"
 # OAUTH_LOGOUT_URI="https://te-auth.id.tbs-sct.gc.ca/oxauth/restv1/end_session"
 
 # Feature flags
+FEATURE_PHPINFO=true
+FEATURE_IAP=true
 FEATURE_APPLICANTPROFILE=true
diff --git a/infrastructure/php-container/src/.htaccess b/infrastructure/php-container/src/.htaccess
index 332e9f294..9b4f18b2b 100644
--- a/infrastructure/php-container/src/.htaccess
+++ b/infrastructure/php-container/src/.htaccess
@@ -39,11 +39,12 @@ DirectorySlash off
     # Send localized talent requests also to talentsearch dist folder;
     RewriteRule ^(en|fr)/talent(/(.*))?$ frontend/talentsearch/dist/$3 [L]
 
-    # Indigenous Apprenticeship routes
-    RewriteRule ^indigenous-it-apprentice(/(.*))?$ frontend/indigenousapprenticeship/dist/$2 [L]
-    RewriteRule ^(en|fr)/indigenous-it-apprentice(/(.*))?$ frontend/indigenousapprenticeship/dist/$3 [L]
+    # Indigenous Apprenticeship routes (feature-flagged)
+    RewriteCond expr "'%{ENV:FEATURE_IAP}' == 'true'"
+    RewriteRule ^((en|fr)/)?indigenous-it-apprentice(/(.*))?$ frontend/indigenousapprenticeship/dist/$4 [L]
 
-    # PHP Info page for debugging
+    # PHP Info page for debugging (feature-flagged)
+    RewriteCond expr "'%{ENV:FEATURE_PHPINFO}' == 'true'"
     RewriteRule ^phpinfo.php$ phpinfo.php [L]
 
     # Send all other requests to /tc-report

@tristan-orourke tristan-orourke added debt Refactor or improve existing code. infrastructure Related to Azure server infrastructure. labels Jun 16, 2022
@tristan-orourke
Copy link
Member

This issue is being prioritized because we hit the character limit on the way we're currently generating the htaccess file in Azure. We should just be importing it from the repo instead!

@tristan-orourke
Copy link
Member

Estimating as a 5 due to general uncertainty around how this will work.

@tristan-orourke tristan-orourke self-assigned this Aug 2, 2022
@petertgiles
Copy link
Contributor

This issue is being prioritized because we hit the character limit on the way we're currently generating the htaccess file in Azure. We should just be importing it from the repo instead!

Solution in #3513

@petertgiles
Copy link
Contributor

Woof, this issue is too big! I think it should be broken up.

@tristan-orourke
Copy link
Member

Remaining todos split off into #3571

@tristan-orourke tristan-orourke added the deployment Requires a change during deployment label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Refactor or improve existing code. deployment Requires a change during deployment infrastructure Related to Azure server infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants