Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit 79ef997

Browse files
authored
Production A/B Testing (#17)
* - Implements a build hash string shown on the login page - Also fixes the borrel mode logout bug whoeps - Implemented AB testing * Implements AB testing in the workflows * Woops * Potential fix to get the .git dir * Fix was at the devvm * actions/checkout#335 * Maybe upgrade git works. * This works. * This works.
1 parent 03e5432 commit 79ef997

File tree

8 files changed

+222
-200
lines changed

8 files changed

+222
-200
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ VUE_APP_DEBUG_STORES=false
22
VUE_APP_DEVELOP=false
33
VUE_APP_API_BASE='https://sudosos.test.gewis.nl/api/v1/'
44
VUE_APP_IMAGE_BASE='https://sudosos.test.gewis.nl/static/'
5+
VUE_APP_A_B='A'

.github/workflows/docker.yml

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,27 @@ jobs:
1414
container:
1515
image: docker:dind
1616
steps:
17+
- name: upgrade git
18+
run: |
19+
apk add --update
20+
apk add git
21+
git --version
22+
1723
- name: Checkout repository
1824
uses: actions/checkout@v3
1925
with:
2026
path: .
2127

2228
- name: Set up environment - main
2329
env:
24-
ENV_FILE: ${{ secrets.ENV_FILE_PRODUCTION }}
30+
ENV_FILE: ${{ env.ENV_FILE_PRODUCTION }}
2531
if: github.ref == 'refs/heads/main'
2632
run: |
2733
echo "${ENV_FILE}" > .env
2834
2935
- name: Set up environment - develop
3036
env:
31-
ENV_FILE: ${{ secrets.ENV_FILE_DEVELOPMENT }}
37+
ENV_FILE: ${{ env.ENV_FILE_DEVELOPMENT }}
3238
if: github.ref != 'refs/heads/main'
3339
run: |
3440
echo "${ENV_FILE}" > .env
@@ -72,3 +78,67 @@ jobs:
7278
labels: ${{ steps.meta.outputs.labels }}
7379
cache-from: type=gha
7480
cache-to: type=gha,mode=max
81+
82+
dockerize-ab-testing:
83+
runs-on: [ self-hosted, linux, docker ]
84+
container:
85+
image: docker:dind
86+
steps:
87+
- name: upgrade git
88+
run: |
89+
apk add --update
90+
apk add git
91+
git --version
92+
93+
- name: Checkout repository
94+
uses: actions/checkout@v3
95+
with:
96+
path: .
97+
98+
- name: Set up environment - A/B testing
99+
env:
100+
ENV_FILE: ${{ env.ENV_FILE_PRODUCTION }}
101+
if: github.ref != 'refs/heads/main'
102+
run: |
103+
echo "${ENV_FILE}" > .env
104+
echo "VUE_APP_A_B='B'" >> .env
105+
106+
- name: Get Docker meta (for tags)
107+
id: meta
108+
uses: docker/metadata-action@v4
109+
with:
110+
# list of Docker images to use as base name for tags
111+
images: |
112+
${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_TAG }}
113+
# generate Docker tags based on the following events/attributes
114+
tags: |
115+
type=schedule
116+
type=ref,event=branch
117+
type=ref,event=pr
118+
type=semver,pattern={{version}}
119+
120+
- name: Set up QEMU
121+
uses: docker/setup-qemu-action@v2
122+
123+
- name: Set up Docker Buildx
124+
uses: docker/setup-buildx-action@v2
125+
126+
- name: Login to SudoSOS Container Registry
127+
if: github.event_name != 'pull_request'
128+
uses: docker/login-action@v2
129+
with:
130+
registry: ${{ vars.DOCKER_REGISTRY }}
131+
username: ${{ secrets.SVC_GH_SUDOSOS_USERNAME }}
132+
password: ${{ secrets.SVC_GH_SUDOSOS_PWD }}
133+
134+
# Build and push Docker image with Buildx (don't push on PR)
135+
- name: Build and push
136+
uses: docker/build-push-action@v3
137+
with:
138+
context: .
139+
platforms: linux/amd64 #SudoSOS does not run on linux/arm64
140+
push: ${{ github.event_name != 'pull_request' }}
141+
tags: ab-develop
142+
labels: ${{ steps.meta.outputs.labels }}
143+
cache-from: type=gha
144+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)