├── .github ├── dependabot.yml ├── release.yml └── workflows │ ├── create-release.yml │ ├── publish-github-pages.yml │ └── sonar-branch.yml ├── .gitignore ├── .idea └── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── .mvn └── maven.config-template ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── THIRD_PARTY_LICENSES.txt ├── bug_release.sh ├── build-tools ├── pom.xml └── src │ └── main │ └── resources │ ├── fortify │ └── Filter_SecComply.txt │ └── weblogic-image-tool │ ├── checkstyle │ ├── checkstyle-noframes-sorted.xsl │ ├── customized_google_checks.xml │ └── suppressions.xml │ ├── pmd │ ├── weblogicx-ruleset.xml │ └── weblogicx-test-ruleset.xml │ └── spotbugs │ └── exclude-common.xml ├── documentation └── site │ ├── .vscode │ └── settings.json │ ├── archetypes │ └── default.md │ ├── config.toml │ ├── content │ ├── _index.md │ ├── argument-file.md │ ├── developer │ │ ├── _index.md │ │ ├── contribute.md │ │ └── source.md │ ├── quickstart │ │ ├── _index.md │ │ └── quickstart.md │ ├── release-notes.md │ ├── samples │ │ ├── _index.md │ │ ├── create-image-no-internet.md │ │ ├── create-image-wdt.md │ │ ├── create-image-with-internet.md │ │ └── patching-image.md │ └── userguide │ │ ├── _index.md │ │ ├── cleanup.md │ │ ├── config.md │ │ ├── logging.md │ │ ├── prerequisites.md │ │ ├── setup.md │ │ └── tools │ │ ├── _index.md │ │ ├── cache.md │ │ ├── create-aux-image.md │ │ ├── create-image.md │ │ ├── inspect-image.md │ │ ├── rebase-image.md │ │ └── update-image.md │ ├── layouts │ └── shortcodes │ │ ├── img.html │ │ ├── rawhtml.html │ │ └── readfile.html │ ├── runlocal.sh │ ├── runpublic.sh │ ├── static │ └── images │ │ └── logo.png │ └── themes │ └── hugo-theme-learn │ ├── .editorconfig │ ├── .gitignore │ ├── .grenrc.yml │ ├── CHANGELOG.md │ ├── LICENSE.md │ ├── README.md │ ├── archetypes │ ├── chapter.md │ └── default.md │ ├── i18n │ ├── ar.toml │ ├── de.toml │ ├── en.toml │ ├── es.toml │ ├── fr.toml │ ├── hi.toml │ ├── id.toml │ ├── ja.toml │ ├── nl.toml │ ├── pt.toml │ ├── ru.toml │ ├── tr.toml │ └── zh-cn.toml │ ├── images │ ├── screenshot.png │ └── tn.png │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── list.html │ │ └── single.html │ ├── index.html │ ├── index.json │ ├── partials │ │ ├── custom-comments.html │ │ ├── custom-footer.html │ │ ├── custom-header.html │ │ ├── favicon.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── logo.html │ │ ├── menu-footer.html │ │ ├── menu.html │ │ ├── meta.html │ │ ├── search.html │ │ ├── tags.html │ │ └── toc.html │ └── shortcodes │ │ ├── attachments.html │ │ ├── button.html │ │ ├── children.html │ │ ├── expand.html │ │ ├── mermaid.html │ │ ├── notice.html │ │ ├── ref.html │ │ ├── relref.html │ │ ├── siteparam.html │ │ ├── tab.html │ │ └── tabs.html │ ├── netlify.toml │ ├── static │ ├── css │ │ ├── atom-one-dark-reasonable.css │ │ ├── auto-complete.css │ │ ├── featherlight.min.css │ │ ├── fontawesome-all.min.css │ │ ├── hugo-theme.css │ │ ├── hybrid.css │ │ ├── nucleus.css │ │ ├── perfect-scrollbar.min.css │ │ ├── tabs.css │ │ ├── tags.css │ │ ├── theme-blue.css │ │ ├── theme-green.css │ │ ├── theme-red.css │ │ └── theme.css │ ├── fonts │ │ ├── Inconsolata.eot │ │ ├── Inconsolata.svg │ │ ├── Inconsolata.ttf │ │ ├── Inconsolata.woff │ │ ├── Novecentosanswide-Normal-webfont.eot │ │ ├── Novecentosanswide-Normal-webfont.svg │ │ ├── Novecentosanswide-Normal-webfont.ttf │ │ ├── Novecentosanswide-Normal-webfont.woff │ │ ├── Novecentosanswide-Normal-webfont.woff2 │ │ ├── Novecentosanswide-UltraLight-webfont.eot │ │ ├── Novecentosanswide-UltraLight-webfont.svg │ │ ├── Novecentosanswide-UltraLight-webfont.ttf │ │ ├── Novecentosanswide-UltraLight-webfont.woff │ │ ├── Novecentosanswide-UltraLight-webfont.woff2 │ │ ├── Work_Sans_200.eot │ │ ├── Work_Sans_200.svg │ │ ├── Work_Sans_200.ttf │ │ ├── Work_Sans_200.woff │ │ ├── Work_Sans_200.woff2 │ │ ├── Work_Sans_300.eot │ │ ├── Work_Sans_300.svg │ │ ├── Work_Sans_300.ttf │ │ ├── Work_Sans_300.woff │ │ ├── Work_Sans_300.woff2 │ │ ├── Work_Sans_500.eot │ │ ├── Work_Sans_500.svg │ │ ├── Work_Sans_500.ttf │ │ ├── Work_Sans_500.woff │ │ └── Work_Sans_500.woff2 │ ├── images │ │ ├── clippy.svg │ │ ├── favicon.png │ │ └── gopher-404.jpg │ ├── js │ │ ├── auto-complete.js │ │ ├── clipboard.min.js │ │ ├── featherlight.min.js │ │ ├── highlight.pack.js │ │ ├── hugo-learn.js │ │ ├── jquery-3.6.0.min.js │ │ ├── jquery.sticky.js │ │ ├── learn.js │ │ ├── lunr.min.js │ │ ├── modernizr.custom-3.6.0.js │ │ ├── perfect-scrollbar.jquery.min.js │ │ ├── perfect-scrollbar.min.js │ │ └── search.js │ ├── mermaid │ │ └── mermaid.js │ └── webfonts │ │ ├── fa-brands-400.eot │ │ ├── fa-brands-400.svg │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.eot │ │ ├── fa-regular-400.svg │ │ ├── fa-regular-400.ttf │ │ ├── fa-regular-400.woff │ │ ├── fa-regular-400.woff2 │ │ ├── fa-solid-900.eot │ │ ├── fa-solid-900.svg │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff │ │ └── fa-solid-900.woff2 │ ├── theme.toml │ └── wercker.yml ├── imagetool ├── pom.xml └── src │ ├── main │ ├── bin │ │ ├── imagetool.cmd │ │ ├── imagetool.sh │ │ ├── logging.properties │ │ └── setup.sh │ ├── java │ │ └── com │ │ │ └── oracle │ │ │ └── weblogic │ │ │ └── imagetool │ │ │ ├── api │ │ │ └── model │ │ │ │ ├── CachedFile.java │ │ │ │ └── CommandResponse.java │ │ │ ├── aru │ │ │ ├── AruException.java │ │ │ ├── AruHttpHelper.java │ │ │ ├── AruPatch.java │ │ │ ├── AruProduct.java │ │ │ ├── AruUtil.java │ │ │ ├── InstalledPatch.java │ │ │ ├── InvalidCredentialException.java │ │ │ ├── InvalidPatchNumberException.java │ │ │ ├── NoPatchesFoundException.java │ │ │ ├── PatchConflictException.java │ │ │ ├── PatchVersionException.java │ │ │ ├── RetryFailedException.java │ │ │ └── VersionNotFoundException.java │ │ │ ├── builder │ │ │ └── BuildCommand.java │ │ │ ├── cachestore │ │ │ ├── CacheStore.java │ │ │ ├── CacheStoreException.java │ │ │ ├── CacheStoreFactory.java │ │ │ ├── FileCacheStore.java │ │ │ ├── OPatchFile.java │ │ │ └── PatchFile.java │ │ │ ├── cli │ │ │ ├── HelpVersionProvider.java │ │ │ ├── ImageTool.java │ │ │ ├── cache │ │ │ │ ├── AddEntry.java │ │ │ │ ├── AddInstallerEntry.java │ │ │ │ ├── AddPatchEntry.java │ │ │ │ ├── CacheAddOperation.java │ │ │ │ ├── CacheCLI.java │ │ │ │ ├── CacheOperation.java │ │ │ │ ├── DeleteEntry.java │ │ │ │ └── ListCacheItems.java │ │ │ └── menu │ │ │ │ ├── CommonCreateOptions.java │ │ │ │ ├── CommonOptions.java │ │ │ │ ├── CommonPatchingOptions.java │ │ │ │ ├── CreateAuxImage.java │ │ │ │ ├── CreateImage.java │ │ │ │ ├── InspectImage.java │ │ │ │ ├── KubernetesTarget.java │ │ │ │ ├── OutputFormat.java │ │ │ │ ├── PackageManagerType.java │ │ │ │ ├── RebaseImage.java │ │ │ │ ├── UpdateImage.java │ │ │ │ ├── WdtBaseOptions.java │ │ │ │ └── WdtFullOptions.java │ │ │ ├── inspect │ │ │ ├── InspectOutput.java │ │ │ ├── InventoryPatch.java │ │ │ └── OperatingSystemProperties.java │ │ │ ├── installer │ │ │ ├── DefaultResponseFile.java │ │ │ ├── FmwInstallerType.java │ │ │ ├── InstallerType.java │ │ │ ├── MiddlewareInstall.java │ │ │ ├── MiddlewareInstallPackage.java │ │ │ ├── ProvidedResponseFile.java │ │ │ └── ResponseFile.java │ │ │ ├── logging │ │ │ ├── AnsiColor.java │ │ │ ├── ConsoleFormatter.java │ │ │ ├── FileFormatter.java │ │ │ ├── LoggingFacade.java │ │ │ └── LoggingFactory.java │ │ │ ├── util │ │ │ ├── AdditionalBuildCommands.java │ │ │ ├── Architecture.java │ │ │ ├── CloseableList.java │ │ │ ├── Constants.java │ │ │ ├── DockerfileOptions.java │ │ │ ├── DomainHomeSourceType.java │ │ │ ├── HttpUtil.java │ │ │ ├── InvalidPatchIdFormatException.java │ │ │ ├── NamedPattern.java │ │ │ ├── ResourceTemplateOptions.java │ │ │ ├── Utils.java │ │ │ └── XPathUtil.java │ │ │ └── wdt │ │ │ ├── DomainType.java │ │ │ └── WdtOperation.java │ └── resources │ │ ├── ImageTool.properties │ │ ├── ImageTool_de.properties │ │ ├── ImageTool_es.properties │ │ ├── ImageTool_fr.properties │ │ ├── ImageTool_it.properties │ │ ├── ImageTool_ja.properties │ │ ├── ImageTool_ko.properties │ │ ├── ImageTool_pt_BR.properties │ │ ├── ImageTool_zh_CN.properties │ │ ├── ImageTool_zh_TW.properties │ │ ├── VERSION.txt │ │ ├── docker-files │ │ ├── Create_Image.mustache │ │ ├── Rebase_Image.mustache │ │ ├── Update_Image.mustache │ │ ├── aux-image.mustache │ │ ├── create-user-group.mustache │ │ ├── final-wdt-copy.mustache │ │ ├── fmw-patching.mustache │ │ ├── install-java.mustache │ │ ├── install-middleware.mustache │ │ ├── package-managers.mustache │ │ └── run-wdt.mustache │ │ ├── probe-env │ │ ├── inspect-image-long.sh │ │ └── inspect-image.sh │ │ ├── response-files │ │ ├── default-response.mustache │ │ └── oraInst.loc │ │ ├── templates │ │ └── conflict-check.mustache │ │ └── version-info.properties │ └── test │ ├── java │ └── com │ │ └── oracle │ │ └── weblogic │ │ └── imagetool │ │ ├── ResourceUtils.java │ │ ├── aru │ │ ├── AruUtilTest.java │ │ ├── InstalledPatchTest.java │ │ └── MockAruUtil.java │ │ ├── builder │ │ └── BuilderTest.java │ │ ├── cachestore │ │ ├── CacheStoreTestImpl.java │ │ ├── CachedFileTest.java │ │ ├── FileCacheStoreTest.java │ │ ├── OPatchFileTest.java │ │ └── PatchFileTest.java │ │ ├── cli │ │ ├── ImageToolTest.java │ │ ├── cache │ │ │ ├── AddEntryTest.java │ │ │ ├── AddInstallerEntryTest.java │ │ │ └── AddPatchEntryTest.java │ │ └── menu │ │ │ ├── CommonOptionsTest.java │ │ │ ├── CommonPatchingOptions2Test.java │ │ │ ├── CommonPatchingOptionsTest.java │ │ │ └── UpdateImageTest.java │ │ ├── inspect │ │ └── InspectTest.java │ │ ├── installer │ │ ├── InstallerTest.java │ │ ├── MiddlewareInstallTest.java │ │ └── ResponseFileTest.java │ │ ├── logging │ │ └── FileFormatterTest.java │ │ ├── test │ │ └── annotations │ │ │ ├── LogLevel.java │ │ │ ├── ReduceTestLogging.java │ │ │ └── ReduceTestLoggingExtension.java │ │ ├── util │ │ ├── AdditionalBuildCommandsTest.java │ │ ├── CloseableListTest.java │ │ ├── DockerfileBuilderTest.java │ │ └── UtilsTest.java │ │ └── wdt │ │ └── WdtUnitTest.java │ └── resources │ ├── additionalBuildCommands │ ├── bad-section.txt │ ├── one-section.txt │ ├── two-mustache.txt │ └── two-sections.txt │ ├── buildFilesDir │ ├── fileA.txt │ ├── fileB.txt │ └── subDirectory │ │ ├── fileC.txt │ │ └── secondLevelDirectory │ │ └── fileD.txt │ ├── conflict-check │ ├── double-conflict.xml │ ├── no-conflict.xml │ └── simple-conflict.xml │ ├── docker-files │ └── mustache-writer-test.mustache │ ├── dummyInstallers │ ├── dummyResponse.txt │ └── test-installer.zip │ ├── inspect │ ├── image1.json │ ├── image1.properties │ ├── image2.json │ ├── image2.properties │ ├── image3.json │ └── image3.properties │ ├── patches │ ├── no-patches.xml │ ├── patch-11100001.xml │ ├── patch-11100002.xml │ ├── patch-11100003.xml │ ├── patch-11100004.xml │ ├── patch-11100005.xml │ ├── patch-11100006.xml │ ├── patch-11100007.xml │ ├── patch-28186730.xml │ ├── patch-2818673x.xml │ ├── recommended-patches-304.xml │ └── recommended-patches.xml │ ├── releases.xml │ ├── responseFiles │ └── responseA.txt │ ├── templates │ ├── resolver.yml │ └── verrazzano.yml │ └── utilsTest │ ├── lsinventory.txt │ ├── lsinventoryWithID.txt │ ├── responseFile1.txt │ └── testPasswordFile.txt ├── installer ├── pom.xml └── src │ └── assembly │ └── zip.xml ├── pom.xml ├── tests ├── pom.xml └── src │ └── test │ ├── java │ └── com │ │ └── oracle │ │ └── weblogic │ │ └── imagetool │ │ └── tests │ │ ├── ITImagetool.java │ │ ├── annotations │ │ ├── IntegrationTest.java │ │ └── Logger.java │ │ ├── extensions │ │ ├── LoggingExtension.java │ │ └── TimingExtension.java │ │ └── utils │ │ ├── CacheCommand.java │ │ ├── CommandResult.java │ │ ├── CreateAuxCommand.java │ │ ├── CreateCommand.java │ │ ├── ImageToolCommand.java │ │ ├── RebaseCommand.java │ │ ├── Runner.java │ │ └── UpdateCommand.java │ └── resources │ └── wdt │ ├── build-archive.sh │ ├── domain.properties │ ├── multi-sections.txt │ ├── simple-app │ ├── WEB-INF │ │ ├── web.xml │ │ └── weblogic.xml │ └── simple.html │ ├── simple-topology.yaml │ ├── simple-topology1.yaml │ └── simple-topology2.yaml └── wit.wptg /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | # .github/release.yml 2 | 3 | changelog: 4 | exclude: 5 | labels: 6 | - ignore-for-release 7 | authors: 8 | - dependabot 9 | categories: 10 | - title: Major Changes 11 | labels: 12 | - breaking-change 13 | - title: Additional Features 14 | labels: 15 | - enhancement 16 | - title: Bug Fixes 17 | labels: 18 | - "*" -------------------------------------------------------------------------------- /.github/workflows/create-release.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | name: Create Release 5 | run-name: Creating draft release for ${{ github.ref_name }} 6 | 7 | on: 8 | push: 9 | tags: 10 | - 'release-*' 11 | 12 | jobs: 13 | release_job: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - run: | 18 | mvn -B clean package 19 | - id: version 20 | run: echo "::set-output name=number::`echo "${{ github.ref_name }}" | sed 's/release-//'`" 21 | - env: 22 | GH_TOKEN: ${{ github.token }} 23 | run: | 24 | gh release create ${{ github.ref_name }} \ 25 | --draft \ 26 | --generate-notes \ 27 | --title 'WebLogic Image Tool ${{ steps.version.outputs.number }}' \ 28 | installer/target/imagetool.zip 29 | -------------------------------------------------------------------------------- /.github/workflows/publish-github-pages.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, 2024, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | # Description 5 | # Use Hugo to build static site and publish to gh-pages 6 | # 7 | name: "PublishGitHubPages" 8 | 9 | on: 10 | push: 11 | branches: 12 | - 'main' 13 | paths: 14 | - 'documentation/**' 15 | schedule: 16 | - cron: '15 3 * * 1' 17 | 18 | defaults: 19 | run: 20 | shell: bash 21 | 22 | jobs: 23 | publish: 24 | name: Publish 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - name: Checkout main 29 | uses: actions/checkout@v4 30 | with: 31 | ref: main 32 | path: main 33 | 34 | - name: Checkout gh-pages 35 | uses: actions/checkout@v4 36 | with: 37 | ref: gh-pages 38 | path: gh-pages 39 | token: ${{ secrets.GITHUB_TOKEN }} 40 | 41 | - name: Build and publish site 42 | run: | 43 | echo "Downloading Hugo for generating HTML documentation from Markdown" 44 | curl -fL -o hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v0.108.0/hugo_0.108.0_Linux-64bit.tar.gz" 45 | tar -xf hugo.tar.gz 46 | export PATH="$PWD:$PATH" 47 | 48 | mkdir $GITHUB_WORKSPACE/WORK 49 | echo "Building HTML documentation for main branch..." 50 | cd $GITHUB_WORKSPACE/main/documentation 51 | # Generate documentation into $GITHUB_WORKSPACE/WORK using Markdown source in the ./site folder 52 | hugo -s site -d "$GITHUB_WORKSPACE/WORK" -b https://oracle.github.io/weblogic-image-tool 53 | 54 | echo "Remove existing documentation files and replace them with newly generated files in branch gh-pages" 55 | cd $GITHUB_WORKSPACE/gh-pages 56 | rm -Rf * 57 | cp -R $GITHUB_WORKSPACE/WORK/* . 58 | git config --global user.name "github-actions[bot]" 59 | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" 60 | git add --all 61 | git commit -m "Documentation update from publish GitHub Action" 62 | git push origin gh-pages 63 | -------------------------------------------------------------------------------- /.github/workflows/sonar-branch.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | name: Sonar Scan 5 | 6 | on: 7 | push: 8 | branches: 9 | - 'main' 10 | - 'develop*' 11 | 12 | jobs: 13 | sonar_scan: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | with: 18 | fetch-depth: 0 19 | - name: Setup JDK 20 | uses: actions/setup-java@v4 21 | with: 22 | distribution: 'adopt' 23 | java-version: 17 24 | - name: Build and Test 25 | run: | 26 | mvn -B clean package 27 | - name: Sonar Scan 28 | run: | 29 | mvn -B sonar:sonar \ 30 | -Dsonar.branch.name=${GITHUB_REF##*/} \ 31 | -Dsonar.projectKey=oracle_weblogic-image-tool 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.gradle 2 | **/build 3 | *.iml 4 | .idea/ 5 | !.idea/codeStyles/Project.xml 6 | !.idea/codeStyles/codeStyleConfig.xml 7 | **/target 8 | **/.DS_Store 9 | .mvn/maven.config 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 21 | 23 | 24 | 35 | 36 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.mvn/maven.config-template: -------------------------------------------------------------------------------- 1 | -Dtest.staging.dir=/some/folder/with/installers 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this repository 2 | 3 | We welcome your contributions! There are multiple ways to contribute. 4 | 5 | ## Opening issues 6 | 7 | For bugs or enhancement requests, please file a GitHub issue unless it's 8 | security related. When filing a bug remember that the better written the bug is, 9 | the more likely it is to be fixed. If you think you've found a security 10 | vulnerability, do not raise a GitHub issue and follow the instructions in our 11 | [security policy](./SECURITY.md). 12 | 13 | ## Contributing code 14 | 15 | We welcome your code contributions. Before submitting code via a pull request, 16 | you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and 17 | your commits need to include the following line using the name and e-mail 18 | address you used to sign the OCA: 19 | 20 | ```text 21 | Signed-off-by: Your Name 22 | ``` 23 | 24 | This can be automatically added to pull requests by committing with `--sign-off` 25 | or `-s`, e.g. 26 | 27 | ```text 28 | git commit --signoff 29 | ``` 30 | 31 | Only pull requests from committers that can be verified as having signed the OCA 32 | can be accepted. 33 | 34 | ## Pull request process 35 | 36 | 1. Ensure there is an issue created to track and discuss the fix or enhancement 37 | you intend to submit. 38 | 1. Fork this repository 39 | 1. Create a branch in your fork to implement the changes. We recommend using 40 | the issue number as part of your branch name, e.g. `1234-fixes` 41 | 1. Ensure that any documentation is updated with the changes that are required 42 | by your change. 43 | 1. Ensure that any samples are updated if the base image has been changed. 44 | 1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly 45 | what your changes are meant to do and provide simple steps on how to validate 46 | your changes. Ensure that you reference the issue you created as well. 47 | 1. We will assign the pull request to 2-3 people for review before it is merged. 48 | 49 | ## Code of conduct 50 | 51 | Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd 52 | like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC]. 53 | 54 | [OCA]: https://oca.opensource.oracle.com 55 | [COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/ 56 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Oracle and/or its affiliates. 2 | 3 | The Universal Permissive License (UPL), Version 1.0 4 | 5 | Subject to the condition set forth below, permission is hereby granted to any 6 | person obtaining a copy of this software, associated documentation and/or data 7 | (collectively the "Software"), free of charge and under any and all copyright 8 | rights in the Software, and any and all patent rights owned or freely 9 | licensable by each licensor hereunder covering either (i) the unmodified 10 | Software as contributed to or provided by such licensor, or (ii) the Larger 11 | Works (as defined below), to deal in both 12 | 13 | (a) the Software, and 14 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 15 | one is included with the Software (each a "Larger Work" to which the Software 16 | is contributed by such licensors), 17 | 18 | without restriction, including without limitation the rights to copy, create 19 | derivative works of, display, perform, and distribute the Software and make, 20 | use, sell, offer for sale, import, export, have made, and have sold the 21 | Software and the Larger Work(s), and to sublicense the foregoing rights on 22 | either these or other terms. 23 | 24 | This license is subject to the following condition: 25 | The above copyright notice and either this complete permission notice or at 26 | a minimum a reference to the UPL must be included in all copies or 27 | substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | SOFTWARE. 36 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security vulnerabilities 2 | 3 | Oracle values the independent security research community and believes that 4 | responsible disclosure of security vulnerabilities helps us ensure the security 5 | and privacy of all our users. 6 | 7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you 8 | believe you have found a security vulnerability, please submit a report to 9 | [secalert_us@oracle.com][1] preferably with a proof of concept. Please review 10 | some additional information on [how to report security vulnerabilities to Oracle][2]. 11 | We encourage people who contact Oracle Security to use email encryption using 12 | [our encryption key][3]. 13 | 14 | We ask that you do not use other channels or contact the project maintainers 15 | directly. 16 | 17 | Non-vulnerability related security issues including ideas for new or improved 18 | security features are welcome on GitHub Issues. 19 | 20 | ## Security updates, alerts and bulletins 21 | 22 | Security updates will be released on a regular cadence. Many of our projects 23 | will typically release security fixes in conjunction with the 24 | Oracle Critical Patch Update program. Additional 25 | information, including past advisories, is available on our [security alerts][4] 26 | page. 27 | 28 | ## Security-related information 29 | 30 | We will provide security related information such as a threat model, considerations 31 | for secure use, or any known security issues in our documentation. Please note 32 | that labs and sample code are intended to demonstrate a concept and may not be 33 | sufficiently hardened for production use. 34 | 35 | [1]: mailto:secalert_us@oracle.com 36 | [2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html 37 | [3]: https://www.oracle.com/security-alerts/encryptionkey.html 38 | [4]: https://www.oracle.com/security-alerts/ 39 | -------------------------------------------------------------------------------- /bug_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Only use this script when releasing bug fixes (removes SNAPSHOT for version) 3 | set -e 4 | git checkout main 5 | 6 | project_version=$(mvn help:evaluate -q -DforceStdout -D"expression=project.version") 7 | echo Current POM version: ${project_version} 8 | 9 | project_version_number_only=$(echo $project_version | sed -e 's/[^0-9][^0-9]*$//') 10 | last_digit=$(echo $project_version_number_only | sed -e 's/[0-9]*\.//g') 11 | next_digit=$(($last_digit+1)) 12 | new_version=$(echo $project_version | sed -e "s/[0-9][0-9]*\([^0-9]*\)$/$next_digit\1/") 13 | 14 | echo New Version: ${new_version} 15 | 16 | mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false 17 | mvn clean install 18 | git add . 19 | git commit -m "release ${project_version_number_only}" 20 | git push 21 | 22 | git tag release-${project_version_number_only} 23 | git push origin release-${project_version_number_only} 24 | 25 | mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${new_version} 26 | mvn clean install 27 | git add . 28 | git commit -m "preparing for next development iteration" 29 | git push 30 | 31 | -------------------------------------------------------------------------------- /build-tools/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 4.0.0 6 | 7 | com.oracle.weblogic.lifecycle.imagetool 8 | build-tools 9 | 1.2 10 | Build Tools 11 | 12 | 13 | UTF-8 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /build-tools/src/main/resources/weblogic-image-tool/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /build-tools/src/main/resources/weblogic-image-tool/pmd/weblogicx-ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | This is the WebLogic X PMD ruleset. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /build-tools/src/main/resources/weblogic-image-tool/pmd/weblogicx-test-ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | This is the Webogic X PMD ruleset. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /documentation/site/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /documentation/site/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: false 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /documentation/site/config.toml: -------------------------------------------------------------------------------- 1 | # analytics 2 | googleAnalytics = "UA-129126578-2" 3 | 4 | baseURL = "/weblogic-image-tool/" 5 | languageCode = "en-us" 6 | title = "WebLogic Image Tool" 7 | 8 | # Change the default theme to be use when building the site with Hugo 9 | theme = "hugo-theme-learn" 10 | 11 | publishDir = "docs" 12 | 13 | # For search functionality 14 | [outputs] 15 | home = [ "HTML", "RSS", "JSON"] 16 | 17 | [params] 18 | # disable the copy to clipboard links 19 | disableInlineCopyToClipBoard = true 20 | -------------------------------------------------------------------------------- /documentation/site/content/argument-file.md: -------------------------------------------------------------------------------- 1 | # Use an argument file 2 | 3 | You can save all arguments passed for the Image Tool in a file, then use the file as a parameter. 4 | 5 | For example, create a file called `build_args`: 6 | 7 | ```bash 8 | create 9 | --type wls 10 | --version 12.2.1.3.0 11 | --tag wls:122130 12 | --user acmeuser@mycompany.com 13 | --httpProxyUrl http://mycompany-proxy:80 14 | --httpsProxyUrl http://mycompany-proxy:80 15 | --passwordEnv MYPWD 16 | 17 | ``` 18 | 19 | Use it on the command line, as follows: 20 | 21 | ```bash 22 | imagetool @/path/to/build_args 23 | ``` 24 | 25 | ### Copyright 26 | Copyright (c) 2019, 2021, Oracle and/or its affiliates. 27 | -------------------------------------------------------------------------------- /documentation/site/content/developer/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Developer Guide" 3 | date = 2019-02-22T15:27:54-05:00 4 | weight = 4 5 | chapter = true 6 | pre = " " 7 | +++ 8 | 9 | # Developer Guide 10 | 11 | The Developer Guide provides information for developers who want to build the installer from source or contribute to the code. 12 | -------------------------------------------------------------------------------- /documentation/site/content/developer/contribute.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Contribute to WIT" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 2 6 | --- 7 | 8 | Oracle welcomes contributions to this repository from anyone. 9 | 10 | If you want to submit a pull request to fix a bug or enhance an existing 11 | feature, please first open an issue and link to that issue when you 12 | submit your pull request. 13 | 14 | If you have any questions about a possible submission, feel free to open 15 | an issue too. 16 | 17 | ### Contributing to the WebLogic Image Tool repository 18 | 19 | Pull requests can be made under 20 | [The Oracle Contributor Agreement](https://oca.opensource.oracle.com/) (OCA). 21 | 22 | For pull requests to be accepted, the bottom of your commit message must have 23 | the following line using your name and e-mail address as it appears in the 24 | OCA Signatories list. 25 | 26 | ``` 27 | Signed-off-by: Your Name 28 | ``` 29 | 30 | This can be automatically added to pull requests by committing with: 31 | 32 | ``` 33 | $ git commit --signoff 34 | ``` 35 | 36 | Only pull requests from committers that can be verified as having 37 | signed the OCA can be accepted. 38 | 39 | ### Pull request process 40 | 41 | 1. Fork this repository. 42 | 2. Create a branch in your fork to implement the changes. We recommend using the issue number as part of your branch name, for example, 1234-fixes. 43 | 3. Ensure that any documentation is updated with the changes that are required by your fix. 44 | 4. Ensure that any samples are updated if the base image has been changed. 45 | 5. Squash your branch changes into a single commit. 46 | 6. Submit the pull request. 47 | 48 | a. Do not leave the pull request blank. 49 | 50 | b. Explain exactly what your changes are meant to do and provide simple steps on how to validate your changes. 51 | 52 | c. Ensure that you reference the issue you created as well. 53 | 54 | 7. We will assign the pull request to 2-3 people for review before it is merged. 55 | -------------------------------------------------------------------------------- /documentation/site/content/quickstart/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Quick Start" 3 | date = 2019-02-22T15:27:54-05:00 4 | weight = 1 5 | chapter = true 6 | pre = " " 7 | +++ 8 | 9 | # Quick Start Guide 10 | 11 | Use this Quick Start guide to create a Linux based WebLogic container image. 12 | -------------------------------------------------------------------------------- /documentation/site/content/quickstart/quickstart.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Steps" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 3 6 | --- 7 | 8 | 9 | #### Before you begin 10 | 11 | Make sure that you have fulfilled the [Prerequisites]({{< relref "/userguide/prerequisites.md" >}}) and [Setup]({{< relref "/userguide/setup.md" >}}) requirements. 12 | 13 | #### Overview 14 | 15 | The high level steps for creating an image are: 16 | 17 | 1. Download the Java and WebLogic installers from the [Oracle Software Delivery Cloud](https://edelivery.oracle.com). 18 | 2. Add the installers to the cache store. 19 | 3. Run the ```imagetool``` command to create the image. 20 | 21 | #### Do this 22 | 23 | 1. Download these Java and WebLogic installers from the [Oracle Software Delivery Cloud](https://edelivery.oracle.com) 24 | and save them in a directory of your choice, for example, `/home/acmeuser/wls-installers`: 25 | 26 | `fmw_12.2.1.3.0_wls_Disk1_1of1.zip`\ 27 | `jdk-8u202-linux-x64.tar.gz` 28 | 29 | 30 | 2. Use the [Cache Tool]({{< relref "/userguide/tools/cache.md" >}}) to add the installers: 31 | 32 | ```bash 33 | $ imagetool cache addInstaller --type jdk --version 8u202 --path /home/acmeuser/wls-installers/jdk-8u202-linux-x64.tar.gz 34 | ``` 35 | 36 | ```bash 37 | $ imagetool cache addInstaller --type wls --version 12.2.1.3.0 --path /home/acmeuser/wls-installers/fmw_12.2.1.3.0_wls_Disk1_1of1.zip 38 | ``` 39 | 40 | You can verify the cache entries by: 41 | 42 | ```bash 43 | $ imagetool cache listItems 44 | ``` 45 | 46 | ```bash 47 | Cache contents 48 | jdk_8u202=/home/acmeuser/wls-installers/jdk-8u202-linux-x64.tar.gz 49 | wls_12.2.1.3.0=/home/acmeuser/wls-installers/fmw_12.2.1.3.0_wls_Disk1_1of1.zip 50 | ``` 51 | 52 | 3. Run the [`imagetool create`]({{< relref "/userguide/tools/create-image.md" >}}) command: 53 | 54 | ```bash 55 | $ imagetool create --tag wls:12.2.1.3.0 56 | ``` 57 | 58 | The final image will have the following structure: 59 | 60 | ```bash 61 | [oracle@c3fe8ee0167d oracle]$ ls -arlt /u01/ 62 | total 20 63 | drwxr-xr-x 7 oracle oracle 4096 May 28 23:40 jdk 64 | drwxr-xr-x 11 oracle oracle 4096 May 28 23:40 oracle 65 | drwxr-xr-x 5 oracle oracle 4096 May 28 23:40 . 66 | drwxr-xr-x 18 root root 4096 May 29 01:31 .. 67 | ``` 68 | -------------------------------------------------------------------------------- /documentation/site/content/release-notes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | * The upcoming change to Oracle Support's recommended patches list will require 4 | WebLogic Image Tool 1.9.11 in order to use the `--recommendedPatches` or `--latestPSU` flags. 5 | * Due to changes in Oracle’s security, older versions of the Image Tool will no longer be able to download patches. 6 | Please use WebLogic Image Tool 1.9.10 or later. 7 | -------------------------------------------------------------------------------- /documentation/site/content/samples/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Samples" 3 | date = 2019-02-22T15:27:54-05:00 4 | weight = 3 5 | chapter = true 6 | pre = " " 7 | +++ 8 | 9 | # Samples 10 | -------------------------------------------------------------------------------- /documentation/site/content/samples/create-image-wdt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Create an image with a WLS domain using WDT" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 4 6 | --- 7 | 8 | The Image Tool lets you create a customized WebLogic domain in the image using the [WebLogic Deploy Tool](https://oracle.github.io/weblogic-deploy-tooling/). 9 | 10 | ### Steps 11 | 12 | 1. Create the image, as directed in the [Quick Start]({{< relref "/quickstart/quickstart.md" >}}) guide. 13 | 14 | 2. Download the [WebLogic Deploy Tool](https://github.com/oracle/weblogic-deploy-tooling/releases), and then add it to the cache store: 15 | 16 | ```bash 17 | $ imagetool cache addInstaller --type wdt --version 0.22 --path /home/acmeuser/cache/weblogic-deploy.zip 18 | ``` 19 | 20 | 3. Provide the command-line options for the WebLogic Deploy Tool: 21 | 22 | ```bash 23 | $ imagetool create --fromImage myosimg:latest --tag wls:12.2.1.3.0 --version 12.2.1.3.0 --wdtVersion 1.4.0 --wdtArchive /home/acmeuser/wdt/domain1.zip --wdtDomainHome /u01/domains/simple_domain 24 | ``` 25 | 26 | The parameter mappings between the Image Tool and the WebLogic Deploy Tool are: 27 | 28 | | Image Tool | WebLogic Deploy Tool | Default | 29 | |--------------------|-------------------------|--------| 30 | | `--wdtArchive` | `-archive_file` | | 31 | | `--wdtModel` | `-model_file` | | 32 | | `--wdtVariables` | `-variable_file` | | 33 | | `--wdtRunRCU` | `-run_rcu` | `false` | 34 | | `--wdtDomainHome` | `-domain_home` | | 35 | | `--wdtDomainType` | `-domain_type` | `WLS` | 36 | 37 | 38 | If you do not specify ```--wdtDomainHome```, the domain will be created under ```/u01/domains/base_domain```. 39 | 40 | **Note**: If you are creating a JRF domain and want WebLogic Deploy Tool to create the RCU schemas for you, you can 41 | specify the connection information in the model. See [Specifying RCU 42 | information in the model](https://oracle.github.io/weblogic-deploy-tooling/rcuinfo/). 43 | -------------------------------------------------------------------------------- /documentation/site/content/samples/patching-image.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Patch an existing image" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 3 6 | --- 7 | 8 | This example shows you how to apply WebLogic Server patches to an existing image. 9 | You can download patches using the Image Tool or by manually downloading them. 10 | 11 | ### Steps 12 | 13 | 1. Create the image, as directed in the [Quick Start]({{< relref "/quickstart/quickstart.md" >}}) guide. 14 | 15 | 2. For each WebLogic patch, download it from [Oracle Support](https://support.oracle.com/keystone/) and set up the cache. 16 | 17 | For example, to download patch number `27342434` for WebLogic Server version 12.2.1.3.0: 18 | 19 | ```bash 20 | $ imagetool cache addPatch --patchId 27342434_12.2.1.3.0 --path /home/acmeuser/cache/p27342434_122130_Generic.zip 21 | ``` 22 | 23 | **Note**: Refer to the [Cache]({{< relref "/userguide/tools/cache.md" >}}) commands for the format of ```patchId```. 24 | 25 | 3. Use the [`imagetool update`]({{< relref "/userguide/tools/update-image.md" >}}) command to update the image: 26 | 27 | ```bash 28 | $ imagetool update --fromImage wls:12.2.1.3.0 --tag wls:12.2.1.3.4 --patches 27342434 29 | ``` 30 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "User Guide" 3 | date = 2019-02-22T15:27:54-05:00 4 | weight = 2 5 | chapter = true 6 | pre = " " 7 | +++ 8 | 9 | # User Guide 10 | 11 | The User Guide provides detailed usage information for the WebLogic Image Tool, including typical use case scenarios. 12 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/cleanup.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Cleanup" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 4 6 | --- 7 | 8 | 9 | The Image Tool creates a temporary Docker context directory, prefixed by ```wlsimgbuilder_temp```, 10 | every time the tool runs. Under normal circumstances, this context directory will be deleted. However, 11 | if the process is aborted or the tool is unable to remove the directory, it is safe for you to delete it manually. 12 | 13 | By default, the Image Tool creates the Docker context directory under the user's home directory. 14 | If you prefer to use a different directory for the temporary context, set the environment variable `WLSIMG_BLDDIR`. 15 | 16 | ```bash 17 | $ export WLSIMG_BLDDIR="/path/to/dir" 18 | ``` 19 | 20 | 21 | The Image Tool will try to prune intermediate images from the Docker multi-stage build after the build step. 22 | If you see dangling images after the build (images labeled as ``), use the following command to remove them: 23 | 24 | ```bash 25 | $ docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 26 | ``` 27 | 28 | If you wish to keep the Docker context directory and/or the intermediate images, using the `--skipcleanup` flag will 29 | skip the delete steps. Some older versions of Docker do not support the prune command used by the Image Tool. 30 | As a temporary workaround, `--skipcleanup` can be used to skip the prune command until you are able to upgrade to a 31 | newer version of Docker. 32 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/config.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Configuration" 3 | date: 2024-04-16T08:00:00-05:00 4 | draft: false 5 | weight: 5 6 | --- 7 | 8 | The default configuration is typically adequate for common use. But, the following environment variables are provided for 9 | non-typical use cases when the default values are insufficient. 10 | 11 | ### Environment variables 12 | 13 | - `WLSIMG_BLDDIR` - During the build process, Image Tool creates a Docker context directory where it will create a Dockerfile and copy necessary files for the container image build. Setting this variable to another directory overrides the default of the user's home directory as the parent folder of the Docker context directory. 14 | - `WLSIMG_BUILDER` - As an alternative to the command-line argument `--builder`, this variable can be used to override the tool to process the Dockerfile (such as`docker` or `podman`). The provided value should be the full path to the executable. For example, `WLSIMG_BUILDER="/usr/bin/docker"`. 15 | - `WLSIMG_CACHEDIR` - When Image Tool downloads patches, those patches are saved in the cache directory. Setting this variable to another directory overrides the default of the `cache` folder in the user's home directory. 16 | - `WLSIMG_OS_PACKAGES` - There are several packages and libraries that are required by the WebLogic Kubernetes Toolkit. The default packages included at build time are `gzip tar unzip libaio libnsl jq findutils diffutils`. The names for those libraries can be different depending on your preferred Linux distribution or OS version. The value that you provide in this environment variable will be used in place of the default package list. 17 | 18 | 19 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/logging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Logging" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 5 6 | --- 7 | 8 | The Image Tool uses standard Java logging. To alter the default logging settings, you can modify the `logging.properties` 9 | file under the `bin` directory where you installed the Image Tool. 10 | 11 | ### To enable debug logging 12 | In `logging.properties`, comment the existing `handlers` property and uncomment the second `handlers` line below the first 13 | line that you just commented. This should make the `logging.properties` file look something like this: 14 | ```properties 15 | #handlers=java.util.logging.ConsoleHandler 16 | $ handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler 17 | ``` 18 | Then, change level to `FINE` or `FINER`. 19 | ```properties 20 | #com.oracle.weblogic.imagetool.level=INFO 21 | com.oracle.weblogic.imagetool.level=FINER 22 | ``` 23 | 24 | Logging severity levels from highest to lowest: 25 | 26 | | Level | Description | 27 | | --- | --- | 28 | | `SEVERE` | Only error messages are written to the log file. | 29 | | `WARNING` | Warning messages and higher are written to the log file. | 30 | | `INFO` | (Default) Informational messages and higher are written to the log file. | 31 | | `FINE` | First level debug messages and higher are written to the log file. | 32 | | `FINER` | Detailed debug messages and higher are written to the log file. | 33 | | `FINEST` | In addition to FINER level debug messages, all HTTP responses are written to the log file. | 34 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/prerequisites.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Prerequisites" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 1 6 | --- 7 | 8 | - A container image client on the build machine, such as Docker or Podman. 9 | - For Docker, a minimum version of 18.03.1.ce is required. 10 | - For Podman, a minimum version of 3.0.1 is required. 11 | - An installed version of Java to run Image Tool, version 8+. 12 | - Installers for Oracle WebLogic Server and Oracle JDK from the [Oracle Software Delivery Cloud](https://edelivery.oracle.com) for installation into the new image. 13 | - When using the `imagetool` alias from `setup.sh` instead of the shell script (`imagetool.sh`), Bash version 4.0 or later is required for `` command completion. 14 | - When using any of the patching options, `--patches`, `--recommendedPatches`, or `--latestPSU`, you will need to provide [Oracle Support](https://www.oracle.com/technical-resources/) credentials. 15 | 16 | {{% notice note %}} The WebLogic Image Tool does not support a Stack Patch Bundle (SPB; see Doc ID [2764636.1](https://support.oracle.com/rs?type=doc&id=2764636.1)), because an SPB is _not_ a patch but a mechanism for applying all PSU and recommended CPU and SPU patches to a WebLogic Server installation, similar to invoking the Image Tool `create` or `update` command with the `--recommendedPatches` option. 17 | {{% /notice %}} 18 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Setup" 3 | date: 2019-02-23T17:19:24-05:00 4 | draft: false 5 | weight: 2 6 | --- 7 | 8 | - Download the WIT release ZIP file to a desired location. 9 | - The latest ZIP file can be found on the project [releases](https://github.com/oracle/weblogic-image-tool/releases) page. 10 | - Alternatively, you can download the ZIP file with cURL. 11 | ```shell 12 | curl -m 120 -fL https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip -o ./imagetool.zip 13 | ``` 14 | - Unzip the downloaded ZIP file into a directory of your choice. 15 | - All of the contents of the ZIP file will be extracted into a single subdirectory named `imagetool`. 16 | - OPTIONALLY: You may build the project (`mvn clean package`) to create the ZIP file installer in `./imagetool/target` (see [Build From Source]({{< relref "/developer/source.md" >}})). 17 | - Set the JAVA_HOME environment variable to the location of the Java install (see [Prerequisites]({{< relref "/userguide/prerequisites.md" >}})). 18 | -------------------------------------------------------------------------------- /documentation/site/content/userguide/tools/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Image Tool" 3 | date = 2019-02-22 4 | weight = 3 5 | pre = " " 6 | +++ 7 | 8 | 9 | {{% children style="h4" description="true" %}} 10 | -------------------------------------------------------------------------------- /documentation/site/layouts/shortcodes/img.html: -------------------------------------------------------------------------------- 1 | {{ .Get 0 }} -------------------------------------------------------------------------------- /documentation/site/layouts/shortcodes/rawhtml.html: -------------------------------------------------------------------------------- 1 | 2 | {{.Inner}} -------------------------------------------------------------------------------- /documentation/site/layouts/shortcodes/readfile.html: -------------------------------------------------------------------------------- 1 | {{ $toRead := .Get "file" }} 2 | {{ readFile $toRead | markdownify }} 3 | -------------------------------------------------------------------------------- /documentation/site/runlocal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2019, 2021, Oracle and/or its affiliates. 4 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | 6 | # 1313 is the hugo default port 7 | port=${1:-1313} 8 | 9 | hugo server -b http://localhost:$port/weblogic-image-tool -D -p $port 10 | -------------------------------------------------------------------------------- /documentation/site/runpublic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2019, 2021, Oracle and/or its affiliates. 4 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | 6 | # 1313 is the hugo default port 7 | port=${1:-1313} 8 | 9 | hugo server -b http://$(hostname).$(dnsdomainname):$port/weblogic-image-tool -D --bind=$(hostname).$(dnsdomainname) -p $port 10 | -------------------------------------------------------------------------------- /documentation/site/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/static/images/logo.png -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | trim_trailing_whitespace = true 11 | 12 | [*.js] 13 | insert_final_newline = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | public/ 3 | exampleSite/public 4 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/.grenrc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dataSource: "prs" 3 | prefix: "v" 4 | onlyMilestones: false 5 | changelogFilename: "CHANGELOG.md" 6 | includeMessages: "all" 7 | ignoreIssuesWith: 8 | - "support" 9 | ignoreLabels: 10 | - "duplicate" 11 | - "invalid" 12 | - "wontfix" 13 | groupBy: 14 | New features: 15 | - "feature" 16 | Bug Fixes: 17 | - "bug" 18 | Enhancements: 19 | - "enhancement" 20 | Internationalisation: 21 | - "i18n" 22 | Theme Meta: 23 | - "meta" 24 | Uncategorised: 25 | - "closed" 26 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Grav 4 | Copyright (c) 2016 MATHIEU CORNIC 5 | Copyright (c) 2017 Valere JEANTET 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/archetypes/chapter.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "{{ replace .Name "-" " " | title }}" 3 | date = {{ .Date }} 4 | weight = 5 5 | chapter = true 6 | pre = "X. " 7 | +++ 8 | 9 | ### Chapter X 10 | 11 | # Some Chapter title 12 | 13 | Lorem Ipsum. -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "{{ replace .Name "-" " " | title }}" 3 | date = {{ .Date }} 4 | weight = 5 5 | +++ 6 | 7 | Lorem Ipsum. -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/ar.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "...البحث" 3 | 4 | [Clear-History] 5 | other = "مسح السجل" 6 | 7 | [Attachments-label] 8 | other = "مرفقات" 9 | 10 | [title-404] 11 | other = "خطأ" 12 | 13 | [message-404] 14 | other = ".¯\\_(ツ)_/¯أوبس. يبدو أن هذه الصفحة غير موجودة" 15 | 16 | [Go-to-homepage] 17 | other = "الذهاب إلى الصفحة الرئيسية" 18 | 19 | [Edit-this-page] 20 | other = "تعديل هذه الصفحة" 21 | 22 | [Shortcuts-Title] 23 | other = "المزيد" 24 | 25 | [Expand-title] 26 | other = "...قم بتوسيع" 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/de.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Suchen..." 3 | 4 | [Clear-History] 5 | other = "Verlauf löschen" 6 | 7 | [Attachments-label] 8 | other = "Anhänge" 9 | 10 | [title-404] 11 | other = "Fehler" 12 | 13 | [message-404] 14 | other = "Huch. Diese Seite scheint nicht zu existieren ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Gehe zur Homepage" 18 | 19 | [Edit-this-page] 20 | other = "Bearbeite diese Seite" 21 | 22 | [Shortcuts-Title] 23 | other = "Mehr" 24 | 25 | [Expand-title] 26 | other = "Erweitere mich..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/en.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Search..." 3 | 4 | [Clear-History] 5 | other = "Clear History" 6 | 7 | [Attachments-label] 8 | other = "Attachments" 9 | 10 | [title-404] 11 | other = "Error" 12 | 13 | [message-404] 14 | other = "Woops. Looks like this page doesn't exist ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Go to homepage" 18 | 19 | [Edit-this-page] 20 | other = "Edit this page" 21 | 22 | [Shortcuts-Title] 23 | other = "More" 24 | 25 | [Expand-title] 26 | other = "Expand me..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/es.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Buscar..." 3 | 4 | [Clear-History] 5 | other = "Borrar Historial" 6 | 7 | [Attachments-label] 8 | other = "Adjuntos" 9 | 10 | [title-404] 11 | other = "Error" 12 | 13 | [message-404] 14 | other = "Ups. Parece que la página no existe ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Ir al inicio" 18 | 19 | [Edit-this-page] 20 | other = "Editar esta página" 21 | 22 | [Shortcuts-Title] 23 | other = "Más" 24 | 25 | [Expand-title] 26 | other = "Expandir..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/fr.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Rechercher..." 3 | 4 | [Clear-History] 5 | other = "Supprimer l'historique" 6 | 7 | [Attachments-label] 8 | other = "Pièces jointes" 9 | 10 | [title-404] 11 | other = "Erreur" 12 | 13 | [message-404] 14 | other = "Oups. On dirait que cette page n'existe pas ¯\\_(ツ)_/¯" 15 | 16 | [Go-to-homepage] 17 | other = "Vers la page d'accueil" 18 | 19 | [Edit-this-page] 20 | other = "Modifier la page" 21 | 22 | [Shortcuts-Title] 23 | other = "Aller plus loin" 24 | 25 | [Expand-title] 26 | other = "Déroulez-moi..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "ko" -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/hi.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "खोजे..." 3 | 4 | [Clear-History] 5 | other = "इतिहास मिटाएँ" 6 | 7 | [Attachments-label] 8 | other = "संलग्नंक (अटैचमेंट)" 9 | 10 | [title-404] 11 | other = "त्रुटि" 12 | 13 | [message-404] 14 | other = "यह पृष्ठ अभि अनुपलब्ध है!" 15 | 16 | [Go-to-homepage] 17 | other = "मुख्य पृष्ठ पर जाऐ" 18 | 19 | [Edit-this-page] 20 | other = "यह पृष्ठ संपादित करें" 21 | 22 | [Shortcuts-Title] 23 | other = "अधिक सामग्री दिखाएं" 24 | 25 | [Expand-title] 26 | other = "विस्तार करे..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/id.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Telusuri..." 3 | 4 | [Clear-History] 5 | other = "Bersihkan Riwayat" 6 | 7 | [Attachments-label] 8 | other = "Lampiran" 9 | 10 | [title-404] 11 | other = "Kesalahan" 12 | 13 | [message-404] 14 | other = "Oops. Sepertinya halaman ini tidak ada ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Ke halaman depan" 18 | 19 | [Edit-this-page] 20 | other = "Edit halaman ini" 21 | 22 | [Shortcuts-Title] 23 | other = "Lainnya" 24 | 25 | [Expand-title] 26 | other = "Bentangkan..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/ja.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "検索..." 3 | 4 | [Clear-History] 5 | other = "履歴削除" 6 | 7 | [Attachments-label] 8 | other = "添付" 9 | 10 | [title-404] 11 | other = "エラー" 12 | 13 | [message-404] 14 | other = "おっと。ページが見当たりません。 ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "ホームページへ行く" 18 | 19 | [Edit-this-page] 20 | other = "このページを編集" 21 | 22 | [Shortcuts-Title] 23 | other = "更に" 24 | 25 | [Expand-title] 26 | other = "開く..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/nl.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Zoeken..." 3 | 4 | [Clear-History] 5 | other = "Wis geschiedenis" 6 | 7 | [Attachments-label] 8 | other = "Bijlagen" 9 | 10 | [title-404] 11 | other = "Error" 12 | 13 | [message-404] 14 | other = "Blijkbaar bestaat deze pagina niet ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Naar startpagina" 18 | 19 | [Edit-this-page] 20 | other = "Deze pagina bewerken" 21 | 22 | [Shortcuts-Title] 23 | other = "Snelkoppelingen" 24 | 25 | [Expand-title] 26 | other = "Lees meer..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/pt.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Procurar..." 3 | 4 | [Clear-History] 5 | other = "Limpar Histórico" 6 | 7 | [Attachments-label] 8 | other = "Anexos" 9 | 10 | [title-404] 11 | other = "Erro" 12 | 13 | [message-404] 14 | other = "Ops. Parece que a página não existe ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Ir para o início" 18 | 19 | [Edit-this-page] 20 | other = "Editar esta página" 21 | 22 | [Shortcuts-Title] 23 | other = "Mais" 24 | 25 | [Expand-title] 26 | other = "Expandir..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/ru.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Поиск..." 3 | 4 | [Clear-History] 5 | other = "Очистить историю" 6 | 7 | [Attachments-label] 8 | other = "Присоединенные файлы" 9 | 10 | [title-404] 11 | other = "Ошибка" 12 | 13 | [message-404] 14 | other = "Упс. Выглядит будто такой страницы нет ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Перейти на главную" 18 | 19 | [Edit-this-page] 20 | other = "Редактировать" 21 | 22 | [Shortcuts-Title] 23 | other = "Еще" 24 | 25 | [Expand-title] 26 | other = "Развернуть..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "килобайт" -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/tr.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Ara..." 3 | 4 | [Clear-History] 5 | other = "Geçmişi Temizle" 6 | 7 | [Attachments-label] 8 | other = "Ekler" 9 | 10 | [title-404] 11 | other = "Hata" 12 | 13 | [message-404] 14 | other = "Uups. Görünüşe göre böyle bir sayfa yok ¯\\_(ツ)_/¯" 15 | 16 | [Go-to-homepage] 17 | other = "Anasayfaya dön" 18 | 19 | [Edit-this-page] 20 | other = "Sayfayı düzenle" 21 | 22 | [Shortcuts-Title] 23 | other = "Dahası Var" 24 | 25 | [Expand-title] 26 | other = "Genişlet..." 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/i18n/zh-cn.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "搜索..." 3 | 4 | [Clear-History] 5 | other = "清理历史记录" 6 | 7 | [Attachments-label] 8 | other = "附件" 9 | 10 | [title-404] 11 | other = "错误" 12 | 13 | [message-404] 14 | other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。" 15 | 16 | [Go-to-homepage] 17 | other = "转到主页" 18 | 19 | [Edit-this-page] 20 | other = "编辑当前页" 21 | 22 | [Shortcuts-Title] 23 | other = "更多" 24 | 25 | [Expand-title] 26 | other = "展开" 27 | 28 | [BinaryPrefix-kilobyte] 29 | other = "kb" 30 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/images/screenshot.png -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/images/tn.png -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | 3 | {{ if eq .Kind "section" }} 4 | {{ .Content }} 5 | {{end}} 6 | 7 | {{ if or (eq .Kind "taxonomy") (eq .Kind "term") }} 8 |
    9 | {{ range .Pages }} 10 |
  • {{.Title}}
  • 11 | {{ end }} 12 |
13 | {{end}} 14 | 15 |
16 | {{with .Params.LastModifierDisplayName}} 17 | {{ . }} {{with $.Date}} {{ .Format "02/01/2006" }}{{end}} 18 | 19 | {{end}} 20 |
21 | 22 | {{ partial "footer.html" . }} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | 3 | {{ .Content }} 4 | 5 |
6 | {{with .Params.LastModifierDisplayName}} 7 | {{ . }} {{with $.Date}} {{ .Format "02/01/2006" }}{{end}} 8 | 9 | {{end}} 10 |
11 | 12 | {{ partial "footer.html" . }} 13 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | 3 | navigation 4 | 5 | 6 | {{if .Site.Home.Content }} 7 | {{.Site.Home.Content}} 8 | {{else}} 9 | {{if eq .Site.Language.Lang "fr"}} 10 |

Personaliser la page d'accueil

11 |

12 | Le site fonctionne. Ne pas oublier de personaliser cette page avec votre propre contenu. 3 manières de faire : 13 |

14 |
    15 |
  • 1. Créer un fichier _index.md dans le dossier content et le remplir de Markdown
  • 16 |
  • 2. Créer un fichier index.html dans le dossier static et le remplir de code HTML
  • 17 |
  • 3. Configurer le serveur http pour rediriger automatiquement la homepage vers la page de votre choix dans le site
  • 18 |
19 | {{else}} 20 |

Customize your own home page

21 |

22 | The site is working. Don't forget to customize this homepage with your own. You typically have 3 choices : 23 |

24 |
    25 |
  • 1. Create an _index.md document in content folder and fill it with Markdown content
  • 26 |
  • 2. Create an index.html file in the static folder and fill the file with HTML content
  • 27 |
  • 3. Configure your server to automatically redirect home page to one your documentation page
  • 28 |
29 | {{end}} 30 | {{ end }} 31 | {{ partial "footer.html" . }} 32 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/index.json: -------------------------------------------------------------------------------- 1 | [{{ range $index, $page := .Site.Pages }} 2 | {{- if ne $page.Type "json" -}} 3 | {{- if and $index (gt $index 0) -}},{{- end }} 4 | { 5 | "uri": "{{ $page.Permalink }}", 6 | "title": "{{ htmlEscape $page.Title}}", 7 | "tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}], 8 | "description": "{{ htmlEscape .Description}}", 9 | "content": {{$page.Plain | jsonify}} 10 | } 11 | {{- end -}} 12 | {{- end -}}] -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/custom-comments.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/custom-footer.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/custom-header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/logo.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/menu-footer.html: -------------------------------------------------------------------------------- 1 |

Created with from Oracle

2 |

 

3 |

GitHub repo

4 |

Public Slack #weblogic

5 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | 2 | {{ with .Site.Params.author }}{{ end }} 3 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/search.html: -------------------------------------------------------------------------------- 1 | 6 | {{ $assetBusting := not .Site.Params.disableAssetsBusting }} 7 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/tags.html: -------------------------------------------------------------------------------- 1 | {{ if .Params.tags }} 2 |
3 | {{range .Params.tags}} 4 | {{ . }} 5 | {{end}} 6 |
7 | {{end}} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/partials/toc.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ .TableOfContents }} 4 |
5 |
6 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/attachments.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 |
3 | 7 | {{if eq .Page.File.BaseFileName "index"}} 8 | {{$.Scratch.Add "filesName" "files"}} 9 | {{else}} 10 | {{$.Scratch.Add "filesName" (printf "%s.files" .Page.File.BaseFileName)}} 11 | {{end}} 12 |
13 | {{ range (readDir (printf "./content/%s%s" .Page.File.Dir ($.Scratch.Get "filesName")) ) }} 14 | {{ $fileDir := replace $.Page.File.Dir "\\" "/" }} 15 | {{if ($.Get "pattern")}} 16 | {{if (findRE ($.Get "pattern") .Name)}} 17 |
  • 18 | 19 | {{.Name}} 20 | 21 | ({{div .Size 1024 }} {{T "BinaryPrefix-kilobyte"}}) 22 |
  • 23 | {{end}} 24 | {{else}} 25 |
  • 26 | 27 | {{.Name}} 28 | 29 | ({{div .Size 1024 }} {{T "BinaryPrefix-kilobyte"}}) 30 |
  • 31 | {{end}} 32 | {{end}} 33 |
    34 | {{.Inner}} 35 |
    36 | 37 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 | 3 | {{ $icon := .Get "icon" }} 4 | {{ $iconposition := .Get "icon-position" }} 5 | {{ if ($icon) }} 6 | {{ if or (not ($iconposition)) (eq $iconposition "left") }} 7 | 8 | {{ end }} 9 | {{ end }} 10 | {{ .Inner }} 11 | {{ if and ($icon) (eq $iconposition "right")}} 12 | 13 | {{ end }} 14 | 15 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/expand.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 |
    3 |
    4 | 5 | 6 | {{$expandMessage := T "Expand-title"}} 7 | {{ if .IsNamedParams }} 8 | {{.Get "default" | default $expandMessage}} 9 | {{else}} 10 | {{.Get 0 | default $expandMessage}} 11 | {{end}} 12 | 13 |
    14 | 17 |
    -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/mermaid.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 |
    {{ safeHTML .Inner }}
    3 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 |
    {{ .Inner }}
    3 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/ref.html: -------------------------------------------------------------------------------- 1 | {{- if in (.Get 0) "/_index.md" -}} 2 | {{- $paths := (split (.Get 0) "_index.md") -}} 3 | {{- $pagepath := index $paths 0 -}} 4 | {{- $anchor := index $paths 1 -}} 5 | {{- with .Site.GetPage "section" (trim $pagepath "/") -}} 6 | {{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}} 7 | {{- end -}} 8 | {{- else -}} 9 | {{- with .Site.GetPage "section" (.Get 0) }} 10 | {{- .RelPermalink -}} 11 | {{- else -}} 12 | {{- .Get 0 | relref .Page -}} 13 | {{- end -}} 14 | {{- end -}} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/relref.html: -------------------------------------------------------------------------------- 1 | {{- if in (.Get 0) "/_index.md" -}} 2 | {{- $paths := (split (.Get 0) "_index.md") -}} 3 | {{- $pagepath := index $paths 0 -}} 4 | {{- $anchor := index $paths 1 -}} 5 | {{- with .Site.GetPage "section" (trim $pagepath "/") -}} 6 | {{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}} 7 | {{- end -}} 8 | {{- else -}} 9 | {{- with .Site.GetPage "section" (.Get 0) }} 10 | {{- .RelPermalink -}} 11 | {{- else -}} 12 | {{- .Get 0 | relref .Page -}} 13 | {{- end -}} 14 | {{- end -}} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/siteparam.html: -------------------------------------------------------------------------------- 1 | {{- $paramName := (.Get 0) -}} 2 | {{- $siteParams := .Site.Params -}} 3 | {{- with $paramName -}} 4 | {{- with $siteParams -}} 5 | {{- index . (lower $paramName) -}} 6 | {{- end -}} 7 | {{- end -}} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{ if .Parent }} 2 | {{ $name := trim (.Get "name") " " }} 3 | {{ if not (.Parent.Scratch.Get "tabs") }} 4 | {{ .Parent.Scratch.Set "tabs" slice }} 5 | {{ end }} 6 | {{ with .Inner }} 7 | {{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }} 8 | {{ end }} 9 | {{ else }} 10 | {{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}} 11 | {{ end}} 12 | 13 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/layouts/shortcodes/tabs.html: -------------------------------------------------------------------------------- 1 | {{ with .Inner }}{{/* don't do anything, just call it */}}{{ end }} 2 | {{ $groupId := default "default" (.Get "groupId") }} 3 |
    4 |
    5 | {{ range $idx, $tab := .Scratch.Get "tabs" }} 6 | 12 | {{ end }} 13 |
    14 |
    15 | {{ range $idx, $tab := .Scratch.Get "tabs" }} 16 |
    17 | {{ .content }} 18 |
    19 | {{ end }} 20 |
    21 |
    22 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "exampleSite/public" 3 | command = "hugo -s exampleSite" 4 | 5 | [build.environment] 6 | HUGO_THEME = "repo" 7 | HUGO_THEMESDIR = "/opt/build" 8 | HUGO_VERSION = "0.72.0" 9 | 10 | [context.production.environment] 11 | HUGO_BASEURL = "https://learn.netlify.app/" 12 | 13 | [context.deploy-preview] 14 | command = "hugo -s exampleSite -b $DEPLOY_PRIME_URL" 15 | 16 | [context.deploy-preview.environment] 17 | HUGO_ENABLEGITINFO = "true" 18 | 19 | [context.branch-deplpy] 20 | command = "hugo -s exampleSite -b $DEPLOY_PRIME_URL" 21 | 22 | [context.branch-deploy.environment] 23 | HUGO_ENABLEGITINFO = "true" 24 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/atom-one-dark-reasonable.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage 4 | 5 | Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax 6 | 7 | */ 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | line-height: 1.3em; 13 | color: #abb2bf; 14 | background: #282c34; 15 | border-radius: 5px; 16 | } 17 | .hljs-keyword, .hljs-operator { 18 | color: #F92672; 19 | } 20 | .hljs-pattern-match { 21 | color: #F92672; 22 | } 23 | .hljs-pattern-match .hljs-constructor { 24 | color: #61aeee; 25 | } 26 | .hljs-function { 27 | color: #61aeee; 28 | } 29 | .hljs-function .hljs-params { 30 | color: #A6E22E; 31 | } 32 | .hljs-function .hljs-params .hljs-typing { 33 | color: #FD971F; 34 | } 35 | .hljs-module-access .hljs-module { 36 | color: #7e57c2; 37 | } 38 | .hljs-constructor { 39 | color: #e2b93d; 40 | } 41 | .hljs-constructor .hljs-string { 42 | color: #9CCC65; 43 | } 44 | .hljs-comment, .hljs-quote { 45 | color: #b18eb1; 46 | font-style: italic; 47 | } 48 | .hljs-doctag, .hljs-formula { 49 | color: #c678dd; 50 | } 51 | .hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { 52 | color: #e06c75; 53 | } 54 | .hljs-literal { 55 | color: #56b6c2; 56 | } 57 | .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { 58 | color: #98c379; 59 | } 60 | .hljs-built_in, .hljs-class .hljs-title { 61 | color: #e6c07b; 62 | } 63 | .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { 64 | color: #d19a66; 65 | } 66 | .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { 67 | color: #61aeee; 68 | } 69 | .hljs-emphasis { 70 | font-style: italic; 71 | } 72 | .hljs-strong { 73 | font-weight: bold; 74 | } 75 | .hljs-link { 76 | text-decoration: underline; 77 | } 78 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/auto-complete.css: -------------------------------------------------------------------------------- 1 | .autocomplete-suggestions { 2 | text-align: left; 3 | cursor: default; 4 | border: 1px solid #ccc; 5 | border-top: 0; 6 | background: #fff; 7 | box-shadow: -1px 1px 3px rgba(0,0,0,.1); 8 | 9 | /* core styles should not be changed */ 10 | position: absolute; 11 | display: none; 12 | z-index: 9999; 13 | max-height: 254px; 14 | overflow: hidden; 15 | overflow-y: auto; 16 | box-sizing: border-box; 17 | 18 | } 19 | .autocomplete-suggestion { 20 | position: relative; 21 | cursor: pointer; 22 | padding: 7px; 23 | line-height: 23px; 24 | white-space: nowrap; 25 | overflow: hidden; 26 | text-overflow: ellipsis; 27 | color: #333; 28 | } 29 | 30 | .autocomplete-suggestion b { 31 | font-weight: normal; 32 | color: #1f8dd6; 33 | } 34 | 35 | .autocomplete-suggestion.selected { 36 | background: #333; 37 | color: #fff; 38 | } 39 | 40 | .autocomplete-suggestion:hover { 41 | background: #444; 42 | color: #fff; 43 | } 44 | 45 | .autocomplete-suggestion > .context { 46 | font-size: 12px; 47 | } 48 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/featherlight.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Featherlight - ultra slim jQuery lightbox 3 | * Version 1.7.13 - http://noelboss.github.io/featherlight/ 4 | * 5 | * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com) 6 | * MIT Licensed. 7 | **/ 8 | html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}} -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/hybrid.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) 4 | 5 | */ 6 | 7 | /*background color*/ 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | background: #1d1f21; 13 | } 14 | 15 | /*selection color*/ 16 | .hljs::selection, 17 | .hljs span::selection { 18 | background: #373b41; 19 | } 20 | 21 | .hljs::-moz-selection, 22 | .hljs span::-moz-selection { 23 | background: #373b41; 24 | } 25 | 26 | /*foreground color*/ 27 | .hljs { 28 | color: #c5c8c6; 29 | } 30 | 31 | /*color: fg_yellow*/ 32 | .hljs-title, 33 | .hljs-name { 34 | color: #f0c674; 35 | } 36 | 37 | /*color: fg_comment*/ 38 | .hljs-comment, 39 | .hljs-meta, 40 | .hljs-meta .hljs-keyword { 41 | color: #707880; 42 | } 43 | 44 | /*color: fg_red*/ 45 | .hljs-number, 46 | .hljs-symbol, 47 | .hljs-literal, 48 | .hljs-deletion, 49 | .hljs-link { 50 | color: #cc6666 51 | } 52 | 53 | /*color: fg_green*/ 54 | .hljs-string, 55 | .hljs-doctag, 56 | .hljs-addition, 57 | .hljs-regexp, 58 | .hljs-selector-attr, 59 | .hljs-selector-pseudo { 60 | color: #b5bd68; 61 | } 62 | 63 | /*color: fg_purple*/ 64 | .hljs-attribute, 65 | .hljs-code, 66 | .hljs-selector-id { 67 | color: #b294bb; 68 | } 69 | 70 | /*color: fg_blue*/ 71 | .hljs-keyword, 72 | .hljs-selector-tag, 73 | .hljs-bullet, 74 | .hljs-tag { 75 | color: #81a2be; 76 | } 77 | 78 | /*color: fg_aqua*/ 79 | .hljs-subst, 80 | .hljs-variable, 81 | .hljs-template-tag, 82 | .hljs-template-variable { 83 | color: #8abeb7; 84 | } 85 | 86 | /*color: fg_orange*/ 87 | .hljs-type, 88 | .hljs-built_in, 89 | .hljs-builtin-name, 90 | .hljs-quote, 91 | .hljs-section, 92 | .hljs-selector-class { 93 | color: #de935f; 94 | } 95 | 96 | .hljs-emphasis { 97 | font-style: italic; 98 | } 99 | 100 | .hljs-strong { 101 | font-weight: bold; 102 | } 103 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/tabs.css: -------------------------------------------------------------------------------- 1 | #body .tab-nav-button { 2 | border-width: 1px 1px 1px 1px !important; 3 | border-color: #ccc !important; 4 | border-radius: 4px 4px 0 0 !important; 5 | background-color: #ddd !important; 6 | float: left; 7 | display: block; 8 | position: relative; 9 | margin-left: 4px; 10 | bottom: -1px; 11 | } 12 | #body .tab-nav-button:first-child { 13 | margin-left: 0px; 14 | } 15 | #body .tab-nav-button.active { 16 | background-color: #fff !important; 17 | border-bottom-color: #fff !important; 18 | } 19 | 20 | #body .tab-panel { 21 | margin-top: 32px; 22 | margin-bottom: 32px; 23 | } 24 | #body .tab-content { 25 | display: block; 26 | clear: both; 27 | padding: 8px; 28 | border-width: 1px; 29 | border-style: solid; 30 | border-color: #ccc; 31 | } 32 | #body .tab-content .tab-item{ 33 | display: none; 34 | } 35 | 36 | #body .tab-content .tab-item.active{ 37 | display: block; 38 | } 39 | 40 | #body .tab-item pre{ 41 | margin-bottom: 0; 42 | margin-top: 0; 43 | } 44 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/css/tags.css: -------------------------------------------------------------------------------- 1 | /* Tags */ 2 | 3 | #head-tags{ 4 | margin-left:1em; 5 | margin-top:1em; 6 | } 7 | 8 | #body .tags a.tag-link { 9 | display: inline-block; 10 | line-height: 2em; 11 | font-size: 0.8em; 12 | position: relative; 13 | margin: 0 16px 8px 0; 14 | padding: 0 10px 0 12px; 15 | background: #8451a1; 16 | 17 | -webkit-border-bottom-right-radius: 3px; 18 | border-bottom-right-radius: 3px; 19 | -webkit-border-top-right-radius: 3px; 20 | border-top-right-radius: 3px; 21 | 22 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2); 23 | box-shadow: 0 1px 2px rgba(0,0,0,0.2); 24 | color: #fff; 25 | } 26 | 27 | #body .tags a.tag-link:before { 28 | content: ""; 29 | position: absolute; 30 | top:0; 31 | left: -1em; 32 | width: 0; 33 | height: 0; 34 | border-color: transparent #8451a1 transparent transparent; 35 | border-style: solid; 36 | border-width: 1em 1em 1em 0; 37 | } 38 | 39 | #body .tags a.tag-link:after { 40 | content: ""; 41 | position: absolute; 42 | top: 10px; 43 | left: 1px; 44 | width: 5px; 45 | height: 5px; 46 | -webkit-border-radius: 50%; 47 | border-radius: 100%; 48 | background: #fff; 49 | } 50 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Inconsolata.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_200.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_300.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/fonts/Work_Sans_500.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/images/clippy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/images/favicon.png -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/images/gopher-404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/images/gopher-404.jpg -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/documentation/site/themes/hugo-theme-learn/static/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/spf13/hugoThemes#themetoml for an example 3 | 4 | name = "Learn" 5 | license = "MIT" 6 | licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md" 7 | description = "Documentation theme for Hugo, based on Grav Learn theme" 8 | homepage = "https://github.com/matcornic/hugo-theme-learn/" 9 | repo = "https://github.com/matcornic/hugo-theme-learn" 10 | tags = ["documentation", "grav", "learn", "doc", "search"] 11 | features = ["documentation", "menu", "nested sections", "search", "mermaid"] 12 | min_version = 0.25 13 | 14 | [author] 15 | name = "Mathieu Cornic" 16 | homepage = "https://matcornic.github.io/" 17 | 18 | [original] 19 | name = "Grav Learn" 20 | homepage = "https://learn.getgrav.org/" 21 | repo = "https://github.com/getgrav/grav-learn" 22 | -------------------------------------------------------------------------------- /documentation/site/themes/hugo-theme-learn/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | build: 3 | steps: 4 | # Gets the dependencies 5 | - script: 6 | name: get hugo 7 | code: | 8 | git clone https://github.com/gohugoio/hugo.git && cd hugo && go install 9 | # Sets the go workspace and places you package 10 | # at the right place in the workspace tree 11 | - setup-go-workspace 12 | # Build the project 13 | - script: 14 | name: build site 15 | code: | 16 | cd exampleSite && hugo -------------------------------------------------------------------------------- /imagetool/src/main/bin/imagetool.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | @rem ************************************************************************** 3 | @rem imagetool.cmd 4 | @rem 5 | @rem Copyright (c) 2019, 2021, Oracle and/or its affiliates. 6 | @rem Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 7 | 8 | IF "%JAVA_HOME%" == "" ( 9 | ECHO Please set the JAVA_HOME environment variable to match the location of your Java installation. Java 8 or newer is required. 10 | EXIT /B 2 11 | ) 12 | FOR %%i IN ("%JAVA_HOME%") DO SET JAVA_HOME=%%~fsi 13 | IF %JAVA_HOME:~-1%==\ SET JAVA_HOME=%JAVA_HOME:~0,-1% 14 | IF EXIST %JAVA_HOME%\bin\java.exe ( 15 | FOR %%i IN ("%JAVA_HOME%\bin\java.exe") DO SET JAVA_EXE=%%~fsi 16 | ) ELSE ( 17 | ECHO Java executable does not exist at %JAVA_HOME%\bin\java.exe does not exist >&2 18 | EXIT /B 2 19 | ) 20 | SET "IMAGETOOL_HOME=%~dp0%/.." 21 | "%JAVA_HOME%\bin\java" -cp "%IMAGETOOL_HOME%\lib\*" "-Djava.util.logging.config.file=%IMAGETOOL_HOME%\bin\logging.properties" com.oracle.weblogic.imagetool.cli.ImageTool %* 22 | -------------------------------------------------------------------------------- /imagetool/src/main/bin/imagetool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #Copyright (c) 2019, 2021, Oracle and/or its affiliates. 4 | # 5 | #Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 6 | # 7 | # imagetool.sh 8 | 9 | set -e 10 | 11 | # 12 | # Make sure that the JAVA_HOME environment variable is set to point to a 13 | # JDK 8 or higher JVM (and that it isn't OpenJDK). 14 | # 15 | if [ -z "${JAVA_HOME}" ]; then 16 | echo "Please set the JAVA_HOME environment variable to match the location of your Java installation. Java 8 or newer is required." >&2 17 | exit 1 18 | elif [ ! -d "${JAVA_HOME}" ]; then 19 | echo "Your JAVA_HOME environment variable points to a non-existent directory: ${JAVA_HOME}" >&2 20 | exit 1 21 | fi 22 | 23 | if [ -x "${JAVA_HOME}/bin/java" ]; then 24 | JAVA_EXE=${JAVA_HOME}/bin/java 25 | else 26 | echo "Java executable at ${JAVA_HOME}/bin/java either does not exist or is not executable" >&2 27 | exit 1 28 | fi 29 | 30 | script_dir=$(dirname "${BASH_SOURCE[0]}") 31 | IMAGETOOL_HOME=$(cd "${script_dir}/.." ; pwd) 32 | export IMAGETOOL_HOME 33 | "${JAVA_EXE}" -cp "${IMAGETOOL_HOME}/lib/*" -Djava.util.logging.config.file="${IMAGETOOL_HOME}/bin/logging.properties" com.oracle.weblogic.imagetool.cli.ImageTool "$@" 34 | 35 | -------------------------------------------------------------------------------- /imagetool/src/main/bin/logging.properties: -------------------------------------------------------------------------------- 1 | # 2 | # This is a standard java util logging.properties, documentation can be found in 3 | # https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html#a1.8 4 | # 5 | 6 | # 7 | # Default handler is console only, to enable file logging, switch out the comments below or customize your own 8 | # 9 | handlers=java.util.logging.ConsoleHandler 10 | #handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler 11 | 12 | # 13 | # Default level for everything is INFO, you can override the level in each logger or raise the default level for all 14 | # loggers. Note: if you set .LEVEL=ALL, it will enable everything from every loggers used by the tool including other 15 | # any packages used by the tool. 16 | # 17 | 18 | com.oracle.weblogic.imagetool.level=INFO 19 | #com.oracle.weblogic.imagetool.level=FINER 20 | 21 | # 22 | # Change log file location and handlers logging level as needed. Note the default level for FileHandler is OFF 23 | # and ConsoleHandler is INFO 24 | # 25 | java.util.logging.FileHandler.pattern=imagetool.log 26 | java.util.logging.FileHandler.count=1 27 | java.util.logging.FileHandler.level=FINEST 28 | java.util.logging.ConsoleHandler.level=INFO 29 | #java.util.logging.ConsoleHandler.color=false 30 | 31 | -------------------------------------------------------------------------------- /imagetool/src/main/bin/setup.sh: -------------------------------------------------------------------------------- 1 | # 2 | #Copyright (c) 2019, 2021, Oracle and/or its affiliates. 3 | # 4 | #Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | # 6 | # source setup.sh 7 | umask 27 8 | # 9 | # Make sure that the JAVA_HOME environment variable is set to point to a 10 | # JDK 8 or higher JVM (and that it isn't OpenJDK). 11 | # 12 | if [ -z "${JAVA_HOME}" ]; then 13 | echo "Please set the JAVA_HOME environment variable to match the location of your Java installation. Java 8 or newer is required." >&2 14 | return 15 | elif [ ! -d "${JAVA_HOME}" ]; then 16 | echo "Your JAVA_HOME environment variable points to a non-existent directory: ${JAVA_HOME}" >&2 17 | return 18 | fi 19 | 20 | if [ -x "${JAVA_HOME}/bin/java" ]; then 21 | JAVA_EXE=${JAVA_HOME}/bin/java 22 | else 23 | echo "Java executable at ${JAVA_HOME}/bin/java either does not exist or is not executable" >&2 24 | return 25 | fi 26 | 27 | unalias imagetool 2> /dev/null 28 | script_dir=$(dirname "${BASH_SOURCE[0]}") 29 | IMAGETOOL_HOME=$(cd "${script_dir}/.." ; pwd) 30 | export IMAGETOOL_HOME 31 | alias imagetool="\"${JAVA_EXE}\" -cp \"${IMAGETOOL_HOME}/lib/*\" -Djava.util.logging.config.file=\"${IMAGETOOL_HOME}/bin/logging.properties\" com.oracle.weblogic.imagetool.cli.ImageTool" 32 | source "${IMAGETOOL_HOME}"/lib/imagetool_completion.sh 33 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | public class AruException extends Exception { 7 | public AruException() { 8 | super(); 9 | } 10 | 11 | public AruException(String message) { 12 | super(message); 13 | } 14 | 15 | public AruException(String message, Throwable thrown) { 16 | super(message, thrown); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/InvalidCredentialException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | import com.oracle.weblogic.imagetool.util.Utils; 7 | 8 | public class InvalidCredentialException extends AruException { 9 | public InvalidCredentialException() { 10 | super(Utils.getMessage("IMG-0022")); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/InvalidPatchNumberException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | public class InvalidPatchNumberException extends AruException { 7 | /** 8 | * Specified patch number is invalid for this use case. 9 | * 10 | * @param msg error message 11 | */ 12 | public InvalidPatchNumberException(String msg) { 13 | super(msg); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/NoPatchesFoundException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | public class NoPatchesFoundException extends AruException { 7 | public NoPatchesFoundException(String msg) { 8 | super(msg); 9 | } 10 | 11 | public NoPatchesFoundException(String msg, Throwable throwable) { 12 | super(msg, throwable); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/PatchConflictException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | import java.util.List; 7 | 8 | import com.oracle.weblogic.imagetool.util.Utils; 9 | 10 | public class PatchConflictException extends AruException { 11 | public PatchConflictException(List> conflictSets) { 12 | super(createMessage(conflictSets)); 13 | } 14 | 15 | private static String createMessage(List> conflictSets) { 16 | StringBuilder result = new StringBuilder(); 17 | result.append(Utils.getMessage("IMG-0116")); 18 | result.append(" "); 19 | int numberOfSets = conflictSets.size(); 20 | for (int i = 0; i < numberOfSets; i++) { 21 | result.append(conflictSets.get(i)); 22 | if (i + 1 < numberOfSets) { 23 | result.append(", "); 24 | } 25 | } 26 | return result.toString(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/PatchVersionException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | import java.io.IOException; 7 | import java.util.List; 8 | import java.util.stream.Collectors; 9 | 10 | import com.oracle.weblogic.imagetool.util.Utils; 11 | 12 | public class PatchVersionException extends IOException { 13 | 14 | /** 15 | * Signals that the bug number provided was unavailable for the requested or derived version. 16 | * 17 | * @param bugNumber the bug number that was searched 18 | * @param versionsAvailable the list of versions for patches of that bug 19 | */ 20 | public PatchVersionException(String bugNumber, List versionsAvailable) { 21 | super(Utils.getMessage("IMG-0034", bugNumber, 22 | versionsAvailable.stream() 23 | .map(s -> bugNumber + "_" + s.version()) 24 | .collect(Collectors.joining(", "))) 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/RetryFailedException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | public class RetryFailedException extends Exception { 7 | } 8 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/VersionNotFoundException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | import com.oracle.weblogic.imagetool.util.Utils; 10 | 11 | /** 12 | * For a given list of patches returned from ARU, the version requested was not found. 13 | */ 14 | public class VersionNotFoundException extends AruException { 15 | /** 16 | * For a given list of patches returned from ARU, the version requested was not found. 17 | * @param patchId patch ID that was used to search 18 | * @param version the version that was requested 19 | * @param patches the patches that ARU returned 20 | */ 21 | public VersionNotFoundException(String patchId, String version, List patches) { 22 | super(Utils.getMessage("IMG-0083", version, patchId, 23 | patches.stream() 24 | .map(s -> s.patchId() + "_" + s.version()) 25 | .collect(Collectors.joining(", ")))); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cachestore/CacheStore.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cachestore; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * This is the interface that helps keep track of application metadata like 11 | * which patches have been downloaded and their location on disk. 12 | */ 13 | public interface CacheStore { 14 | 15 | String CACHE_KEY_SEPARATOR = "_"; 16 | 17 | /** 18 | * Cache dir used by this application. cache dir is where the application downloads 19 | * artifacts to. 20 | * 21 | * @return cache dir location on disk 22 | */ 23 | String getCacheDir(); 24 | 25 | /** 26 | * Returns the value if key is present. Since the application tracks downloaded artifact location, 27 | * key is usually patch number or artifact identifier. Value is location on disk. 28 | * 29 | * @param key key to look for. Ex: patch number 30 | * @return value if present in cache or else null. 31 | */ 32 | String getValueFromCache(String key); 33 | 34 | /** 35 | * Checks if cache contains the specified key. 36 | * 37 | * @param key artifact identifier 38 | * @return true if found 39 | */ 40 | boolean containsKey(String key); 41 | 42 | /** 43 | * Add an entry to the cache metadata file. 44 | * 45 | * @param key artifact identifier 46 | * @param value a file path 47 | */ 48 | void addToCache(String key, String value) throws CacheStoreException; 49 | 50 | /** 51 | * Delete an entry from the cache. 52 | * 53 | * @param key key corresponding to an entry in the cache 54 | * @return value or null 55 | */ 56 | String deleteFromCache(String key) throws CacheStoreException; 57 | 58 | /** 59 | * Delete all entries from the cache. 60 | */ 61 | void clearCache() throws CacheStoreException; 62 | 63 | /** 64 | * Returns a map of current items in the cache. 65 | * 66 | * @return map of current items 67 | */ 68 | Map getCacheItems(); 69 | 70 | List getKeysForType(String type); 71 | } 72 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cachestore/CacheStoreException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cachestore; 5 | 6 | import java.io.IOException; 7 | 8 | public class CacheStoreException extends IOException { 9 | 10 | public CacheStoreException(String msg, Throwable cause) { 11 | super(msg, cause); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cachestore/CacheStoreFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cachestore; 5 | 6 | /** 7 | * Provides access to a Cache Store. 8 | */ 9 | public class CacheStoreFactory { 10 | 11 | private static CacheStore store; 12 | 13 | private CacheStoreFactory() { 14 | // hidden constructor 15 | } 16 | 17 | /** 18 | * Get the cache store. 19 | * @return the cached instance of the file cache store 20 | */ 21 | public static CacheStore cache() throws CacheStoreException { 22 | if (store == null) { 23 | store = new FileCacheStore(); 24 | } 25 | 26 | return store; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/HelpVersionProvider.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli; 5 | 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.util.Properties; 9 | 10 | import picocli.CommandLine.IVersionProvider; 11 | 12 | public class HelpVersionProvider implements IVersionProvider { 13 | 14 | private static final Properties projectProps = new Properties(); 15 | 16 | /** 17 | * Get the project name and version declared in the POM. 18 | * @return project name and version number 19 | * @throws IOException if loading version properties fails. 20 | */ 21 | public static Properties projectProperties() throws IOException { 22 | if (projectProps.isEmpty()) { 23 | try (InputStream versionInfoStream = 24 | HelpVersionProvider.class.getResourceAsStream("/version-info.properties")) { 25 | if (versionInfoStream != null) { 26 | projectProps.load(versionInfoStream); 27 | } 28 | } 29 | } 30 | return projectProps; 31 | } 32 | 33 | public static String versionString() throws IOException { 34 | return "WebLogic Image Tool version " + projectProperties().getProperty("project_version"); 35 | } 36 | 37 | @Override 38 | public String[] getVersion() throws Exception { 39 | Properties p = projectProperties(); 40 | String[] result = new String[1]; 41 | result[0] = p.getProperty("project_name") + ":" + p.getProperty("project_version"); 42 | return result; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddEntry.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import com.oracle.weblogic.imagetool.api.model.CommandResponse; 7 | import com.oracle.weblogic.imagetool.cachestore.CacheStoreException; 8 | import com.oracle.weblogic.imagetool.util.Utils; 9 | import picocli.CommandLine.Command; 10 | import picocli.CommandLine.Option; 11 | 12 | import static com.oracle.weblogic.imagetool.cachestore.CacheStoreFactory.cache; 13 | 14 | @Command( 15 | name = "addEntry", 16 | description = "Command to add a cache entry. Use caution" 17 | ) 18 | public class AddEntry extends CacheOperation { 19 | 20 | @Override 21 | public CommandResponse call() throws CacheStoreException { 22 | if (!Utils.isEmptyString(key) && !Utils.isEmptyString(location)) { 23 | String oldValue = cache().getValueFromCache(key); 24 | String msg; 25 | if (oldValue != null) { 26 | msg = String.format("Replaced old value %s with new value %s for key %s", oldValue, location, key); 27 | } else { 28 | msg = String.format("Added entry %s=%s", key, location); 29 | } 30 | cache().addToCache(key, location); 31 | return CommandResponse.success(msg); 32 | } 33 | return CommandResponse.error("IMG-0044"); 34 | } 35 | 36 | @Option( 37 | names = {"--key"}, 38 | description = "Key for the cache entry", 39 | required = true 40 | ) 41 | private String key; 42 | 43 | @Option( 44 | names = {"--value"}, 45 | description = "Value for the cache entry", 46 | required = true 47 | ) 48 | private String location; 49 | } 50 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddPatchEntry.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import java.util.Collections; 7 | 8 | import com.oracle.weblogic.imagetool.api.model.CommandResponse; 9 | import com.oracle.weblogic.imagetool.util.Utils; 10 | import picocli.CommandLine.Command; 11 | import picocli.CommandLine.Option; 12 | 13 | @Command( 14 | name = "addPatch", 15 | description = "Add cache entry for wls|fmw patch or psu", 16 | sortOptions = false 17 | ) 18 | public class AddPatchEntry extends CacheAddOperation { 19 | 20 | public String getKey() { 21 | return patchId; 22 | } 23 | 24 | @Override 25 | public CommandResponse call() throws Exception { 26 | try { 27 | if (patchId != null && !patchId.isEmpty()) { 28 | Utils.validatePatchIds(Collections.singletonList(patchId), false); 29 | return addToCache(); 30 | } else { 31 | return CommandResponse.error("IMG-0076", "--patchId"); 32 | } 33 | } catch (Exception ex) { 34 | return CommandResponse.error(ex.getMessage()); 35 | } 36 | } 37 | 38 | @Option( 39 | names = {"--patchId"}, 40 | description = "Patch number. Ex: 28186730", 41 | required = true 42 | ) 43 | private String patchId; 44 | } 45 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheCLI.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import com.oracle.weblogic.imagetool.cli.HelpVersionProvider; 7 | import picocli.CommandLine.Command; 8 | 9 | @Command( 10 | name = "cache", 11 | description = "List and set cache options", 12 | versionProvider = HelpVersionProvider.class, 13 | commandListHeading = "%nCommands:%n%n", 14 | subcommands = { 15 | ListCacheItems.class, 16 | AddInstallerEntry.class, 17 | AddPatchEntry.class, 18 | AddEntry.class, 19 | DeleteEntry.class 20 | }, 21 | sortOptions = false 22 | ) 23 | public class CacheCLI { 24 | } 25 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheOperation.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import java.util.concurrent.Callable; 7 | 8 | import com.oracle.weblogic.imagetool.api.model.CommandResponse; 9 | import picocli.CommandLine.Model.CommandSpec; 10 | import picocli.CommandLine.Spec; 11 | 12 | public abstract class CacheOperation implements Callable { 13 | @Spec 14 | CommandSpec spec; 15 | } 16 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/DeleteEntry.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import com.oracle.weblogic.imagetool.api.model.CommandResponse; 7 | import com.oracle.weblogic.imagetool.util.Constants; 8 | import com.oracle.weblogic.imagetool.util.Utils; 9 | import picocli.CommandLine.Command; 10 | import picocli.CommandLine.Option; 11 | 12 | import static com.oracle.weblogic.imagetool.cachestore.CacheStoreFactory.cache; 13 | 14 | @Command( 15 | name = "deleteEntry", 16 | description = "Command to delete a cache entry" 17 | ) 18 | public class DeleteEntry extends CacheOperation { 19 | 20 | @Override 21 | public CommandResponse call() throws Exception { 22 | if (!Utils.isEmptyString(key)) { 23 | if (Constants.DELETE_ALL_FOR_SURE.equalsIgnoreCase(key)) { 24 | cache().clearCache(); 25 | return CommandResponse.success("IMG-0046"); 26 | } else { 27 | String oldValue = cache().deleteFromCache(key); 28 | if (oldValue != null) { 29 | return CommandResponse.success("IMG-0051", key, oldValue); 30 | } else { 31 | return CommandResponse.success("IMG-0052", key); 32 | } 33 | } 34 | } 35 | return CommandResponse.error("IMG-0045"); 36 | } 37 | 38 | @Option( 39 | names = {"--key"}, 40 | description = "Key corresponding to the cache entry to delete", 41 | required = true 42 | ) 43 | private String key; 44 | } 45 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/ListCacheItems.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.cache; 5 | 6 | import java.util.Map; 7 | import java.util.regex.Pattern; 8 | 9 | import com.oracle.weblogic.imagetool.api.model.CommandResponse; 10 | import com.oracle.weblogic.imagetool.cachestore.CacheStoreException; 11 | import picocli.CommandLine.Command; 12 | import picocli.CommandLine.Option; 13 | 14 | import static com.oracle.weblogic.imagetool.cachestore.CacheStoreFactory.cache; 15 | 16 | @Command( 17 | name = "listItems", 18 | description = "List cache contents" 19 | ) 20 | public class ListCacheItems extends CacheOperation { 21 | 22 | @Override 23 | public CommandResponse call() throws CacheStoreException { 24 | Map resultMap = cache().getCacheItems(); 25 | if (resultMap == null || resultMap.isEmpty()) { 26 | return CommandResponse.success("IMG-0047"); 27 | } else { 28 | System.out.println("Cache contents"); 29 | 30 | Pattern pattern = Pattern.compile(key == null ? ".*" : key); 31 | resultMap.entrySet().stream() 32 | .filter(entry -> pattern.matcher(entry.getKey()).matches()) 33 | .forEach(System.out::println); 34 | 35 | return CommandResponse.success(null); 36 | } 37 | } 38 | 39 | @Option( 40 | names = {"--key"}, 41 | description = "list only cached items where the key matches this regex" 42 | ) 43 | private String key; 44 | } 45 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/KubernetesTarget.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.menu; 5 | 6 | public enum KubernetesTarget { 7 | DEFAULT("Default"), 8 | OPENSHIFT("OpenShift"); 9 | 10 | private String value; 11 | 12 | /** 13 | * Create an Enum value for the installer type. 14 | * @param value value is the first part of the key for the installer in the cache, and the filename of the 15 | * response file 16 | */ 17 | KubernetesTarget(String value) { 18 | this.value = value; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/OutputFormat.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.menu; 5 | 6 | public enum OutputFormat { 7 | JSON 8 | } 9 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/PackageManagerType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.menu; 5 | 6 | public enum PackageManagerType { 7 | OS_DEFAULT, 8 | NONE, 9 | YUM, 10 | DNF, 11 | MICRODNF, 12 | MICRODNF_8, 13 | APTGET, 14 | APK, 15 | ZYPPER 16 | } 17 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/inspect/InventoryPatch.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.inspect; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public class InventoryPatch { 12 | private String bug; 13 | private String uid; 14 | private String description; 15 | 16 | public String bug() { 17 | return bug; 18 | } 19 | 20 | public String uid() { 21 | return uid; 22 | } 23 | 24 | public String description() { 25 | return description; 26 | } 27 | 28 | /** 29 | * Parse the provided string into patch objects, and return the list of patches. 30 | * The fields should be separated by a semicolon with three fields per patch. 31 | * @param patchesString patch data from the inspected image 32 | * @return a list of patch objects 33 | */ 34 | public static List parseInventoryPatches(String patchesString) { 35 | List patches = new ArrayList<>(); 36 | // Pattern defines a tuple of three elements: patch ID, patch UID, and patch description. 37 | Pattern tuplePattern = Pattern.compile("(\\d+);(\\d+);\\\"(.*?)\\\";?"); 38 | Matcher patchMatcher = tuplePattern.matcher(patchesString); 39 | while (patchMatcher.find()) { 40 | InventoryPatch patch = new InventoryPatch(); 41 | patch.bug = patchMatcher.group(1); 42 | patch.uid = patchMatcher.group(2); 43 | patch.description = patchMatcher.group(3); 44 | patches.add(patch); 45 | } 46 | 47 | return patches; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/inspect/OperatingSystemProperties.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.inspect; 5 | 6 | import java.util.Properties; 7 | 8 | import com.oracle.weblogic.imagetool.util.Utils; 9 | 10 | public class OperatingSystemProperties { 11 | private String id; 12 | private String version; 13 | private String name; 14 | private String releasePackage; 15 | private String architecture; 16 | 17 | public String id() { 18 | return id; 19 | } 20 | 21 | public String version() { 22 | return version; 23 | } 24 | 25 | public String name() { 26 | return name; 27 | } 28 | 29 | public String releasePackage() { 30 | return releasePackage; 31 | } 32 | 33 | public String architecture() { 34 | return architecture; 35 | } 36 | 37 | /** 38 | * Using the properties obtained from the image, extract the OS properties prefixed with __OS__. 39 | * @param imageProperties properties returned from the image inspection 40 | * @return the OS property values as an object 41 | */ 42 | public static OperatingSystemProperties getOperatingSystemProperties(Properties imageProperties) { 43 | OperatingSystemProperties result = new OperatingSystemProperties(); 44 | result.id = removeQuotes(imageProperties.getProperty("__OS__ID")); 45 | result.version = removeQuotes(imageProperties.getProperty("__OS__VERSION")); 46 | if (result.version == null) { 47 | result.version = removeQuotes(imageProperties.getProperty("__OS__VERSION_ID")); 48 | } 49 | result.name = removeQuotes(imageProperties.getProperty("__OS__NAME")); 50 | result.releasePackage = removeQuotes(imageProperties.getProperty("__OS__RELEASE_PACKAGE")); 51 | result.architecture = imageProperties.getProperty("__OS__arch"); 52 | return result; 53 | } 54 | 55 | private static String removeQuotes(String value) { 56 | if (Utils.isEmptyString(value)) { 57 | return value; 58 | } 59 | return value.replace("\"", ""); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/InstallerType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2023, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.installer; 5 | 6 | /** 7 | * Supported installer types in the local cache. 8 | * Provides list of types to the CLI for the addInstaller type flag. 9 | */ 10 | public enum InstallerType { 11 | 12 | WLSDEV("wlsdev"), 13 | WLSSLIM("wlsslim"), 14 | WLS("wls"), 15 | FMW("fmw"), 16 | SOA("soa"), 17 | OSB("osb"), 18 | B2B("b2b"), 19 | MFT("mft"), 20 | IDM("idm"), 21 | OAM("oam"), 22 | OHS("ohs"), 23 | DB19("db19"), 24 | OUD("oud"), 25 | OID("oid"), 26 | WCC("wcc"), 27 | WCP("wcp"), 28 | WCS("wcs"), 29 | JDK("jdk"), 30 | WDT("wdt"), 31 | ODI("odi"); 32 | 33 | private final String value; 34 | 35 | /** 36 | * Create an Enum value for the installer type. 37 | * @param value value is the first part of the key for the installer in the cache, and the filename of the 38 | * response file 39 | */ 40 | InstallerType(String value) { 41 | this.value = value; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return value; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/MiddlewareInstallPackage.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.installer; 5 | 6 | import java.util.List; 7 | 8 | import com.oracle.weblogic.imagetool.api.model.CachedFile; 9 | 10 | public class MiddlewareInstallPackage { 11 | InstallerType type; 12 | ResponseFile responseFile; 13 | CachedFile installer; 14 | String installerFilename; 15 | String jarName; 16 | List preinstallCommands; 17 | boolean isZip = true; 18 | boolean isBin = false; 19 | } 20 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/ProvidedResponseFile.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.installer; 5 | 6 | import java.io.IOException; 7 | import java.nio.file.Files; 8 | import java.nio.file.Path; 9 | import java.nio.file.Paths; 10 | 11 | import com.oracle.weblogic.imagetool.logging.LoggingFacade; 12 | import com.oracle.weblogic.imagetool.logging.LoggingFactory; 13 | 14 | public class ProvidedResponseFile implements ResponseFile { 15 | 16 | private static final LoggingFacade logger = LoggingFactory.getLogger(ProvidedResponseFile.class); 17 | 18 | private Path responseFileSource; 19 | private String filename = null; 20 | 21 | /** 22 | * Use one of the default response files provided in the tool. 23 | * @param source the resource path to the response file in this tool 24 | */ 25 | public ProvidedResponseFile(Path source) { 26 | responseFileSource = source; 27 | if (responseFileSource != null && Files.isRegularFile(responseFileSource)) { 28 | filename = responseFileSource.getFileName().toString(); 29 | } 30 | } 31 | 32 | @Override 33 | public String name() { 34 | return filename; 35 | } 36 | 37 | @Override 38 | public void copyFile(String buildContextDir) throws IOException { 39 | if (name() != null) { 40 | logger.fine("IMG-0005", responseFileSource); 41 | Path target = Paths.get(buildContextDir, name()); 42 | if (Files.exists(target)) { 43 | int idx = 1; 44 | String trialName = filename + idx; 45 | target = Paths.get(buildContextDir, trialName); 46 | while (Files.exists(target)) { 47 | trialName = filename + ++idx; 48 | target = Paths.get(buildContextDir, trialName); 49 | } 50 | logger.fine("copying installer response file {0} as {1}", filename, trialName); 51 | filename = trialName; 52 | } 53 | Files.copy(responseFileSource, target); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/ResponseFile.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.installer; 5 | 6 | import java.io.IOException; 7 | 8 | public interface ResponseFile { 9 | void copyFile(String buildContextDir) throws IOException; 10 | 11 | String name(); 12 | } 13 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/LoggingFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.logging; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.logging.Logger; 9 | 10 | public class LoggingFactory { 11 | // map from resourceBundleName to facade 12 | private static final Map facade = new HashMap<>(); 13 | 14 | private LoggingFactory() { 15 | // hide implicit public constructor 16 | } 17 | 18 | /** 19 | * Obtains a Logger from the underlying logging implementation and wraps it in a LoggingFacade. 20 | * Infers caller class and bundle name. 21 | * 22 | * @param clazz use class name as logger name 23 | * @return a PlatformLogger object for the caller to use 24 | */ 25 | public static LoggingFacade getLogger(Class clazz) { 26 | return getLogger(clazz.getName(), "ImageTool"); 27 | } 28 | 29 | /** 30 | * Obtains a Logger from the underlying logging implementation and wraps it in a LoggingFacade. 31 | * Infers caller class and bundle name. 32 | * 33 | * @param name logger name 34 | * @return a PlatformLogger object for the caller to use 35 | */ 36 | public static LoggingFacade getLogger(String name) { 37 | return getLogger(name, "ImageTool"); 38 | } 39 | 40 | /** 41 | * Obtains a Logger from the underlying logging implementation and wraps it in a LoggingFacade. 42 | * 43 | * @param name the name of the logger to use 44 | * @param resourceBundleName the resource bundle to use with this logger 45 | * @return a PlatformLogger object for the caller to use 46 | */ 47 | public static synchronized LoggingFacade getLogger(String name, String resourceBundleName) { 48 | 49 | return facade.computeIfAbsent(resourceBundleName, 50 | k -> new LoggingFacade(Logger.getLogger(name, resourceBundleName))); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/util/CloseableList.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | import java.io.Closeable; 7 | import java.io.IOException; 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | 11 | public class CloseableList extends ArrayList implements Closeable { 12 | 13 | public CloseableList(int initialCapacity) { 14 | super(initialCapacity); 15 | } 16 | 17 | public CloseableList() { 18 | super(); 19 | } 20 | 21 | public CloseableList(Collection c) { 22 | super(c); 23 | } 24 | 25 | @Override 26 | public void close() { 27 | this.forEach(x -> { 28 | try { 29 | x.close(); 30 | } catch (IOException e) { 31 | //suppress exception 32 | } 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/util/Constants.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | import java.util.Arrays; 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | public final class Constants { 11 | 12 | public static final String ARU_UPDATES_HOST = 13 | Utils.getEnvironmentProperty("WLSIMG_ARU_HOST", () -> "updates.oracle.com"); 14 | public static final String ARU_REST_URL = "https://" + ARU_UPDATES_HOST + "/Orion/Services"; 15 | public static final String REL_URL = ARU_REST_URL + "/metadata?table=aru_releases"; 16 | public static final String RECOMMENDED_PATCHES_URL = ARU_REST_URL 17 | + "/search?patch_type=all&life_cycle=Recommended&product=%s&release=%s"; 18 | public static final String ARU_LANG_URL = ARU_REST_URL + "/metadata?table=aru_languages"; 19 | public static final String CONFLICTCHECKER_URL = ARU_REST_URL + "/conflict_checks"; 20 | public static final String DEFAULT_WLS_VERSION = "12.2.1.3.0"; 21 | public static final String DEFAULT_JDK_VERSION = "8u202"; 22 | public static final String DEFAULT_META_FILE = ".metadata"; 23 | public static final String DELETE_ALL_FOR_SURE = "deleteAll4Sure"; 24 | public static final String HTTP = "http"; 25 | public static final String HTTPS = "https"; 26 | public static final String BUSYBOX = "busybox"; 27 | public static final List BUSYBOX_OS_IDS = Collections.unmodifiableList(Arrays.asList("bb", "alpine")); 28 | public static final String ORACLE_LINUX = "ghcr.io/oracle/oraclelinux:8-slim"; 29 | public static final String BUILDER_DEFAULT = Utils.getEnvironmentProperty("WLSIMG_BUILDER", () -> "docker"); 30 | 31 | private Constants() { 32 | //restrict access 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/util/DomainHomeSourceType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | public enum DomainHomeSourceType { 7 | MODEL("FromModel"), 8 | IMAGE("Image"), 9 | PV("PersistentVolume"); 10 | 11 | private String value; 12 | 13 | /** 14 | * Create an Enum value for the domain home source type. 15 | * @param value value the value to use for substitution in the mustache template. 16 | */ 17 | DomainHomeSourceType(String value) { 18 | this.value = value; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/util/InvalidPatchIdFormatException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | public class InvalidPatchIdFormatException extends Exception { 7 | public InvalidPatchIdFormatException(String patchId, String expectedFormat) { 8 | super(Utils.getMessage("IMG-0004", patchId, expectedFormat)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/util/NamedPattern.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | /** 9 | * A simple key-value pair, where the value is a compiled regex pattern. 10 | */ 11 | public class NamedPattern { 12 | 13 | private String name; 14 | private Pattern pattern; 15 | 16 | /** 17 | * Create a pattern from the regex and give it a name. 18 | * @param name key for the pattern 19 | * @param regex the pattern to compile 20 | */ 21 | public NamedPattern(String name, String regex) { 22 | if (name == null || regex == null) { 23 | throw new IllegalArgumentException("Neither the pattern or the name can be null"); 24 | } 25 | this.name = name; 26 | this.pattern = Pattern.compile(regex); 27 | } 28 | 29 | /** 30 | * Return the name for this pattern. 31 | * @return the name of the pattern. 32 | */ 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | /** 38 | * Determine if the provided value matches the pattern stored. 39 | * @param value the value to compare 40 | * @return true if the value matches the regex (compiled pattern) 41 | */ 42 | public boolean matches(String value) { 43 | return pattern.matcher(value).matches(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/wdt/DomainType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.wdt; 5 | 6 | import com.oracle.weblogic.imagetool.installer.FmwInstallerType; 7 | 8 | /** 9 | * Supported domain type. wls, jrf or restricted jrf. 10 | */ 11 | public enum DomainType { 12 | WLS("wls", FmwInstallerType.WLS), 13 | JRF("jrf", FmwInstallerType.FMW), 14 | RestrictedJRF("rjrf", FmwInstallerType.FMW); 15 | 16 | private String value; 17 | private FmwInstallerType installer; 18 | 19 | DomainType(String value, FmwInstallerType installer) { 20 | this.value = value; 21 | this.installer = installer; 22 | } 23 | 24 | /** 25 | * Create the Domain type Enum from the String value. 26 | * @param value the domain type string, ignoring case. 27 | * @return the enum domain type. 28 | */ 29 | public static DomainType fromValue(String value) { 30 | for (DomainType eachType : DomainType.values()) { 31 | if (eachType.value.equalsIgnoreCase(value)) { 32 | return eachType; 33 | } 34 | } 35 | throw new IllegalArgumentException("argument " + value + " does not match any DomainType"); 36 | } 37 | 38 | public FmwInstallerType installerType() { 39 | return installer; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /imagetool/src/main/java/com/oracle/weblogic/imagetool/wdt/WdtOperation.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.wdt; 5 | 6 | /** 7 | * Command types for WebLogic Deploy Tooling. 8 | * See GitHub project - https://github.com/oracle/weblogic-deploy-tooling 9 | */ 10 | public enum WdtOperation { 11 | 12 | CREATE("createDomain.sh"), 13 | UPDATE("updateDomain.sh"), 14 | DEPLOY("deployApps.sh"); 15 | 16 | WdtOperation(String script) { 17 | this.script = script; 18 | } 19 | 20 | private String script; 21 | 22 | /** 23 | * Get the WDT script to run that maps to this WDT operation. 24 | * @return the Unix shell script name for the WDT command. 25 | */ 26 | public String getScript() { 27 | return script; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/VERSION.txt: -------------------------------------------------------------------------------- 1 | WebLogic Image Tool ${project.version} -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/Update_Image.mustache: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | 5 | {{#isWdtEnabled}} 6 | {{> run-wdt }} 7 | {{/isWdtEnabled}} 8 | 9 | FROM {{baseImage}} as final_build 10 | {{#buildArgs}}ARG {{{.}}} 11 | {{/buildArgs}} 12 | USER root 13 | 14 | ENV OPATCH_NO_FUSER=true 15 | 16 | {{#isWdtEnabled}} 17 | ENV DOMAIN_HOME={{{domain_home}}} \ 18 | WDT_HOME={{{wdt_home}}} \ 19 | {{#modelOnly}} 20 | WDT_MODEL_HOME={{{wdt_model_home}}} \ 21 | {{/modelOnly}} 22 | PATH=${PATH}:{{{domain_home}}}/bin 23 | {{/isWdtEnabled}} 24 | 25 | LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}" 26 | 27 | USER {{userid}} 28 | 29 | {{> fmw-patching}} 30 | 31 | {{#isWdtEnabled}} 32 | {{> final-wdt-copy}} 33 | {{/isWdtEnabled}} 34 | 35 | {{#finalBuildCommands}} 36 | {{{.}}} 37 | {{/finalBuildCommands}} 38 | 39 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/create-user-group.mustache: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | # 6 | # Create user and group 7 | {{^usingBusybox}} 8 | RUN if [ -z "$(getent group oracle)" ]; then groupadd oracle || exit 1 ; fi \ 9 | && if [ -z "$(getent group {{groupid}})" ]; then groupadd {{groupid}} || exit 1 ; fi \ 10 | && if [ -z "$(getent passwd {{userid}})" ]; then useradd -g {{groupid}} {{userid}} || exit 1; fi \ 11 | && mkdir -p /u01 \ 12 | && chown {{userid}}:{{groupid}} /u01 \ 13 | && chmod 775 /u01 14 | {{/usingBusybox}} 15 | {{#usingBusybox}} 16 | RUN if [ -z "$(grep ^oracle: /etc/group)" ]; then addgroup oracle || exit 1 ; fi \ 17 | && if [ -z "$(grep ^{{groupid}}: /etc/group)" ]; then addgroup {{groupid}} || exit 1 ; fi \ 18 | && if [ -z "$(grep ^{{userid}}: /etc/passwd)" ]; then adduser -D -G {{groupid}} {{userid}} || exit 1 ; fi 19 | {{/usingBusybox}} -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/final-wdt-copy.mustache: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, 2024, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | # Copy WDT files or domain into the final image 5 | 6 | {{#modelOnly}} 7 | RUN mkdir -p {{{domain_parent}}} {{{wdt_home}}} {{{wdt_model_home}}} \ 8 | && chown {{userid}}:{{groupid}} {{{domain_parent}}} {{{wdt_home}}} {{{wdt_model_home}}} 9 | COPY --from=wdt_build --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/ 10 | {{#isWdtModelHomeOutsideWdtHome}} 11 | COPY --from=wdt_build --chown={{userid}}:{{groupid}} {{wdt_model_home}} {{wdt_model_home}}/ 12 | {{/isWdtModelHomeOutsideWdtHome}} 13 | {{#useOwnerPermsForGroup}} 14 | RUN chmod -R g=u {{{domain_parent}}} {{{wdt_home}}} {{{wdt_model_home}}} 15 | {{/useOwnerPermsForGroup}} 16 | {{/modelOnly}} 17 | {{^modelOnly}} 18 | COPY --from=wdt_build --chown={{userid}}:{{groupid}} {{{domain_home}}} {{{domain_home}}}/ 19 | {{#useOwnerPermsForGroup}} 20 | RUN chmod -R g=u {{{domain_home}}} 21 | {{/useOwnerPermsForGroup}} 22 | {{/modelOnly}} -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/fmw-patching.mustache: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | # 6 | # Update OPatch and apply WebLogic patches 7 | {{#isOpatchPatchingEnabled}} 8 | COPY --chown={{userid}}:{{groupid}} {{{opatchFileName}}} {{{tempDir}}}/opatch/ 9 | RUN cd {{{tempDir}}}/opatch \ 10 | && {{{java_home}}}/bin/jar -xf {{{tempDir}}}/opatch/{{{opatchFileName}}} \ 11 | && {{{java_home}}}/bin/java -jar {{{tempDir}}}/opatch/6880880/opatch_generic.jar -silent -ignoreSysPrereqs -force -novalidation oracle_home={{{oracle_home}}} \ 12 | && rm -rf {{{tempDir}}} 13 | {{/isOpatchPatchingEnabled}} 14 | 15 | {{#isPatchingEnabled}} 16 | COPY --chown={{userid}}:{{groupid}} patches/* {{{tempDir}}}/patches/ 17 | 18 | {{^strictPatchOrdering}} 19 | # Apply all patches provided at the same time 20 | RUN {{{oracle_home}}}/OPatch/opatch napply -silent -oh {{{oracle_home}}} -nonrollbackable -phBaseDir {{{tempDir}}}/patches \ 21 | && test $? -eq 0 \ 22 | && {{{oracle_home}}}/OPatch/opatch util cleanup -silent -oh {{{oracle_home}}} \ 23 | || (cat {{{oracle_home}}}/cfgtoollogs/opatch/opatch*.log && exit 1) 24 | {{/strictPatchOrdering}} 25 | {{#strictPatchOrdering}} 26 | # Apply one patch at a time in the order they were specified 27 | {{#patches}} 28 | RUN {{{oracle_home}}}/OPatch/opatch apply -silent -oh {{{oracle_home}}} -nonrollbackable {{{tempDir}}}/patches/{{{.}}} 29 | {{/patches}} 30 | RUN {{{oracle_home}}}/OPatch/opatch util cleanup -silent -oh {{{oracle_home}}} 31 | {{/strictPatchOrdering}} 32 | {{/isPatchingEnabled}} 33 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/install-java.mustache: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | # 4 | # Installing Java 5 | 6 | FROM os_update as jdk_build 7 | {{#buildArgs}}ARG {{{.}}} 8 | {{/buildArgs}} 9 | LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}" 10 | 11 | ENV JAVA_HOME={{{java_home}}} 12 | 13 | COPY --chown={{userid}}:{{groupid}} ["{{java_pkg}}", "{{{tempDir}}}/"] 14 | 15 | USER {{userid}} 16 | 17 | {{#beforeJdkInstall}} 18 | {{{.}}} 19 | {{/beforeJdkInstall}} 20 | 21 | RUN tar xzf "{{{tempDir}}}/{{java_pkg}}" -C /u01 \ 22 | && $(test -d /u01/jdk* && mv /u01/jdk* {{{java_home}}} || mv /u01/graal* {{{java_home}}}) \ 23 | && rm -rf {{{tempDir}}} \ 24 | && rm -f {{{java_home}}}/javafx-src.zip {{{java_home}}}/src.zip 25 | 26 | {{#afterJdkInstall}} 27 | {{{.}}} 28 | {{/afterJdkInstall}} 29 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/docker-files/package-managers.mustache: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 | # 6 | # Ensure necessary OS packages are installed 7 | {{#useYum}} 8 | RUN yum -y update \ 9 | && yum -y --downloaddir={{{tempDir}}} install {{#osPackages}}{{{.}}} {{/osPackages}}\ 10 | && yum -y --downloaddir={{{tempDir}}} clean all \ 11 | && rm -rf /var/cache/yum/* \ 12 | && rm -rf {{{tempDir}}} 13 | {{/useYum}} 14 | {{#useDnf}} 15 | RUN dnf -y update \ 16 | && dnf -y install {{#osPackages}}{{{.}}} {{/osPackages}}\ 17 | && dnf clean all 18 | {{/useDnf}} 19 | {{#useMicroDnf}} 20 | RUN microdnf -y update \ 21 | && microdnf -y install {{#osPackages}}{{{.}}} {{/osPackages}}\ 22 | && microdnf clean all 23 | {{/useMicroDnf}} 24 | {{#useMicroDnf8}} 25 | RUN microdnf update \ 26 | && microdnf install {{#osPackages}}{{{.}}} {{/osPackages}}\ 27 | && microdnf clean all 28 | {{/useMicroDnf8}} 29 | {{#useAptGet}} 30 | RUN apt-get -y update \ 31 | && apt-get -y upgrade \ 32 | && apt-get -y install {{#osPackages}}{{{.}}} {{/osPackages}}\ 33 | && apt-get -y clean all 34 | {{/useAptGet}} 35 | {{#useApk}} 36 | RUN apk update \ 37 | && apk upgrade \ 38 | && rm -rf /var/cache/apk/* 39 | {{/useApk}} 40 | {{#useZypper}} 41 | RUN zypper -nq update \ 42 | && zypper -nq clean \ 43 | && rm -rf /var/cache/zypp/* 44 | {{/useZypper}} -------------------------------------------------------------------------------- /imagetool/src/main/resources/response-files/default-response.mustache: -------------------------------------------------------------------------------- 1 | [ENGINE] 2 | Response File Version=1.0.0.0.0 3 | [GENERIC] 4 | INSTALL_TYPE={{{installType}}} 5 | DECLINE_SECURITY_UPDATES=true 6 | SECURITY_UPDATES_VIA_MYORACLESUPPORT=false 7 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/response-files/oraInst.loc: -------------------------------------------------------------------------------- 1 | inventory_loc=/u01/oracle/oraInventory 2 | inst_group=oracle 3 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/templates/conflict-check.mustache: -------------------------------------------------------------------------------- 1 | 2 | 2000 3 | 4 | {{#installedPatches}} 5 | 6 | {{/installedPatches}} 7 | 8 | 9 | {{#candidatePatches}} 10 | {{{patchId}}} 11 | {{/candidatePatches}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /imagetool/src/main/resources/version-info.properties: -------------------------------------------------------------------------------- 1 | project_name=${project.artifactId} 2 | project_version=${project.version} -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/ResourceUtils.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool; 5 | 6 | import java.io.IOException; 7 | import java.net.URISyntaxException; 8 | import java.net.URL; 9 | import java.nio.file.Files; 10 | import java.nio.file.Path; 11 | import java.nio.file.Paths; 12 | 13 | import com.oracle.weblogic.imagetool.util.HttpUtil; 14 | import org.w3c.dom.Document; 15 | 16 | import static org.junit.jupiter.api.Assertions.assertNotNull; 17 | 18 | /** 19 | * Test helper class for loading/parsing test resource files. 20 | */ 21 | public class ResourceUtils { 22 | 23 | private static ResourceUtils internal; 24 | 25 | private ResourceUtils() { 26 | // use instance() 27 | } 28 | 29 | private static ResourceUtils instance() { 30 | if (internal == null) { 31 | internal = new ResourceUtils(); 32 | } 33 | return internal; 34 | } 35 | 36 | public static Path resourcePath(String pathOfResource) { 37 | URL url = instance().getClass().getResource(pathOfResource); 38 | assertNotNull(url); 39 | try { 40 | return Paths.get(url.toURI()); 41 | } catch (URISyntaxException err) { 42 | throw new IllegalArgumentException("Invalid path to resource: " + pathOfResource); 43 | } 44 | } 45 | 46 | public static Document getXmlFromResource(String pathOfResource) throws IOException { 47 | return HttpUtil.parseXml(Files.readAllBytes(resourcePath(pathOfResource))); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/aru/MockAruUtil.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.aru; 5 | 6 | import java.io.IOException; 7 | import java.lang.reflect.Field; 8 | import java.util.stream.Stream; 9 | import javax.xml.xpath.XPathExpressionException; 10 | 11 | import com.oracle.weblogic.imagetool.ResourceUtils; 12 | import org.w3c.dom.Document; 13 | 14 | public class MockAruUtil extends AruUtil { 15 | /** 16 | * Intercept calls to the ARU REST API during unit testing. 17 | */ 18 | 19 | @Override 20 | Document getAllReleases(String userId, String password) { 21 | try { 22 | return ResourceUtils.getXmlFromResource("/releases.xml"); 23 | } catch (IOException e) { 24 | e.printStackTrace(); 25 | throw new RuntimeException("failed to load releases.xml from resources", e); 26 | } 27 | } 28 | 29 | @Override 30 | public Stream getPatches(String bugNumber, String user, String password) 31 | throws IOException, XPathExpressionException { 32 | if (user == null || password == null) { 33 | // running in offline mode (no credentials to connect to ARU) 34 | return Stream.of(new AruPatch().patchId(bugNumber)); 35 | } else { 36 | return AruPatch.getPatches( 37 | ResourceUtils.getXmlFromResource("/patches/patch-" + bugNumber + ".xml")); 38 | } 39 | } 40 | 41 | public static void insertMockAruInstance(AruUtil mockInstance) throws NoSuchFieldException, IllegalAccessException { 42 | // insert test class into AruUtil to intercept REST calls to ARU 43 | Field aruRest = AruUtil.class.getDeclaredField("instance"); 44 | aruRest.setAccessible(true); 45 | aruRest.set(aruRest, mockInstance); 46 | } 47 | 48 | public static void removeMockAruInstance() throws NoSuchFieldException, IllegalAccessException { 49 | // remove test class from AruUtil instance 50 | Field aruRest = AruUtil.class.getDeclaredField("instance"); 51 | aruRest.setAccessible(true); 52 | aruRest.set(aruRest, null); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/cachestore/CacheStoreTestImpl.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cachestore; 5 | 6 | import java.nio.file.Path; 7 | import java.util.ArrayList; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | public class CacheStoreTestImpl implements CacheStore { 13 | 14 | private final HashMap cache = new HashMap<>(); 15 | private final Path cacheDir; 16 | 17 | public CacheStoreTestImpl(Path cacheDir) { 18 | this.cacheDir = cacheDir; 19 | } 20 | 21 | @Override 22 | public String getCacheDir() { 23 | return cacheDir.toString(); 24 | } 25 | 26 | @Override 27 | public String getValueFromCache(String key) { 28 | return cache.get(key); 29 | } 30 | 31 | @Override 32 | public boolean containsKey(String key) { 33 | if (key == null) { 34 | return false; 35 | } 36 | return cache.containsKey(key.toLowerCase()); 37 | } 38 | 39 | @Override 40 | public void addToCache(String key, String value) { 41 | cache.put(key.toLowerCase(), value); 42 | } 43 | 44 | @Override 45 | public String deleteFromCache(String key) { 46 | return null; 47 | } 48 | 49 | @Override 50 | public void clearCache() { 51 | cache.clear(); 52 | } 53 | 54 | @Override 55 | public Map getCacheItems() { 56 | return cache; 57 | } 58 | 59 | @Override 60 | public List getKeysForType(String type) { 61 | return new ArrayList<>(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/cli/menu/CommonPatchingOptions2Test.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.menu; 5 | 6 | import com.oracle.weblogic.imagetool.aru.AruUtil; 7 | import com.oracle.weblogic.imagetool.aru.InvalidCredentialException; 8 | import com.oracle.weblogic.imagetool.test.annotations.ReduceTestLogging; 9 | import org.junit.jupiter.api.Tag; 10 | import org.junit.jupiter.api.Test; 11 | import picocli.CommandLine; 12 | 13 | import static org.junit.jupiter.api.Assertions.assertThrows; 14 | 15 | @Tag("unit") 16 | @ReduceTestLogging(loggerClass = AruUtil.class) 17 | class CommonPatchingOptions2Test { 18 | 19 | @Test 20 | void noPassword() { 21 | // This test requires that ARUUtil instance NOT be overridden 22 | CreateImage createImage = new CreateImage(); 23 | new CommandLine(createImage).parseArgs("--tag", "tag:1", "--user", "derek", "--patches", "12345678"); 24 | assertThrows(InvalidCredentialException.class, createImage::initializeOptions); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/cli/menu/UpdateImageTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.cli.menu; 5 | 6 | import com.oracle.weblogic.imagetool.installer.FmwInstallerType; 7 | import org.junit.jupiter.api.Tag; 8 | import org.junit.jupiter.api.Test; 9 | import picocli.CommandLine; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | @Tag("unit") 14 | class UpdateImageTest { 15 | @Test 16 | @Tag("failing") 17 | void installerTypeTest() { 18 | UpdateImage updateImage = new UpdateImage(); 19 | new CommandLine(updateImage).parseArgs("--tag", "tag:1", "--user", "derek", "--password", "xxx", 20 | "--patches", "abc"); 21 | // when not discovered from the fromImage, default should be WLS 22 | assertEquals(FmwInstallerType.WLS, updateImage.getInstallerType()); 23 | 24 | updateImage.setImageInstallerType("WLS,COH,TOPLINK,JDBC,FIT,INFRA,OPSS,OWSM"); // mimic inspect FMW image 25 | // when discovered from the fromImage, value should be as discovered 26 | assertEquals(FmwInstallerType.FMW, updateImage.getInstallerType()); 27 | } 28 | 29 | @Test 30 | void installerTypeOverrideTest() { 31 | UpdateImage updateImage = new UpdateImage(); 32 | new CommandLine(updateImage).parseArgs("--tag", "tag:1", "--user", "derek", "--password", "xxx", 33 | "--patches", "abc", "--type", "SOA"); 34 | // when not discovered from the fromImage, value should be same as provided by user (not default) 35 | assertEquals(FmwInstallerType.SOA, updateImage.getInstallerType()); 36 | 37 | updateImage.setImageInstallerType("FMW"); 38 | // when discovered from the fromImage, value should be same as provided by user 39 | assertEquals(FmwInstallerType.SOA, updateImage.getInstallerType()); 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/installer/ResponseFileTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.installer; 5 | 6 | import java.io.File; 7 | import java.nio.file.Path; 8 | import java.nio.file.Paths; 9 | 10 | import org.junit.jupiter.api.Tag; 11 | import org.junit.jupiter.api.Test; 12 | import org.junit.jupiter.api.io.TempDir; 13 | 14 | import static org.junit.jupiter.api.Assertions.assertEquals; 15 | import static org.junit.jupiter.api.Assertions.assertNull; 16 | 17 | @Tag("unit") 18 | class ResponseFileTest { 19 | @Test 20 | void copyProvidedResponseFile(@TempDir File tmpDir) throws Exception { 21 | String filename = "responseA.txt"; 22 | Path sourceFile = Paths.get("./src/test/resources/responseFiles/" + filename); 23 | 24 | ResponseFile responseFile0 = new ProvidedResponseFile(sourceFile); 25 | assertEquals(filename, responseFile0.name(), "failed to load installer response file name"); 26 | 27 | responseFile0.copyFile(tmpDir.getAbsolutePath()); 28 | assertEquals(filename, responseFile0.name(), "file name should not have changed after copy"); 29 | 30 | ResponseFile responseFile1 = new ProvidedResponseFile(sourceFile); 31 | responseFile1.copyFile(tmpDir.getAbsolutePath()); 32 | assertEquals(filename + "1", responseFile1.name(), "file name should have changed after copy"); 33 | 34 | ResponseFile responseFile2 = new ProvidedResponseFile(sourceFile); 35 | responseFile2.copyFile(tmpDir.getAbsolutePath()); 36 | assertEquals(filename + "2", responseFile2.name(), "file name should have changed after copy"); 37 | } 38 | 39 | @Test 40 | void notRegularFile(@TempDir File tmpDir) throws Exception { 41 | // not a regular file, should skip copy request 42 | Path directory = Paths.get("./src/test/resources/responseFiles"); 43 | ResponseFile responseFile = new ProvidedResponseFile(directory); 44 | responseFile.copyFile(tmpDir.getAbsolutePath()); 45 | assertNull(responseFile.name(), "directories are not valid for a response file"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/logging/FileFormatterTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.logging; 5 | 6 | import java.util.logging.Level; 7 | import java.util.logging.LogRecord; 8 | 9 | import org.junit.jupiter.api.Test; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertTrue; 12 | 13 | 14 | class FileFormatterTest { 15 | 16 | @Test 17 | void format() { 18 | FileFormatter formatter = new FileFormatter(); 19 | LogRecord logRecord = new LogRecord(Level.INFO, "message goes here"); 20 | 21 | String logMessage = formatter.format(logRecord); 22 | assertTrue(logMessage.startsWith("####")); 23 | assertTrue(logMessage.endsWith("\n")); 24 | } 25 | 26 | @Test 27 | void formatWithColor() { 28 | FileFormatter formatter = new FileFormatter(); 29 | String initialValue = "message [[brightred: goes]] here"; 30 | LogRecord logRecord = new LogRecord(Level.INFO, initialValue); 31 | 32 | String logMessage = formatter.format(logRecord); 33 | // color should be removed for non-console logging 34 | assertTrue(logMessage.endsWith("\n")); 35 | } 36 | } -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/test/annotations/LogLevel.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.test.annotations; 5 | 6 | import java.util.logging.Level; 7 | 8 | /** 9 | * An Enum representation of the Logger levels to be used with the TestLoggerOverride Annotation. 10 | */ 11 | public enum LogLevel { 12 | INFO(Level.INFO), 13 | WARNING(Level.WARNING), 14 | SEVERE(Level.SEVERE), 15 | OFF(Level.OFF); 16 | 17 | private final Level value; 18 | 19 | LogLevel(Level value) { 20 | this.value = value; 21 | } 22 | 23 | public Level value() { 24 | return value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/test/annotations/ReduceTestLogging.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.test.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | import org.junit.jupiter.api.extension.ExtendWith; 12 | 13 | /** 14 | * Used in conjunction with ReduceTestLoggingExtension to disable or reduce extraneously log messages during 15 | * unit test execution. The original log level will be saved before executing any JUnit tests in the annotated class, 16 | * and restored after all tests in the class are completed. 17 | * During the tests of the annotated class, the specified logger (loggerClass) will have its minimum level set to the 18 | * value specified in level(). The default level is OFF. 19 | */ 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target(ElementType.TYPE) 22 | @ExtendWith(ReduceTestLoggingExtension.class) 23 | public @interface ReduceTestLogging { 24 | Class loggerClass(); 25 | LogLevel level() default LogLevel.OFF; 26 | } 27 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/test/annotations/ReduceTestLoggingExtension.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.test.annotations; 5 | 6 | import java.util.Optional; 7 | import java.util.logging.Level; 8 | 9 | import com.oracle.weblogic.imagetool.logging.LoggingFacade; 10 | import com.oracle.weblogic.imagetool.logging.LoggingFactory; 11 | import org.junit.jupiter.api.extension.AfterAllCallback; 12 | import org.junit.jupiter.api.extension.BeforeAllCallback; 13 | import org.junit.jupiter.api.extension.ExtensionContext; 14 | 15 | /** 16 | * Used in conjunction with ReduceTestLogging to disable or reduce extraneously log messages during 17 | * unit test execution. 18 | */ 19 | public class ReduceTestLoggingExtension implements BeforeAllCallback, AfterAllCallback { 20 | private static LoggingFacade logger; 21 | private static Level oldLevel; 22 | 23 | @Override 24 | public void beforeAll(ExtensionContext extensionContext) throws Exception { 25 | Optional> testClass = extensionContext.getTestClass(); 26 | if (testClass.isPresent()) { 27 | ReduceTestLogging annotation = testClass.get().getAnnotation(ReduceTestLogging.class); 28 | logger = LoggingFactory.getLogger(annotation.loggerClass()); 29 | oldLevel = logger.getLevel(); 30 | logger.setLevel(annotation.level().value()); 31 | } else { 32 | throw new IllegalArgumentException("TestLoggerExtension can not be used outside of TestLoggerOverride."); 33 | } 34 | } 35 | 36 | @Override 37 | public void afterAll(ExtensionContext extensionContext) throws Exception { 38 | logger.setLevel(oldLevel); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/util/CloseableListTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.util; 5 | 6 | import java.io.Closeable; 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | import java.util.List; 10 | 11 | import org.junit.jupiter.api.Tag; 12 | import org.junit.jupiter.api.Test; 13 | 14 | import static org.junit.jupiter.api.Assertions.assertFalse; 15 | import static org.junit.jupiter.api.Assertions.assertTrue; 16 | 17 | @Tag("unit") 18 | class CloseableListTest { 19 | 20 | // simple object used to test the CloseableList 21 | static final class MyStream implements Closeable { 22 | private boolean open; 23 | 24 | MyStream() { 25 | open = true; 26 | } 27 | 28 | @Override 29 | public void close() { 30 | open = false; 31 | } 32 | 33 | boolean isOpen() { 34 | return open; 35 | } 36 | } 37 | 38 | @Test 39 | void testAutoCloseObjects() { 40 | // create several closable objects (like a PrintStream...) 41 | MyStream[] someStreams = { new MyStream(), new MyStream()}; 42 | // wrap with a list, although it shouldn't matter 43 | List originalList = new ArrayList<>(Arrays.asList(someStreams)); 44 | // try-with-resource should close the outer list 45 | try (CloseableList testList = new CloseableList<>(originalList)) { 46 | // ensure that the inner objects are still "open" 47 | testList.forEach(x -> assertTrue(x.isOpen())); 48 | } 49 | // if the CloseableList class works correctly, the inner objects should all get closed when 50 | // the outer list is closed. 51 | originalList.forEach(x -> assertFalse(x.isOpen())); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /imagetool/src/test/java/com/oracle/weblogic/imagetool/wdt/WdtUnitTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.wdt; 5 | 6 | import com.oracle.weblogic.imagetool.installer.FmwInstallerType; 7 | import org.junit.jupiter.api.Tag; 8 | import org.junit.jupiter.api.Test; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | import static org.junit.jupiter.api.Assertions.assertThrows; 12 | 13 | @Tag("unit") 14 | class WdtUnitTest { 15 | @Test 16 | void parseStringValues() { 17 | assertEquals(DomainType.JRF, DomainType.fromValue("jrf")); 18 | assertEquals(DomainType.JRF, DomainType.fromValue("JRF")); 19 | assertEquals(DomainType.JRF, DomainType.fromValue("Jrf")); 20 | 21 | assertEquals(DomainType.RestrictedJRF, DomainType.fromValue("rjrf")); 22 | assertEquals(DomainType.RestrictedJRF, DomainType.fromValue("RJRF")); 23 | assertEquals(DomainType.RestrictedJRF, DomainType.fromValue("RJrf")); 24 | 25 | assertEquals(DomainType.WLS, DomainType.fromValue("wls")); 26 | assertEquals(DomainType.WLS, DomainType.fromValue("WLS")); 27 | assertEquals(DomainType.WLS, DomainType.fromValue("Wls")); 28 | 29 | assertThrows(IllegalArgumentException.class, () -> DomainType.fromValue("RestrictedJRF")); 30 | assertThrows(IllegalArgumentException.class, () -> DomainType.fromValue("WCC")); 31 | } 32 | 33 | @Test 34 | void getInstallerType() { 35 | assertEquals(FmwInstallerType.WLS, DomainType.WLS.installerType()); 36 | assertEquals(FmwInstallerType.FMW, DomainType.JRF.installerType()); 37 | } 38 | 39 | @Test 40 | void wdtOperations() { 41 | assertEquals("createDomain.sh", WdtOperation.CREATE.getScript()); 42 | assertEquals("updateDomain.sh", WdtOperation.UPDATE.getScript()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/additionalBuildCommands/bad-section.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | 4 | [after-fmw-install] 5 | RUN ls -al /u01 6 | RUN ls -al /u01/oracle 7 | 8 | [ does-not-exist ] 9 | RUN ls -al /tmp 10 | RUN ls -al /u01 11 | 12 | [before-fmw-install] 13 | LABEL this="that" 14 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/additionalBuildCommands/one-section.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | 4 | [after-fmw-install] 5 | RUN ls -al /u01 6 | RUN ls -al /u01/oracle 7 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/additionalBuildCommands/two-mustache.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2022, Oracle Corporation and/or its affiliates. All rights reserved. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | 4 | [final-build-commands] 5 | echo This is the Oracle Home: {{{oracle_home}}} 6 | echo This is the Java Home: {{{java_home}}} 7 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/additionalBuildCommands/two-sections.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | 4 | sadfasdfa 5 | asdfasdf 6 | asdfasdf 7 | 8 | [after-fmw-install] 9 | RUN ls -al /u01 10 | RUN ls -al /u01/oracle 11 | 12 | [ before-jdk-install ] 13 | RUN ls -al /tmp 14 | RUN ls -al /u01 15 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/buildFilesDir/fileA.txt: -------------------------------------------------------------------------------- 1 | test file -------------------------------------------------------------------------------- /imagetool/src/test/resources/buildFilesDir/fileB.txt: -------------------------------------------------------------------------------- 1 | test file -------------------------------------------------------------------------------- /imagetool/src/test/resources/buildFilesDir/subDirectory/fileC.txt: -------------------------------------------------------------------------------- 1 | test file -------------------------------------------------------------------------------- /imagetool/src/test/resources/buildFilesDir/subDirectory/secondLevelDirectory/fileD.txt: -------------------------------------------------------------------------------- 1 | test file -------------------------------------------------------------------------------- /imagetool/src/test/resources/conflict-check/double-conflict.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 11111111 13 | 14 | 15 | 11111111 16 | 17 | 18 | 19 | 22222222 20 | 21 | 22 | 22222222 23 | 24 | 25 | 26 | 11111111 27 | 22222222 28 | 29 | 30 | 31 | 32 | 33 | 34 | 33333333 35 | 36 | 37 | 33333333 38 | 39 | 40 | 41 | 44444444 42 | 43 | 44 | 44444444 45 | 46 | 47 | 48 | 33333333 49 | 44444444 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/conflict-check/no-conflict.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/conflict-check/simple-conflict.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 11111111 13 | 14 | 15 | 11111111 16 | 17 | 18 | 19 | 22222222 20 | 21 | 22 | 22222222 23 | 24 | 25 | 26 | 11111111 27 | 22222222 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/docker-files/mustache-writer-test.mustache: -------------------------------------------------------------------------------- 1 | {{{oracle_home}}} -------------------------------------------------------------------------------- /imagetool/src/test/resources/dummyInstallers/dummyResponse.txt: -------------------------------------------------------------------------------- 1 | dummy -------------------------------------------------------------------------------- /imagetool/src/test/resources/dummyInstallers/test-installer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/weblogic-image-tool/1625182cd559a7b5d930ea6b38ec9da6eda4d1dd/imagetool/src/test/resources/dummyInstallers/test-installer.zip -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image1.json: -------------------------------------------------------------------------------- 1 | { 2 | "oraclePatches" : [ 3 | { 4 | "patch" : "30319071", 5 | "description" : "One-off" 6 | }, 7 | { 8 | "patch" : "26355633", 9 | "description" : "One-off" 10 | }, 11 | { 12 | "patch" : "26287183", 13 | "description" : "One-off" 14 | }, 15 | { 16 | "patch" : "26261906", 17 | "description" : "One-off" 18 | }, 19 | { 20 | "patch" : "26051289", 21 | "description" : "One-off" 22 | } 23 | ], 24 | "os" : { 25 | "id" : "ol", 26 | "name" : "Oracle Linux Server", 27 | "version" : "7.9", 28 | "architecture" : "x86_64" 29 | }, 30 | "javaHome" : "/u01/jdk", 31 | "javaVersion" : "1.8.0_202", 32 | "opatchVersion" : "13.9.4.2.5", 33 | "oracleHome" : "/u01/oracle", 34 | "oracleHomeGroup" : "oracle", 35 | "oracleHomeUser" : "oracle", 36 | "packageManager" : "YUM", 37 | "wlsVersion" : "12.2.1.3.0" 38 | } 39 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image1.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | oraclePatches=30319071;23384603;"One-off";26355633;21447583;"One-off";26287183;21447582;"One-off";26261906;21344506;"One-off";26051289;21455037;"One-off"; 5 | oracleHome=/u01/oracle 6 | javaVersion=1.8.0_202 7 | oracleHomeGroup=oracle 8 | oracleHomeUser=oracle 9 | opatchVersion=13.9.4.2.5 10 | packageManager=YUM 11 | wlsVersion=12.2.1.3.0 12 | javaHome=/u01/jdk 13 | __OS__NAME="Oracle Linux Server" 14 | __OS__VERSION="7.9" 15 | __OS__ID="ol" 16 | __OS__arch=x86_64 17 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image2.json: -------------------------------------------------------------------------------- 1 | { 2 | "oraclePatches" : [ 3 | ], 4 | "os" : { 5 | "id" : "ol", 6 | "name" : "Oracle Linux Server", 7 | "version" : "7.9", 8 | "architecture" : "x86_64" 9 | }, 10 | "domainHome" : "/u01/domains/base_domain", 11 | "javaHome" : "/u01/jdk", 12 | "javaVersion" : "1.8.0_202", 13 | "opatchVersion" : "13.9.4.2.1", 14 | "oracleHome" : "/u01/oracle", 15 | "oracleHomeGroup" : "oracle", 16 | "oracleHomeUser" : "oracle", 17 | "packageManager" : "YUM", 18 | "wlsVersion" : "12.2.1.4.0" 19 | } 20 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image2.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | oraclePatches= 5 | oracleHome=/u01/oracle 6 | domainHome=/u01/domains/base_domain 7 | javaVersion=1.8.0_202 8 | oracleHomeGroup=oracle 9 | oracleHomeUser=oracle 10 | opatchVersion=13.9.4.2.1 11 | packageManager=YUM 12 | wlsVersion=12.2.1.4.0 13 | javaHome=/u01/jdk 14 | __OS__NAME="Oracle Linux Server" 15 | __OS__VERSION="7.9" 16 | __OS__ID="ol" 17 | __OS__arch=x86_64 18 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image3.json: -------------------------------------------------------------------------------- 1 | { 2 | "oraclePatches" : [ 3 | ], 4 | "os" : { 5 | "id" : "ol", 6 | "name" : "Oracle Linux Server", 7 | "version" : "7.9", 8 | "architecture" : "x86_64", 9 | "releasePackage" : "oraclelinux-release-7.9-1.0.7.el8.x86_64" 10 | }, 11 | "domainHome" : "/u01/domains/base_domain", 12 | "javaHome" : "/u01/jdk", 13 | "javaVersion" : "1.8.0_202", 14 | "opatchVersion" : "13.9.4.2.1", 15 | "oracleHome" : "/u01/oracle", 16 | "oracleHomeGroup" : "oracle", 17 | "oracleHomeUser" : "oracle", 18 | "packageManager" : "YUM", 19 | "wlsVersion" : "12.2.1.4.0" 20 | } 21 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/inspect/image3.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | oraclePatches= 5 | oracleHome=/u01/oracle 6 | domainHome=/u01/domains/base_domain 7 | javaVersion=1.8.0_202 8 | oracleHomeGroup=oracle 9 | oracleHomeUser=oracle 10 | opatchVersion=13.9.4.2.1 11 | packageManager=YUM 12 | wlsVersion=12.2.1.4.0 13 | javaHome=/u01/jdk 14 | __OS__NAME="Oracle Linux Server" 15 | __OS__VERSION="7.9" 16 | __OS__ID="ol" 17 | __OS__RELEASE_PACKAGE="oraclelinux-release-7.9-1.0.7.el8.x86_64" 18 | __OS__arch=x86_64 19 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/patches/no-patches.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10-016 6 | No patches found. Clear your search and try again. 7 | 8 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/patches/patch-11100002.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11100002 8 | 9 | 10 | 11100002 11 | Patch 12 | Available 13 | Open access 14 | 15 | 16 | 17 | 18 | General Support 19 | 20 | 21 | 22 | 23 | 24 | p11100002_122110_Generic.zip 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/patches/patch-11100005.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11100005 9 | 10 | 11 | 11100005 12 | Patch 13 | Oracle WebLogic Server 12.2.1.4.210411 14 | Available 15 | Open access 16 | 17 | 18 | 19 | 20 | General Support 21 | 22 | 23 | 24 | 25 | 26 | p11100005_122140_Generic.zip 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/patches/patch-11100006.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11100006 8 | 9 | 10 | 11100006 11 | Patch 12 | Oracle WebLogic Server 12.2.1.3.211222 13 | Available 14 | Open access 15 | 16 | 17 | 18 | 19 | General Support 20 | 21 | 22 | 23 | 24 | 25 | p11100006_122130_Generic.zip 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/responseFiles/responseA.txt: -------------------------------------------------------------------------------- 1 | fake file -------------------------------------------------------------------------------- /imagetool/src/test/resources/templates/resolver.yml: -------------------------------------------------------------------------------- 1 | domainHome: {{{domainHome}}} 2 | image: {{{imageName}}} 3 | domainHomeSourceType: {{{domainHomeSourceType}}} -------------------------------------------------------------------------------- /imagetool/src/test/resources/templates/verrazzano.yml: -------------------------------------------------------------------------------- 1 | apiVersion: verrazzano.io/v1beta1 2 | kind: VerrazzanoModel 3 | metadata: 4 | name: dereks-todo-model 5 | namespace: default 6 | spec: 7 | description: "Derek's Todo System" 8 | weblogicDomains: 9 | - name: todo 10 | adminPort: 32701 11 | t3Port: 32702 12 | domainCRValues: 13 | domainUID: todo 14 | domainHome: {{{domainHome}}} 15 | domainHomeSourceType: {{{domainHomeSourceType}}} 16 | image: {{{imageName}}} 17 | includeServerOutInPodLog: true 18 | replicas: 1 19 | webLogicCredentialsSecret: 20 | name: todo-weblogic-credentials 21 | imagePullSecrets: 22 | - name: ocir 23 | clusters: 24 | - clusterName: cluster-1 25 | serverPod: 26 | env: 27 | - name: JAVA_OPTIONS 28 | value: "-Dweblogic.StdoutDebugEnabled=false" 29 | - name: USER_MEM_ARGS 30 | value: "-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m " 31 | - name: WL_HOME 32 | value: /u01/oracle/wlserver 33 | - name: MW_HOME 34 | value: /u01/oracle 35 | connections: 36 | - ingress: 37 | - name: todo-ingress 38 | match: 39 | - uri: 40 | prefix: "/todo" 41 | - database: 42 | - target: todo-db 43 | datasourceName: todoDb 44 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/utilsTest/lsinventory.txt: -------------------------------------------------------------------------------- 1 | Oracle Interim Patch Installer version 13.9.4.2.2 2 | Copyright (c) 2020, 2021, Oracle. All rights reserved. 3 | 4 | 5 | Oracle Home : /u01/oracle 6 | Central Inventory : /u01/oracle/oraInventory 7 | from : /u01/oracle/oraInst.loc 8 | OPatch version : 13.9.4.2.2 9 | OUI version : 13.9.4.0.0 10 | Log file location : /u01/oracle/cfgtoollogs/opatch/opatchxxxxxxx.log 11 | 12 | 13 | OPatch detects the Middleware Home as "/u01/oracle" 14 | 15 | Lsinventory Output file location : /u01/oracle/cfgtoollogs/opatch/lsinv/lsinventoryxxxxxx.txt 16 | 17 | -------------------------------------------------------------------------------- 18 | Local Machine Information:: 19 | Hostname: 234h234 20 | ARU platform id: 226 21 | ARU platform description:: Linux x86-64 22 | 23 | 24 | Interim patches (1) : 25 | 26 | Patch 1234567 : applied on Sat Jun 06 01:10:59 GMT 2020 27 | Unique Patch ID: 11111111 28 | Patch description: "WLS PATCH SET UPDATE 12.2.1.4.191220" 29 | Created on 20 Dec 2019, 17:56:29 hrs PST8PDT 30 | Bugs fixed: 31 | 11111111, 11111111, 11111111, 11111111, 11111111, 11111111, 11111111 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- 36 | 37 | OPatch succeeded. 38 | -------------------------------------------------------------------------------- /imagetool/src/test/resources/utilsTest/lsinventoryWithID.txt: -------------------------------------------------------------------------------- 1 | Oracle Interim Patch Installer version 13.9.4.2.2 2 | Copyright (c) 2020, 2021, Oracle. All rights reserved. 3 | 4 | 5 | Oracle Home : /u01/oracle 6 | Central Inventory : /u01/oracle/oraInventory 7 | from : /u01/oracle/oraInst.loc 8 | OPatch version : 13.9.4.2.2 9 | OUI version : 13.9.4.0.0 10 | Log file location : /u01/oracle/cfgtoollogs/opatch/opatchxxxxxx.log 11 | 12 | 13 | OPatch detects the Middleware Home as "/u01/oracle" 14 | 15 | Lsinventory Output file location : /u01/oracle/cfgtoollogs/opatch/lsinv/lsinventoryxxxxxx.txt 16 | 17 | -------------------------------------------------------------------------------- 18 | Local Machine Information:: 19 | Hostname: 776a940e5071 20 | ARU platform id: 226 21 | ARU platform description:: Linux x86-64 22 | 23 | 24 | Interim patches (5) : 25 | 26 | Patch 1234567 : applied on Mon Jun 08 22:09:01 GMT 2020 27 | Unique Patch ID: 99999999 28 | Patch description: "WLS PATCH SET UPDATE 12.2.1.3.0(ID:200227.1409)" 29 | Created on 29 Feb 2020, 10:48:07 hrs PST8PDT 30 | Bugs fixed: 31 | 11111111, 11111111, 11111111, 11111111, 11111111, 11111111, 11111111 32 | 33 | Patch 1234567 : applied on Mon Jun 08 22:06:23 GMT 2020 34 | Unique Patch ID: 99999999 35 | Patch description: "One-off" 36 | Created on 1 Aug 2017, 21:40:20 hrs UTC 37 | Bugs fixed: 38 | 11111111 39 | 40 | Patch 1234567 : applied on Mon Jun 08 22:06:14 GMT 2020 41 | Unique Patch ID: 99999999 42 | Patch description: "One-off" 43 | Created on 1 Aug 2017, 21:41:27 hrs UTC 44 | Bugs fixed: 45 | 11111111 46 | 47 | Patch 1234567 : applied on Mon Jun 08 22:05:59 GMT 2020 48 | Unique Patch ID: 99999999 49 | Patch description: "One-off" 50 | Created on 12 Jun 2017, 23:36:08 hrs UTC 51 | Bugs fixed: 52 | 11111111, 11111111, 11111111 53 | 54 | Patch 1234567 : applied on Mon Jun 08 22:05:55 GMT 2020 55 | Unique Patch ID: 99999999 56 | Patch description: "One-off" 57 | Created on 31 Jul 2017, 22:11:57 hrs UTC 58 | Bugs fixed: 59 | 11111111 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- 64 | 65 | OPatch succeeded. -------------------------------------------------------------------------------- /imagetool/src/test/resources/utilsTest/responseFile1.txt: -------------------------------------------------------------------------------- 1 | [ENGINE] 2 | Response File Version=1.0.0.0.0 3 | [GENERIC] 4 | INSTALL_TYPE=WebLogic Server 5 | ORACLE_HOME=/my/oraclehomeDir 6 | DECLINE_SECURITY_UPDATES=true 7 | SECURITY_UPDATES_VIA_MYORACLESUPPORT=false -------------------------------------------------------------------------------- /imagetool/src/test/resources/utilsTest/testPasswordFile.txt: -------------------------------------------------------------------------------- 1 | pass2 -------------------------------------------------------------------------------- /installer/src/assembly/zip.xml: -------------------------------------------------------------------------------- 1 | 5 | 8 | zip 9 | 10 | zip 11 | 12 | 13 | 14 | 15 | src/main/bin 16 | bin 17 | 18 | *.sh 19 | *.cmd 20 | logging.properties 21 | 22 | 0750 23 | unix 24 | 25 | 26 | ../ 27 | . 28 | 29 | LICENSE.txt 30 | 31 | 32 | 33 | target 34 | lib 35 | 36 | *.jar 37 | *.sh 38 | 39 | 40 | 41 | target/classes 42 | . 43 | 44 | VERSION.txt 45 | 46 | 47 | 48 | 49 | 50 | lib 51 | false 52 | false 53 | runtime 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/annotations/IntegrationTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | import com.oracle.weblogic.imagetool.tests.extensions.LoggingExtension; 12 | import com.oracle.weblogic.imagetool.tests.extensions.TimingExtension; 13 | import org.junit.jupiter.api.Tag; 14 | import org.junit.jupiter.api.extension.ExtendWith; 15 | 16 | @Target({ElementType.TYPE}) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @ExtendWith(TimingExtension.class) 19 | @ExtendWith(LoggingExtension.class) 20 | @Tag("integration") 21 | public @interface IntegrationTest { 22 | } 23 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/annotations/Logger.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Target({ElementType.FIELD}) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface Logger { 14 | } 15 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/extensions/TimingExtension.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.extensions; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | import org.junit.jupiter.api.extension.AfterTestExecutionCallback; 9 | import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; 10 | import org.junit.jupiter.api.extension.ExtensionContext; 11 | 12 | public class TimingExtension implements BeforeTestExecutionCallback, AfterTestExecutionCallback { 13 | private static final String START_TIME = "start time"; 14 | private static final String EM = LoggingExtension.EM; 15 | 16 | @Override 17 | public void beforeTestExecution(ExtensionContext context) { 18 | getStore(context).put(START_TIME, System.currentTimeMillis()); 19 | } 20 | 21 | @Override 22 | public void afterTestExecution(ExtensionContext context) { 23 | long startTime = getStore(context).remove(START_TIME, long.class); 24 | long duration = System.currentTimeMillis() - startTime; 25 | long minutes = TimeUnit.MILLISECONDS.toMinutes(duration); 26 | long seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(minutes); 27 | 28 | LoggingExtension.getLogger((context.getRequiredTestClass())) 29 | .info(EM + " Test duration [{0}] method={1}: {2} min, {3} sec " + EM, 30 | context.getDisplayName(), 31 | context.getRequiredTestMethod().getName(), 32 | minutes, seconds); 33 | } 34 | 35 | private ExtensionContext.Store getStore(ExtensionContext context) { 36 | return context.getStore( 37 | ExtensionContext.Namespace.create(context.getRequiredTestClass(), context.getRequiredTestMethod())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/CommandResult.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.utils; 5 | 6 | /** 7 | * Class that holds the results of using java to exec a command (i.e. exit value, stdout and stderr) 8 | */ 9 | public class CommandResult { 10 | private int exitValue; 11 | private String stdout; 12 | 13 | public CommandResult(int exitValue, String stdout) { 14 | this.exitValue = exitValue; 15 | this.stdout = stdout; 16 | } 17 | 18 | public int exitValue() { 19 | return this.exitValue; 20 | } 21 | 22 | public String stdout() { 23 | return this.stdout; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/ImageToolCommand.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.utils; 5 | 6 | import java.nio.file.Path; 7 | import java.nio.file.Paths; 8 | 9 | /** 10 | * Helps build the imagetool command for running Image Tool in integration tests. 11 | */ 12 | public class ImageToolCommand { 13 | private String operation; 14 | 15 | protected ImageToolCommand(String operation) { 16 | this.operation = operation; 17 | } 18 | 19 | protected String field(String cli, String value) { 20 | if (value != null && !value.isEmpty()) { 21 | return " " + cli + " " + value; 22 | } else { 23 | return ""; 24 | } 25 | } 26 | 27 | protected String field(String cli, boolean value) { 28 | if (value) { 29 | return " " + cli; 30 | } else { 31 | return ""; 32 | } 33 | } 34 | 35 | public String build() { 36 | Path imagetoolPath = Paths.get("target","imagetool", "bin", "imagetool.sh"); 37 | return imagetoolPath.toString() + " " + operation; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/RebaseCommand.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, 2021, Oracle and/or its affiliates. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 | 4 | package com.oracle.weblogic.imagetool.tests.utils; 5 | 6 | public class RebaseCommand extends ImageToolCommand { 7 | private String targetImage; 8 | private String sourceImage; 9 | private String tag; 10 | 11 | public RebaseCommand() { 12 | super("rebase"); 13 | } 14 | 15 | public RebaseCommand targetImage(String value) { 16 | targetImage = value; 17 | return this; 18 | } 19 | 20 | public RebaseCommand targetImage(String name, String version) { 21 | return targetImage(name + ":" + version); 22 | } 23 | 24 | public RebaseCommand sourceImage(String value) { 25 | sourceImage = value; 26 | return this; 27 | } 28 | 29 | public RebaseCommand sourceImage(String name, String version) { 30 | return sourceImage(name + ":" + version); 31 | } 32 | 33 | public RebaseCommand tag(String value) { 34 | tag = value; 35 | return this; 36 | } 37 | 38 | /** 39 | * Generate the command using the provided command line options. 40 | * @return the imagetool command as a string suitable for running in ProcessBuilder 41 | */ 42 | @Override 43 | public String build() { 44 | return super.build() 45 | + field("--targetImage", targetImage) 46 | + field("--sourceImage", sourceImage) 47 | + field("--tag", tag); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/build-archive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | #Copyright (c) 2018, 2021, Oracle and/or its affiliates. 4 | # 5 | #Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 6 | # 7 | 8 | MODULE_DIR=$PWD 9 | ARCHIVE_DIR=target/wdt/archive 10 | EXPLODED_DIR=$ARCHIVE_DIR/wlsdeploy/applications 11 | 12 | rm -Rf $ARCHIVE_DIR 13 | mkdir -p $EXPLODED_DIR 14 | 15 | cd src/test/resources/wdt/simple-app 16 | jar cvf $MODULE_DIR/$EXPLODED_DIR/simple-app.war * 17 | cd $MODULE_DIR/$ARCHIVE_DIR 18 | jar cvf ../archive.zip * 19 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/domain.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, 2021, Oracle and/or its affiliates. 2 | # Licensed under the Universal Permissive License v 1.0 as shown at 3 | # https://oss.oracle.com/licenses/upl. 4 | 5 | # These variables are used for substitution in the WDT model file. 6 | # Any port that will be exposed through Docker is put in this file. 7 | # The sample Dockerfile will get the ports from this file and not the WDT model. 8 | DOMAIN_NAME=domain1 9 | ADMIN_PORT=7001 10 | ADMIN_NAME=admin-server 11 | ADMIN_HOST=wlsadmin 12 | MANAGED_SERVER_PORT=8001 13 | MANAGED_SERVER_NAME_BASE=managed-server- 14 | CONFIGURED_MANAGED_SERVER_COUNT=2 15 | CLUSTER_NAME=cluster-1 16 | DEBUG_PORT=8453 17 | DEBUG_FLAG=true 18 | PRODUCTION_MODE_ENABLED=true 19 | CLUSTER_TYPE=DYNAMIC 20 | JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false 21 | T3_CHANNEL_PORT=30012 22 | T3_PUBLIC_ADDRESS=kubernetes 23 | SERVER_START_MODE=prod 24 | CLUSTER_ADMIN=cluster-1,admin-server 25 | # Derby Data Source parameters 26 | dsname=DockerDS 27 | dsdbname=DerbyDB;create=true 28 | dsjndiname=DockerDS 29 | dsdriver=org.apache.derby.jdbc.ClientXADataSource 30 | dsurl=jdbc:derby://localhost:1527/DerbyDB;create=true 31 | dbusername=dba 32 | dbpassword=dba1 33 | dstestquery=SQL SELECT 1 FROM SYS.SYSTABLES 34 | dsinitalcapacity=1 35 | dsmaxcapacity=15 36 | #Derby Data Source parameters 37 | dsname=DockerDS 38 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/multi-sections.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved. 2 | // Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. 3 | 4 | [before-jdk-install] 5 | RUN echo "before-jdk-install" > /u01/beforeJDKInstall.txt 6 | 7 | [after-jdk-install] 8 | RUN echo "after-jdk-install" > /u01/afterJDKInstall.txt 9 | 10 | [before-fmw-install] 11 | RUN echo "before-fmw-install" > /u01/beforeFMWInstall.txt 12 | 13 | [after-fmw-install] 14 | RUN echo "after-fmw-install" > /u01/afterFMWInstall.txt 15 | 16 | [before-wdt-command] 17 | LABEL before-wdt-command="beforeWDTCommand" 18 | 19 | [after-wdt-command] 20 | LABEL after-wdt-command="afterWDTCommand" 21 | 22 | [final-build-commands] 23 | LABEL final-build-commands="finalBuildCommands" 24 | COPY --from=JDK_BUILD --chown=oracle:oracle /u01/beforeJDKInstall.txt /u01/afterJDKInstall.txt /u01/jdk/ 25 | COPY --from=WLS_BUILD --chown=oracle:oracle /u01/beforeFMWInstall.txt /u01/afterFMWInstall.txt /u01/oracle/ 26 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-app/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | /simple.html 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-app/WEB-INF/weblogic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /simple 5 | 6 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-app/simple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple Application 4 | 5 | 6 |

    Simple Application

    7 |

    This is the simple application.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-topology.yaml: -------------------------------------------------------------------------------- 1 | domainInfo: 2 | AdminUserName: weblogic 3 | AdminPassword: welcome1 4 | ServerStartMode: '@@PROP:SERVER_START_MODE@@' 5 | topology: 6 | Name: '@@PROP:DOMAIN_NAME@@' 7 | AdminServerName: '@@PROP:ADMIN_NAME@@' 8 | ProductionModeEnabled: '@@PROP:PRODUCTION_MODE_ENABLED@@' 9 | Cluster: 10 | '@@PROP:CLUSTER_NAME@@': 11 | ClientCertProxyEnabled: true 12 | DynamicServers: 13 | ServerTemplate: template1 14 | CalculatedListenPorts: false 15 | ServerNamePrefix: '@@PROP:MANAGED_SERVER_NAME_BASE@@' 16 | DynamicClusterSize: '@@PROP:CONFIGURED_MANAGED_SERVER_COUNT@@' 17 | MaxDynamicClusterSize: '@@PROP:CONFIGURED_MANAGED_SERVER_COUNT@@' 18 | Server: 19 | '@@PROP:ADMIN_NAME@@': 20 | ListenPort: '@@PROP:ADMIN_PORT@@' 21 | NetworkAccessPoint: 22 | T3Channel: 23 | ListenAddress: None 24 | ListenPort: '@@PROP:T3_CHANNEL_PORT@@' 25 | PublicAddress: '@@PROP:T3_PUBLIC_ADDRESS@@' 26 | PublicPort: '@@PROP:T3_CHANNEL_PORT@@' 27 | ServerTemplate: 28 | template1: 29 | ListenPort: '@@PROP:MANAGED_SERVER_PORT@@' 30 | appDeployments: 31 | Application: 32 | # Quote needed because of hyphen in string 33 | 'simple-app': 34 | SourcePath: 'wlsdeploy/applications/simple-app.war' 35 | Target: '@@PROP:CLUSTER_NAME@@' 36 | ModuleType: war 37 | StagingMode: nostage 38 | PlanStagingMode: nostage 39 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-topology1.yaml: -------------------------------------------------------------------------------- 1 | domainInfo: 2 | AdminUserName: weblogic 3 | AdminPassword: welcome1 4 | ServerStartMode: prod 5 | RCUDbInfo: 6 | rcu_prefix: wdt1 7 | rcu_schema_password: Oradoc_db1 8 | rcu_admin_password: Oradoc_db1 9 | rcu_db_conn_string: '%DB_HOST%:1521/InfraPDB1.us.oracle.com' 10 | topology: 11 | Name: domain1 12 | AdminServerName: 'admin-server' 13 | ProductionModeEnabled: true 14 | Cluster: 15 | cluster1: 16 | ClientCertProxyEnabled: true 17 | DynamicServers: 18 | ServerTemplate: template1 19 | CalculatedListenPorts: false 20 | ServerNamePrefix: 'ms-' 21 | DynamicClusterSize: 2 22 | MaxDynamicClusterSize: 2 23 | Server: 24 | 'admin-server': 25 | ListenPort: 7001 26 | NetworkAccessPoint: 27 | T3Channel: 28 | ListenAddress: None 29 | ListenPort: 30012 30 | PublicAddress: kubernetes 31 | PublicPort: 30012 32 | ServerTemplate: 33 | template1: 34 | ListenPort: 8001 35 | appDeployments: 36 | Application: 37 | # Quote needed because of hyphen in string 38 | 'simple-app': 39 | SourcePath: 'wlsdeploy/applications/simple-app.war' 40 | Target: cluster1 41 | ModuleType: war 42 | StagingMode: nostage 43 | PlanStagingMode: nostage 44 | -------------------------------------------------------------------------------- /tests/src/test/resources/wdt/simple-topology2.yaml: -------------------------------------------------------------------------------- 1 | domainInfo: 2 | AdminUserName: weblogic 3 | AdminPassword: welcome1 4 | ServerStartMode: prod 5 | topology: 6 | Name: domain1 7 | AdminServerName: 'admin-server' 8 | ProductionModeEnabled: true 9 | Cluster: 10 | cluster1: 11 | ClientCertProxyEnabled: true 12 | DynamicServers: 13 | ServerTemplate: template2 14 | CalculatedListenPorts: false 15 | ServerNamePrefix: 'ms-' 16 | DynamicClusterSize: 2 17 | MaxDynamicClusterSize: 2 18 | Server: 19 | 'admin-server': 20 | ListenPort: 7001 21 | NetworkAccessPoint: 22 | T3Channel: 23 | ListenAddress: None 24 | ListenPort: 30012 25 | PublicAddress: kubernetes 26 | PublicPort: 30012 27 | ServerTemplate: 28 | template2: 29 | ListenPort: 9001 30 | -------------------------------------------------------------------------------- /wit.wptg: -------------------------------------------------------------------------------- 1 | Languages: Std_Admin 2 | 3 | imagetool/src/main/resources 4 | ImageTool%j.properties FileType: Javaproperties 5 | --------------------------------------------------------------------------------