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

add docker support for oauth2 #1791

Merged
merged 2 commits into from
Jun 6, 2024
Merged
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 .blueprint/github-build-matrix/build-matrix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const defaultMatrix = {
};

const oauth2Sample = {
os: 'macos-14',
os: 'macos-13',
'default-environment': 'prod',
};

Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- id: build
run: |
npm ci --ignore-scripts --omit=dev
Expand Down Expand Up @@ -72,13 +73,6 @@ jobs:
with:
path: generator-jhipster-react-native
fetch-depth: 2
- uses: nick-invision/[email protected]
name: 'TOOLS: installing applesimutils'
with:
max_attempts: 3
timeout_minutes: 60
command: brew tap wix/brew && brew install applesimutils && applesimutils --list
retry_wait_seconds: 15
- run: npm install
working-directory: ${{ github.workspace }}/generator-jhipster-react-native
- run: cli.cjs generate-sample ${{ matrix.sample-name }} --force --skip-commit-hook
Expand All @@ -105,6 +99,28 @@ jobs:
compare-folder: client
generator-path: generator-jhipster-react-native
cmd: cli.cjs generate-sample ${{ matrix.sample-name }} --force --skip-git --skip-commit-hook

- name: 'SETUP MacOS: install docker'
run: |
brew install docker colima docker-compose
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
mkdir -p ~/.docker/cli-plugins
ln -sfn $HOMEBREW_PREFIX/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
if: matrix.default-environment == 'prod' && steps.compare.outputs.equals != 'true'
timeout-minutes: 10
- uses: nick-invision/[email protected]
name: 'TOOLS: installing applesimutils'
if: steps.compare.outputs.equals != 'true'
with:
max_attempts: 3
timeout_minutes: 60
command: brew tap wix/brew && brew install applesimutils && applesimutils --list
retry_wait_seconds: 15
- run: npm run services:up
if: steps.compare.outputs.equals != 'true'
working-directory: ${{ github.workspace }}/backend

- run: npm install
if: steps.compare.outputs.equals != 'true'
- run: npx expo prebuild -p ios
Expand All @@ -115,7 +131,7 @@ jobs:
npm run app:start &
npm install -g wait-on
wait-on -t 60000 http-get://127.0.0.1:8080/management/health
if: matrix.default-environment != 'prod' && steps.compare.outputs.equals != 'true'
if: steps.compare.outputs.equals != 'true'
working-directory: ${{ github.workspace }}/backend
- run: npm run e2e:test:ios
if: steps.compare.outputs.equals != 'true'
Expand Down
11 changes: 11 additions & 0 deletions generators/app/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,15 @@ export default class extends BaseApplicationGenerator {
},
});
}

get [BaseApplicationGenerator.POST_WRITING]() {
return this.asPostWritingTaskGroup({
keycloak({ application }) {
if (!application.authenticationTypeOauth2) return;

// Increase wait for macOS. Keyclock container start can take over 3 min. 4 min is not enough to download/start containers/start server.
this.editFile('src/main/docker/keycloak.yml', { assertModified: true }, content => content.replace('retries: 20', 'retries: 40'));
},
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useDidUpdateEffect } from '../../shared/util/use-did-update-effect';
import styles from './login-screen.styles';

function LoginScreen(props) {
const { navigation, account, fetching, error, attemptLogin, fetchingAccount, fetchingAuthInfo, authInfoError } = props;
const { account, navigation, fetching, error, attemptLogin, fetchingAccount, fetchingAuthInfo, authInfoError } = props;
// setup error state for displaying error messages
const [loginError, setLoginError] = React.useState('');

Expand Down
Loading