Skip to content

Commit 071e2d5

Browse files
authored
Merge pull request #2 from brooklyn-data/feat/external-browser-auth
Add External Browser Auth
2 parents ce3e81c + 2944576 commit 071e2d5

4 files changed

Lines changed: 83 additions & 26 deletions

File tree

.github/workflows/publish-template.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,47 @@ name: Publish Template
33
on:
44
push:
55
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
68
workflow_dispatch:
79

810
jobs:
11+
publish-staging:
12+
if: github.event_name == 'pull_request'
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build and push staging template
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
file: ./src/dbt-fusion/.devcontainer/Dockerfile
39+
platforms: linux/amd64,linux/arm64
40+
push: true
41+
tags: |
42+
ghcr.io/${{ github.repository }}/dbt-fusion:pr-${{ github.event.pull_request.number }}
43+
ghcr.io/${{ github.repository }}/dbt-fusion:staging
44+
945
publish:
46+
if: github.event_name == 'push'
1047
runs-on: ubuntu-latest
1148
permissions:
1249
contents: read
@@ -35,4 +72,41 @@ jobs:
3572
file: ./src/dbt-fusion/.devcontainer/Dockerfile
3673
platforms: linux/amd64,linux/arm64
3774
push: true
38-
tags: ghcr.io/${{ github.repository }}/dbt-fusion:latest
75+
tags: ghcr.io/${{ github.repository }}/dbt-fusion:latest
76+
77+
cleanup-pr-images:
78+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
79+
needs: publish
80+
runs-on: ubuntu-latest
81+
permissions:
82+
packages: write
83+
84+
steps:
85+
- name: Log in to GitHub Container Registry
86+
uses: docker/login-action@v3
87+
with:
88+
registry: ghcr.io
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GITHUB_TOKEN }}
91+
92+
- name: Delete PR-specific image
93+
run: |
94+
# Delete PR-specific tag
95+
docker run --rm \
96+
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
97+
-e PACKAGE_NAME=dbt-fusion \
98+
-e PACKAGE_TYPE=container \
99+
-e PACKAGE_OWNER=${{ github.repository_owner }} \
100+
-e PACKAGE_VERSION=pr-${{ github.event.pull_request.number }} \
101+
ghcr.io/actions/github-script@v6
102+
103+
# Delete staging tag
104+
docker run --rm \
105+
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
106+
-e PACKAGE_NAME=dbt-fusion \
107+
-e PACKAGE_TYPE=container \
108+
-e PACKAGE_OWNER=${{ github.repository_owner }} \
109+
-e PACKAGE_VERSION=staging \
110+
ghcr.io/actions/github-script@v6
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/dbt-fusion/.devcontainer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Use the official Python image as the base image
22
FROM python:3.12-slim
33

4-
# Install system dependencies (i.e. git, curl)
4+
# Install system dependencies (i.e. git, curl, xdg-utils)
55
RUN apt-get update && apt-get install -y \
66
git \
77
curl \
8+
xdg-utils \
89
&& rm -rf /var/lib/apt/lists/*
910

1011
# Install uv using pip
Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
{
22
"name": "dbt Fusion",
33
"version": "1.0.3",
4-
"description": "A development container for dbt projects that use the new fusion engine with the official dbt VS Code extension. ",
4+
"description": "A development container for dbt projects that use the new fusion engine with the official dbt VS Code extension.",
55
"documentationURL": "https://github.com/jairus-m/dbt-fusion-devcontainer",
6-
"licenseURL": "https://github.com/jairus-m/dbt-fusion-devcontainer/blob/main/LICENSE",
7-
"options": {
8-
"imageVariant": {
9-
"type": "string",
10-
"description": "Debian OS version (use bullseye on local arm64/Apple Silicon, bookworm elsewhere)",
11-
"proposals": [
12-
"bullseye",
13-
"bookworm"
14-
],
15-
"default": "bullseye"
16-
},
17-
"pythonVersion": {
18-
"type": "string",
19-
"description": "Python version to use",
20-
"proposals": [
21-
"3.12",
22-
"3.11",
23-
"3.10"
24-
],
25-
"default": "3.12"
26-
}
27-
}
28-
}
6+
"licenseURL": "https://github.com/jairus-m/dbt-fusion-devcontainer/blob/main/LICENSE"
7+
}

test/dbt-fusion/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ docker run --rm dbt-fusion-test uv --version
1313
# Test git installation
1414
docker run --rm dbt-fusion-test git --version
1515

16+
# Test xdg-utils installation
17+
docker run --rm dbt-fusion-test xdg-open --version
18+
1619
echo "All tests passed!"

0 commit comments

Comments
 (0)