-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from rajpalc7/main
Consolidate sandbox redeploy actions into one
- Loading branch information
Showing
3 changed files
with
81 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Uninstall and then re-install Traction Sandbox Instance | ||
|
||
on: | ||
schedule: | ||
- cron: '0 9 1,15 * *' | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
uninstall_sandbox: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Your Job | ||
run: | | ||
echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST" | ||
- name: Authenticate and set context | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} | ||
|
||
- name: Uninstall Traction via Helm | ||
continue-on-error: false | ||
run: | | ||
helm uninstall traction-sandbox -n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=20m | ||
- name: Remove Traction Openshift Objects | ||
continue-on-error: false | ||
run: | | ||
oc delete -n ${{ secrets.OPENSHIFT_NAMESPACE }} all,secret,pod,networkpolicy,configmap,pvc --selector "app.kubernetes.io/instance"=traction-sandbox | ||
install_sandbox: | ||
name: Install Sandbox | ||
needs: uninstall_sandbox | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Your Job | ||
run: | | ||
echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST" | ||
- name: Authenticate and set context | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} | ||
|
||
- name: Install Traction via Helm | ||
continue-on-error: false | ||
run: | | ||
helm repo add traction https://bcgov.github.io/traction | ||
helm upgrade --install traction-sandbox traction/traction \ | ||
-f ./helm-values/traction/values-sandbox.yaml \ | ||
-n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=7m |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters