Skip to content

Commit a366b8b

Browse files
committed
testing
1 parent 90bc701 commit a366b8b

File tree

1 file changed

+73
-74
lines changed

1 file changed

+73
-74
lines changed

Diff for: .github/workflows/update_all_user_environments.yaml

+73-74
Original file line numberDiff line numberDiff line change
@@ -60,80 +60,79 @@ jobs:
6060
git fetch
6161
git checkout ${{ matrix.branch }}
6262
git merge origin/main --no-edit
63-
git push origin ${{ matrix.branch }}
64-
65-
# - name: Get Namespace
66-
# id: get-namespace
67-
# run: |
68-
# NAMESPACE="${{ matrix.branch }}#demoenv-"
69-
# echo "NAMESPACE=${NAMESPACE}" >> $GITHUB_ENV
70-
71-
# - name: Set up Python
72-
# uses: actions/setup-python@v2
73-
# with:
74-
# python-version: "3.9"
75-
76-
# - name: Install dependencies
77-
# run: |
78-
# python -m pip install --upgrade pip
79-
# pip install -r ./.github/workflows/requirements.txt
80-
81-
# - name: Get LD Env Vars for Demo Environment
82-
# id: create_ld_project
83-
# env:
84-
# LD_API_KEY: ${{ secrets.LD_API_KEY }}
85-
# NAMESPACE: ${{ env.DEMO_NAMESPACE }}
86-
# run: |
87-
# echo "Creating LaunchDarkly project for namespace: ${{ env.DEMO_NAMESPACE }}"
88-
# python ./.github/workflows/create_ld_project.py
63+
64+
- name: Get Namespace
65+
id: get-namespace
66+
run: |
67+
NAMESPACE="${{ matrix.branch }}#demoenv-"
68+
echo "NAMESPACE=${NAMESPACE}" >> $GITHUB_ENV
69+
70+
- name: Set up Python
71+
uses: actions/setup-python@v2
72+
with:
73+
python-version: "3.9"
74+
75+
- name: Install dependencies
76+
run: |
77+
python -m pip install --upgrade pip
78+
pip install -r ./.github/workflows/requirements.txt
79+
80+
- name: Get LD Env Vars for Demo Environment
81+
id: create_ld_project
82+
env:
83+
LD_API_KEY: ${{ secrets.LD_API_KEY }}
84+
NAMESPACE: ${{ env.DEMO_NAMESPACE }}
85+
run: |
86+
echo "Creating LaunchDarkly project for namespace: ${{ env.DEMO_NAMESPACE }}"
87+
python ./.github/workflows/create_ld_project.py
8988
90-
# - name: Create .env file
91-
# run: |
92-
# touch ./.env.production
93-
# echo NEXT_PUBLIC_LD_CLIENT_KEY=${{ env.LD_CLIENT_KEY }} >> ./.env.production
94-
# echo LD_SDK_KEY=${{ env.LD_SDK_KEY }} >> ./.env.production
95-
# echo DB_URL=${{ secrets.DB_URL }} >> ./.env.production
96-
# echo LD_API_KEY=${{ secrets.LD_API_KEY }} >> ./.env.production
97-
# echo DESTINATIONENV=${{ env.DEMO_NAMESPACE }} >> ./.env.production
98-
# echo PROJECT_KEY=${{ env.DEMO_NAMESPACE }}-ld-demo >> ./.env.production
89+
- name: Create .env file
90+
run: |
91+
touch ./.env.production
92+
echo NEXT_PUBLIC_LD_CLIENT_KEY=${{ env.LD_CLIENT_KEY }} >> ./.env.production
93+
echo LD_SDK_KEY=${{ env.LD_SDK_KEY }} >> ./.env.production
94+
echo DB_URL=${{ secrets.DB_URL }} >> ./.env.production
95+
echo LD_API_KEY=${{ secrets.LD_API_KEY }} >> ./.env.production
96+
echo DESTINATIONENV=${{ env.DEMO_NAMESPACE }} >> ./.env.production
97+
echo PROJECT_KEY=${{ env.DEMO_NAMESPACE }}-ld-demo >> ./.env.production
9998
100-
# - name: Login to Amazon ECR
101-
# id: login-ecr
102-
# uses: aws-actions/amazon-ecr-login@v1
99+
- name: Login to Amazon ECR
100+
id: login-ecr
101+
uses: aws-actions/amazon-ecr-login@v1
103102

104-
# - name: Build, tag, and push image to Amazon ECR
105-
# env:
106-
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
107-
# ECR_REPOSITORY: ld-core-demo
108-
# run: |
109-
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }} .
110-
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }}
111-
112-
# - name: Update K8s Deploy File
113-
# run: python ./.github/workflows/update_k8s_deploy_file.py
114-
# env:
115-
# NAMESPACE: ${{ env.DEMO_NAMESPACE }}
116-
# URL: ${{ env.DEMO_NAMESPACE }}.launchdarklydemos.com
117-
# IMAGE: ${{ steps.login-ecr.outputs.registry }}/ld-core-demo:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }}
118-
119-
# - name: Check Namespace in Kubernetes
120-
# uses: kodermax/kubectl-aws-eks@master
121-
# with:
122-
# args: get namespace ${{ env.DEMO_NAMESPACE }} &>/dev/null && echo "namespace_exists=true" >> $GITHUB_ENV || echo "namespace_exists=false" >> $GITHUB_ENV
123-
124-
# - name: Create Namespace In Kubernetes
125-
# if: env.namespace_exists == 'false'
126-
# uses: kodermax/kubectl-aws-eks@master
127-
# with:
128-
# args: create namespace ${{ env.DEMO_NAMESPACE }}
129-
130-
# - name: Applying deploy file to Kubernetes
131-
# uses: kodermax/kubectl-aws-eks@master
132-
# with:
133-
# args: apply -f ./.github/workflows/deploy_files/deploy.yaml -n ${{ env.DEMO_NAMESPACE }}
134-
135-
# - name: Delete the deploy file
136-
# run: rm -rf ./.github/workflows/deploy_files
137-
138-
# - name: Remove .env file
139-
# run: rm ./.env.production
103+
- name: Build, tag, and push image to Amazon ECR
104+
env:
105+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
106+
ECR_REPOSITORY: ld-core-demo
107+
run: |
108+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }} .
109+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }}
110+
111+
- name: Update K8s Deploy File
112+
run: python ./.github/workflows/update_k8s_deploy_file.py
113+
env:
114+
NAMESPACE: ${{ env.DEMO_NAMESPACE }}
115+
URL: ${{ env.DEMO_NAMESPACE }}.launchdarklydemos.com
116+
IMAGE: ${{ steps.login-ecr.outputs.registry }}/ld-core-demo:${{ env.DEMO_NAMESPACE }}-${{ github.run_id }}
117+
118+
- name: Check Namespace in Kubernetes
119+
uses: kodermax/kubectl-aws-eks@master
120+
with:
121+
args: get namespace ${{ env.DEMO_NAMESPACE }} &>/dev/null && echo "namespace_exists=true" >> $GITHUB_ENV || echo "namespace_exists=false" >> $GITHUB_ENV
122+
123+
- name: Create Namespace In Kubernetes
124+
if: env.namespace_exists == 'false'
125+
uses: kodermax/kubectl-aws-eks@master
126+
with:
127+
args: create namespace ${{ env.DEMO_NAMESPACE }}
128+
129+
- name: Applying deploy file to Kubernetes
130+
uses: kodermax/kubectl-aws-eks@master
131+
with:
132+
args: apply -f ./.github/workflows/deploy_files/deploy.yaml -n ${{ env.DEMO_NAMESPACE }}
133+
134+
- name: Delete the deploy file
135+
run: rm -rf ./.github/workflows/deploy_files
136+
137+
- name: Remove .env file
138+
run: rm ./.env.production

0 commit comments

Comments
 (0)