Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hackathon subscription activation and registry service account implementation #26

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${env:GITHUB_OUTPUT}
run: echo "dir=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"

- uses: actions/cache@v3
id: yarn-cache
Expand Down
101 changes: 7 additions & 94 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,97 +20,10 @@ name: pr-check
on: [pull_request]

jobs:
windows:
name: Windows
runs-on: windows-2022
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${env:GITHUB_OUTPUT}

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000

- name: Run Build
timeout-minutes: 20
run: yarn build

darwin:
name: macOS
runs-on: macos-11
timeout-minutes: 40
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: yarn --frozen-lockfile --network-timeout 180000

- name: Run Build
timeout-minutes: 20
run: yarn build

linux:
name: Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Execute yarn
run: yarn --frozen-lockfile

- name: Run Build
timeout-minutes: 20
run: yarn build

pr-check-job:
strategy:
matrix:
target: [windows-2022, macos-11, ubuntu-20.04]
uses: redhat-developer/podman-desktop-redhat-account-ext/.github/workflows/build.yaml@main
with:
runs-on: ${{ matrix.target }}
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:17.7-alpine3.14 AS extension-builder
dgolovin marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /
# cache packages in layer
COPY . .

RUN ls -la

RUN yarn config set cache-folder /usr/local/share/.cache/yarn
RUN yarn config set network-timeout 120000
# install
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn global add rollup
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn install
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn run build

FROM scratch as podman-extension
LABEL org.opencontainers.image.title="Red Hat SSO Authentication Provider Extension for Podman Desktop" \
org.opencontainers.image.description="Official Red Hat SSO Integration for Podman Desktop" \
org.opencontainers.image.vendor="Red Hat Inc." \
io.podman-desktop.api.version=">= 0.2.0"

COPY --from=extension-builder /dist /dist
COPY --from=extension-builder /package.json /package.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"contributes": {
"commands": [
{
"command": "redhat.auth.login",
"title": "Red Hat Authentication: login"
"command": "redhat.authentication.signin",
"title": "Red Hat SSO Provider: Sign In"
}
]
},
Expand All @@ -25,7 +25,10 @@
},
"dependencies": {
"@podman-desktop/api": "^1.6.4",
"@redhat-developer/rhcra-client": "^0.0.1",
"@redhat-developer/rhsm-client": "^0.0.4",
"@types/node": "^18.15.11",
"axios": "^1.6.5",
"js-yaml": "^4.1.0",
"openid-client": "5.4.0"
},
Expand All @@ -38,11 +41,12 @@
"@types/js-yaml": "^4.0.5",
"@vitest/coverage-v8": "^1.2.1",
"mkdirp": "^2.1.3",
"openapi-typescript-codegen": "^0.27.0",
dgolovin marked this conversation as resolved.
Show resolved Hide resolved
"rollup": "^3.20.4",
"tslib": "^2.5.0",
"typescript": "^5.0.4",
"vite": "^5.0.11",
"vitest": "^1.1.1",
"vite": "^5.0.12",
"vitest": "^1.2.0",
"zip-local": "^0.3.5"
}
}
2 changes: 1 addition & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const REDHAT_AUTH_URL = process.env.REDHAT_SSO_URL
? process.env.REDHAT_SSO_URL
: 'https://sso.redhat.com/auth/realms/redhat-external/';
const KAS_API_URL = process.env.KAS_API_URL ? process.env.KAS_API_URL : 'https://api.openshift.com';
const CLIENT_ID = process.env.CLIENT_ID ? process.env.CLIENT_ID : 'vscode-redhat-account';
const CLIENT_ID = process.env.CLIENT_ID ? process.env.CLIENT_ID : 'podman-desktop';

console.log('REDHAT_AUTH_URL: ' + REDHAT_AUTH_URL);
console.log('KAS_API_URL: ' + KAS_API_URL);
Expand Down
Loading
Loading