Skip to content

Commit

Permalink
Test dummy deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
danielxnj committed Nov 17, 2023
1 parent 12e6a81 commit c356868
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-images-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

deploy_preview:
name: Deploy preview environment
uses: ./.github/workflows/pr-deploy.yml
uses: ./.github/workflows/pr-deploy.yml@chore-make-hobby-docker-install
needs: [posthog_build]
secrets: inherit
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ jobs:
envsubst < posthog/.github/pr-deploy/tailscale.yaml.tmpl > posthog/.github/pr-deploy/tailscale.yaml
envsubst < posthog/.github/pr-deploy/values.yaml.tmpl > posthog/.github/pr-deploy/values.yaml
helm upgrade --install \
-f posthog/.github/pr-deploy/values.yaml \
--set image.tag=pr-$PR_NUM \
--timeout 30m \
--create-namespace \
--namespace $NAMESPACE \
$RELEASE_NAME charts-clickhouse/charts/posthog \
--wait \
--wait-for-jobs
POD_NAME=$(kubectl -n $NAMESPACE get pod | grep web | cut -d' ' -f1)
kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py shell -c "import sys;from posthog.models import Team; sys.exit(not Team.objects.exists())" \
|| kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py generate_demo_data \
&& kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py shell -c "from posthog.models import Team; t = Team.objects.first(); t.is_demo = False; t.save()"
kubectl -n $NAMESPACE apply -f posthog/.github/pr-deploy/tailscale.yaml
echo "url=$NAMESPACE.hedgehog-kitefin.ts.net" >> $GITHUB_OUTPUT
# helm upgrade --install \
# -f posthog/.github/pr-deploy/values.yaml \
# --set image.tag=pr-$PR_NUM \
# --timeout 30m \
# --create-namespace \
# --namespace $NAMESPACE \
# $RELEASE_NAME charts-clickhouse/charts/posthog \
# --wait \
# --wait-for-jobs
# POD_NAME=$(kubectl -n $NAMESPACE get pod | grep web | cut -d' ' -f1)
# kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py shell -c "import sys;from posthog.models import Team; sys.exit(not Team.objects.exists())" \
# || kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py generate_demo_data \
# && kubectl -n $NAMESPACE exec $POD_NAME -- python manage.py shell -c "from posthog.models import Team; t = Team.objects.first(); t.is_demo = False; t.save()"
# kubectl -n $NAMESPACE apply -f posthog/.github/pr-deploy/tailscale.yaml
- name: update deployment status
uses: bobheadxi/deployments@v1
Expand Down
4 changes: 2 additions & 2 deletions bin/deploy-hobby
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ envsubst > Caddyfile <<EOF
{
$TLS_BLOCK
}
$DOMAIN, :80, :443 {
$DOMAIN, http://, https:// {
reverse_proxy http://web:8000
}
EOF
Expand Down Expand Up @@ -194,7 +194,7 @@ sudo usermod -aG docker "${USER}" || true
echo "Configuring Docker Compose...."
rm -f docker-compose.yml
cp posthog/docker-compose.base.yml docker-compose.base.yml
cp posthog/docker-compose.hobby.yml docker-compose.yml.tmpl
cp docker-compose.yml.tmpl
envsubst < docker-compose.yml.tmpl > docker-compose.yml
rm docker-compose.yml.tmpl
echo "Starting the stack!"
Expand Down

0 comments on commit c356868

Please sign in to comment.