Skip to content

Commit d187164

Browse files
committed
fix: db migrate environment name
style: add groups to logs
1 parent 5c8c71e commit d187164

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/k8s_db_migrate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
runs-on: [self-hosted, "${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}"]
2727
environment: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}
2828
env:
29+
ENVIRONMENT_NAME: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}
2930
KUBELOGIN_VERSION: "v0.0.25"
3031
KUBERNETES_CLUSTER_REPO_NAME: "${{ vars.KUBERNETES_CLUSTER_REPO_NAME }}"
3132
KUBERNETES_CLUSTER_NAME: "${{ vars.KUBERNETES_CLUSTER_NAME }}"
@@ -69,7 +70,7 @@ jobs:
6970
shell: bash
7071
run: |
7172
bash cicd-deployment-scripts/k8s/db_migrate.sh \
72-
-e ${{ github.ref_name }} \
73+
-e ${{ env.ENVIRONMENT_NAME }} \
7374
-d ${{ github.event.repository.name }} \
7475
-p ${{ github.workspace }}/${{ env.KUBERNETES_CLUSTER_REPO_NAME }} \
7576
-n ${{ env.KUBERNETES_NAMESPACE }} \

k8s/db_migrate.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ do
2222
esac
2323
done
2424

25+
26+
echo "::group::Kubernetes Context"
2527
kubectl config set-context --current --namespace=$KUBERNETES_NAMESPACE
2628
echo "Context set to namespace: \"$KUBERNETES_NAMESPACE\""
29+
echo "::endgroup::"
2730

2831
echo "::group::Migrating to revision: $alembic_upgrade_rev"
2932

k8s/db_rollback.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ do
2222
esac
2323
done
2424

25+
echo "::group::Kubernetes Context"
2526
kubectl config set-context --current --namespace=$KUBERNETES_NAMESPACE
2627
echo "Context set to namespace: \"$KUBERNETES_NAMESPACE\""
28+
echo "::endgroup::"
2729

2830
echo "::group::Migrating to revision: $alembic_downgrade_rev"
2931

0 commit comments

Comments
 (0)