diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..462c4a0 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,48 @@ +name: github pages + +on: + workflow_dispatch: + push: + branches: [main] + paths-ignore: + - "README.adoc" + - ".gitignore" + +permissions: + pages: write + id-token: write + +concurrency: + group: gh-pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: configure pages + uses: actions/configure-pages@v5 + - name: setup node + uses: actions/setup-node@v4 + with: + node-version: 20.13.1 + - name: install antora + run: npm install --global @antora/cli@3.1 @antora/site-generator@3.1 + - name: antora generate + run: antora generate default-site.yml --stacktrace + - name: upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: www + deploy: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: deploy github pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01d9a8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Ignore macOS system files +.DS_Store + +# Ignore node_modules directory +node_modules/ + +# Ignore build output +www/ +.cache/ + +# Ignore IDE and editor files +.vscode/ +.idea/ + +# Ignore logs and temporary files +*.log +*.tmp + +# Ignore environment-specific files +.env +.env.local +.env.*.local + +# Ignore sensitive or private information +secrets.json + +# Ignore compiled binaries or executables +*.exe +*.dll +*.so +*.dylib +*.core + +# Ignore package-lock.json for npm +package-lock.json + +# Ignore yarn.lock for Yarn +yarn.lock diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..32ba1f9 --- /dev/null +++ b/README.adoc @@ -0,0 +1,109 @@ +=== Getting Started + +This template is designed to be used as a base for your showroom lab guides. + +The content is built using Antora, a static site generator for creating documentation sites from AsciiDoc documents. + +This git repo template was created to make it easy for you to start developing your lab instructions. + +Features: + +. 0% cruft +. Red Hat Demo Platform UI Bundle default +. Dev Mode extension that displays the asciidoc attributes you have to work with +. Content is generated using Antora, a static site generator for creating documentation sites from AsciiDoc documents. + +== Getting Started + +=== Using Containers (Recommended) + +In order to test and develop on your local machine, you can use a specially built container with Podman or Docker as follows. + +. Create a git repo from this template +.. Suggested naming: `showroom_` +. Clone your new repo and `cd` into it +. When you make changes to the content, all you need is to kill the container and run it again. ++ +[source,sh] +---- +podman run --rm --name antora -v $PWD:/antora -p 8080:8080 -i -t ghcr.io/juliaaano/antora-viewer +---- + +For SELinux environments, `:z` may need to be appended to the volume mount: + +---- +podman run --rm --name antora -v $PWD:/antora:z -p 8080:8080 -i -t ghcr.io/juliaaano/antora-viewer +---- + +Live-reload is not supported. + +=== Using Local Files (Less Recommended) + +. Create a git repo from this template +. Clone the repo and `cd` into it +. Run ./utilities/lab-serve +. Open http://localhost:8080 in your browser +. Run ./utilities/lab-build to build your html + +To rebuild your html, run `./utilites/build`. + +== Editing Files + +Now you are ready to go! +You can start editing the files in the `content/modules/ROOT/pages/` directory. + +Many modern editors such as Visual Studio Code offer live Asciidoc Preview extensions. + +=== Understanding the Basic Template Directory Structure + +[source,sh] +---- +./content/modules/ROOT/ +├── assets +│ └── images # Images used in your content +│ └── example-image.png +├── examples # You can add downloadable assets here +│ └── example-bash-script.sh # e.g. an example bash script +├── nav.adoc # Navigation for your lab +├── pages # Your content goes here +│ ├── index.adoc # First page of your lab, e.g. overview etc +│ ├── module-01.adoc +│ └── module-02.adoc # Sample lab has 2 modules including index.adoc +└── partials # You can add partials here, reusable content inserted inline into your modules + └── example_partial.adoc +---- + +== Adding Additional Links + +You can add links to external content in the convenient "Links" drop-down on the upper-right of the Showroom Summit 2024 UI. + +../content/antora.yml +[source,yaml] +---- +asciidoc: + attributes: + page-links: + - url: https://redhat.com + text: Red Hat +---- + +image::ui-links.png[] + +== Dev Mode + +As a convenience to developers, the Dev Mode Extention (disabled by default) displays the asciidoc attributes you have to work with while writing your lab instructions. + +. Disable/Enable Dev Mode by changing `enabled: true` or `enabled: false` ++ +.default-site.yml +[source,yaml] +---- +extensions: + - id: dev-mode + require: ./content/lib/dev-mode.js + enabled: false +---- + +. Produces ++ +image::dev-mode.png[] diff --git a/content/antora.yml b/content/antora.yml new file mode 100644 index 0000000..e4b2845 --- /dev/null +++ b/content/antora.yml @@ -0,0 +1,19 @@ +name: modules +title: Default Title +version: master +nav: + - modules/ROOT/nav.adoc + +asciidoc: + attributes: + lab_name: "I'm the lab_name var" + release-version: master + page-pagination: true + my_var: "foo" + guid: my-guid + ssh_user: devops + ssh_password: devops + ssh_command: ssh someone@example.com + page-links: + - url: https://redhat.com + text: Red Hat diff --git a/content/lib/all-attributes-console-extension.js b/content/lib/all-attributes-console-extension.js new file mode 100644 index 0000000..cca7f04 --- /dev/null +++ b/content/lib/all-attributes-console-extension.js @@ -0,0 +1,35 @@ +module.exports.register = function () { + this.once('contentClassified', ({ playbook, contentCatalog }) => { + const newPage = contentCatalog.addFile({ + contents: Buffer.from('= New Page\n\nThis is the contents of a generated page.'), + path: 'content/modules/ROOT/pages/new-page.adoc', + version: '3.1', + src: { + path: 'content/modules/ROOT/pages/new-page.adoc', + component: 'antora', + version: '3.1', + module: 'ROOT', + family: 'page', + relative: 'new-page.adoc', + },}) + console.log('site-wide attributes (as defined in playbook)') + console.log(playbook.asciidoc.attributes) + contentCatalog.getComponents().forEach((component) => { + component.versions.forEach((componentVersion) => { + getUniqueOrigins(contentCatalog, componentVersion).forEach((origin) => { + console.log(`${componentVersion.version}@${componentVersion.name} attributes (as defined in antora.yml)`) + console.log(origin.descriptor.asciidoc?.attributes || {}) + }) + }) + }) + }) +} + +function getUniqueOrigins (contentCatalog, componentVersion) { + return contentCatalog.findBy({ component: componentVersion.name, version: componentVersion.version }) + .reduce((origins, file) => { + const origin = file.src.origin + if (origin && !origins.includes(origin)) origins.push(origin) + return origins + }, []) +} diff --git a/content/lib/attributes-page-extension.js b/content/lib/attributes-page-extension.js new file mode 100644 index 0000000..e1eafcd --- /dev/null +++ b/content/lib/attributes-page-extension.js @@ -0,0 +1,16 @@ +module.exports.register = function ({ config }) { + this.once('contentClassified', ({ contentCatalog }) => { + const newPage = contentCatalog.addFile({ + contents: Buffer.from('= New Page\n\nThis is the contents of a generated page.'), + path: 'content/modules/ROOT/pages/new-page.adoc', + src: { + path: 'content/modules/ROOT/pages/new-page.adoc', + component: 'antora', + version: '3.1', + module: 'ROOT', + family: 'page', + relative: 'new-page.adoc', + }, + }) + }) +} diff --git a/content/lib/dev-mode.js b/content/lib/dev-mode.js new file mode 100644 index 0000000..a955be4 --- /dev/null +++ b/content/lib/dev-mode.js @@ -0,0 +1,85 @@ +'use strict' + +module.exports.register = function ({ config }) { + this.once('contentClassified', ({ playbook, contentCatalog }) => { + var pageDetails = {} + console.log('site-wide attributes (as defined in playbook)') + console.log(playbook.asciidoc.attributes) + let fileContents = "== Site Wide Attributes\n\n" + fileContents += `${playbook.asciidoc.attributes || {}}\n` + contentCatalog.getComponents().forEach((component) => { + component.versions.forEach((componentVersion) => { + getUniqueOrigins(contentCatalog, componentVersion).forEach((origin) => { + console.log(`${componentVersion.version}@${componentVersion.name} attributes (as defined in antora.yml)`) + pageDetails = { version: `${componentVersion.version}`, name: `${componentVersion.name}` } + console.log(origin.descriptor.asciidoc?.attributes || {}) + fileContents += `== Component Wide Attributes\n\n` + fileContents += `Antora component version@name: \`${componentVersion.version}@${componentVersion.name}\`\n\n` + fileContents += `[source,json]\n----\n` + fileContents += JSON.stringify(origin.descriptor.asciidoc?.attributes || {}, null, 2) + fileContents += `\n----\n` + }) + }) + }) + const newPage = contentCatalog.addFile({ + contents: Buffer.from('= Attributes Page\n\nTo disable Dev Mode (this page) comment out the dev-mode.js extenion in the playbook (usually default-site.yml)\n\n' + fileContents), + path: 'modules/ROOT/pages/attrs-page.adoc', + src: { + path: 'modules/ROOT/pages/attrs-page.adoc', + component: pageDetails.name, + version: pageDetails.version, + // component: pageDetails.name || 'modules', + // version: pageDetails.version || 'master', + module: 'ROOT', + family: 'page', + relative: 'attrs-page.adoc', + }, + }) + }) + // add new page to navigation + this.on('navigationBuilt', ({ contentCatalog }) => { + const { addToNavigation = true, devPagesHeading = 'Dev Mode' } = config + const logger = this.getLogger('dev-pages-extension') + contentCatalog.getComponents().forEach(({ versions }) => { + versions.forEach(({ name: component, version, navigation: nav, url: defaultUrl }) => { + const navEntriesByUrl = getNavEntriesByUrl(nav) + const unlistedPages = contentCatalog + .findBy({ component, version, family: 'page' }) + .filter((page) => page.out) + .reduce((collector, page) => { + if ((page.pub.url in navEntriesByUrl) || page.pub.url === defaultUrl) return collector + // logger.warn({ file: page.src, source: page.src.origin }, 'detected unlisted dev page') + return collector.concat(page) + }, []) + if (unlistedPages.length && addToNavigation) { + nav.push({ + content: devPagesHeading, + items: unlistedPages.map((page) => { + // logger.warn({ content: page, url: page.pub.url }, 'unlisted dev page details') + const navtitle = page.asciidoc.navtitle || page.src.stem + return { content: navtitle, url: page.pub.url, urlType: 'internal' } + }), + root: true, + }) + } + }) + }) + }) +} + +function getUniqueOrigins (contentCatalog, componentVersion) { + return contentCatalog.findBy({ component: componentVersion.name, version: componentVersion.version }) + .reduce((origins, file) => { + const origin = file.src.origin + if (origin && !origins.includes(origin)) origins.push(origin) + return origins + }, []) +} + +function getNavEntriesByUrl (items = [], accum = {}) { + items.forEach((item) => { + if (item.urlType === 'internal') accum[item.url.split('#')[0]] = item + getNavEntriesByUrl(item.items, accum) + }) + return accum +} diff --git a/content/lib/unlisted-pages-extension.js b/content/lib/unlisted-pages-extension.js new file mode 100644 index 0000000..0689f07 --- /dev/null +++ b/content/lib/unlisted-pages-extension.js @@ -0,0 +1,39 @@ +module.exports.register = function ({ config }) { + const { addToNavigation, unlistedPagesHeading = 'Unlisted Pages' } = config + const logger = this.getLogger('unlisted-pages-extension') + this + .on('navigationBuilt', ({ contentCatalog }) => { + contentCatalog.getComponents().forEach(({ versions }) => { + versions.forEach(({ name: component, version, navigation: nav, url: defaultUrl }) => { + const navEntriesByUrl = getNavEntriesByUrl(nav) + const unlistedPages = contentCatalog + .findBy({ component, version, family: 'page' }) + .filter((page) => page.out) + .reduce((collector, page) => { + if ((page.pub.url in navEntriesByUrl) || page.pub.url === defaultUrl) return collector + logger.warn({ file: page.src, source: page.src.origin }, 'detected unlisted page') + return collector.concat(page) + }, []) + if (unlistedPages.length && addToNavigation) { + nav.push({ + content: unlistedPagesHeading, + items: unlistedPages.map((page) => { + logger.warn({ content: page, url: page.pub.url }, 'unlisted page details') + const navtitle = page.asciidoc.navtitle || page.src.stem + return { content: navtitle, url: page.pub.url, urlType: 'internal' } + }), + root: true, + }) + } + }) + }) + }) +} + +function getNavEntriesByUrl (items = [], accum = {}) { + items.forEach((item) => { + if (item.urlType === 'internal') accum[item.url.split('#')[0]] = item + getNavEntriesByUrl(item.items, accum) + }) + return accum +} diff --git a/content/modules/ROOT/assets/images/rhel-logo-black.jpg b/content/modules/ROOT/assets/images/rhel-logo-black.jpg new file mode 100644 index 0000000..269524a Binary files /dev/null and b/content/modules/ROOT/assets/images/rhel-logo-black.jpg differ diff --git a/content/modules/ROOT/nav.adoc b/content/modules/ROOT/nav.adoc new file mode 100644 index 0000000..dd66021 --- /dev/null +++ b/content/modules/ROOT/nav.adoc @@ -0,0 +1,7 @@ +* xref:module-01.adoc[1. RPM Native Container] +** xref:module-01.adoc#repositories[Repositories] +** xref:module-01.adoc#software[Software] + +* xref:module-02.adoc[2. GitHub Sourced Container] +** xref:module-02.adoc#prerequisites[Install Prerequisites] +** xref:module-02.adoc#container[Enable Container] diff --git a/content/modules/ROOT/pages/index.adoc b/content/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..0129d84 --- /dev/null +++ b/content/modules/ROOT/pages/index.adoc @@ -0,0 +1,43 @@ += {lab_name} + +The `lab_name` var, known as an asciidoc attribute, above was set in `./content/antora.yml` and can be used to set the lab_name or title of your content. +You are both free to change its value and if you prefer to use a different var name, you can change the value of `lab_name`, for example to `title` in `./content/antora.yml` and then reference it in your content as `\{title}`. + + +image::rhel-logo-black.jpg[rhel-logo-black,55%,55%] + +== Variables + +Other vars can also be set there, such as `ssh_user` and `ssh_password`, and referenced inline in the lab content by using the `\{foo}` syntax. + +This is another var, or asciidoc attribute, from `./content/antora.yml` {my_var} + +== Writing your lab + +Whatever type of content you are writing we'll refer to your *content* as "your lab" in this document. + +=== Lab structure + +Wether you are writing a lab + +* First, we will build a monolithic application already compiled as RPM packages and put it into a container. This will allow us to deploy the application, copy it between machines, and update it separately from the operating system. This process affords us a portable and easily maintained component instead of tightly coupling the application with your operating system maintenance. + +* In closing we will build a second container on a different operating system version that makes an application not packaged into RPMs. This will be similar to a web application deployment, positioning the correct files at the right locations. To do this, we will pull a project from GitHub and position the component files within our container image. The purpose of this is to achieve a portable application container that can deploy on several different versions of Red Hat Enterprise Linux. This also provides the benefit of decoupling your application maintenance, which would all happen by building new containers versus operating system maintenance. The container is no longer reliant on the operating system installed on the machine where the application is deployed. + +. Now let's examine this cluster a bit more by describing the cluster (the `$GUID` environment variable is already set for you so you can immediately describe your individual cluster): ++ +[source,sh,role=execute] +---- +podman ps +---- ++ +.Sample Output +[source,texinfo,subs="attributes"] +---- +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +2dcfee9e50c4 docker.io/library/httpd:2.4 httpd-foreground 3 hours ago Up 3 hours 0.0.0.0:8080->80/tcp showroom-httpd +---- + +=== Lab Access + +The terminal window to your right is *already* logged into the lab environment as the `{ssh_user}` user via `ssh`. +All steps of this lab are to be completed as the `{ssh_user}` user. diff --git a/content/modules/ROOT/pages/module-01.adoc b/content/modules/ROOT/pages/module-01.adoc new file mode 100644 index 0000000..880800c --- /dev/null +++ b/content/modules/ROOT/pages/module-01.adoc @@ -0,0 +1,149 @@ += Building an Application with rpms + +== Downloading the UBI + +In this lab, you will be installing software into the container +image running as an interactive application. To do this you will +need `yum`, but do not need `systemd` for managing services within the +container environment. For that reason, you will be using the *Standard* +UBI image (as opposed to the Minimal or Multi-service images). + +Using the "buildah from" command will download and meld the container image. This particular image we are using is the Red Hat Universal Base Image or UBI. From the ourput of the command, you will notice that we are pulling down the latest one, which is for RHEL 9. + +. Execute the download the Standard UBI +image from Red Hat's registry. + ++ +[source,sh,role=execute] +---- +buildah from registry.access.redhat.com/ubi9/ubi +---- + +[#repositories] +== Installing Repositories +In this lab, you are going to containerize a software package that is already +packaged in RPM format and stored in the Extra Packages for Enterprise Linux +(EPEL) repository. + +Software often has requirements for prerequisite software that must be installed +on the machine for it to work properly. `yum` will resolve those +dependencies for you, as long as it can locate the required packages in +repositories defined on the machine. The Red Hat Universal Base Image (UBI) +downloaded in the previous step has access to some Red Hat Enterprise Linux +repositories. However, the target package for the lab is from EPEL. + +. In the command below, `buildah` is going to run a command on the +`ubi-working-container` image. The `--` indicates that the command should be +executed from within the container, which means the results will be applied into +the container image. Lastly, you are providing the `yum` command to install a +package that defines all of the repositories from EPEL, `epel-release-latest-9`. + ++ +[source,bash] +---- +buildah run ubi-working-container -- yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +---- + + +. You can verify that the above command did not install the RPM on the host system. + ++ +[source,bash] +---- +rpm -q epel-release +---- + +NOTE: If your repository configurations are not distributed as an RPM, but instead as +individual `.repo` files, you could use the `buildah copy` command to copy +files from the host operating system into the container image. You will see +an example of using `buildah copy` later in this lab. + +[#software] +== Installing Software + + +. Now that the yum repositories are defined within the container, execute +another `yum install`, within the container, to install the target +software: `moon-buggy`. + ++ +[source,bash] +---- +buildah run ubi-working-container -- yum -y install moon-buggy +---- + + +== Committing the Container Image + +. At this point, the container is configured. It is time to transition from a +working container into a committed image. In the command below, you will use +the `buildah` command to commit the working container to an image called: +`moon-buggy`. + ++ +[source,bash] +---- +buildah commit ubi-working-container moon-buggy +---- + ++ +. The output of `podman image list` should confirm the image was created. + ++ +[source,bash] +---- +podman image list +---- + + +== Deploy the Container + +Now the software has been installed and a new container image created. It is +time to spawn a runtime of the container image and validate the software. The +software we are using is a command line command. + +. When you `run` the container, +it will be in interactive (`-it`) mode, based on the `moon-buggy` container +image and the command run interactively will be `/usr/bin/moon-buggy`. + ++ +[source,bash] +---- +podman run -it moon-buggy /usr/bin/moon-buggy +---- + ++ +[source,textinfo] +---- + +<<< OUTPUT ABRIDGED >>> + MM MM OOOOO OOOOO NN N + M M M M O O O O N N N + M M M M O O O O N N N + M M M O O O O N N N + M M O O O O N N N + M M OOOOO OOOOO N NN + + BBBBBB U U GGGGG GGGGG Y Y + B B U U G G G G Y Y + BBBBBB U U G G Y Y + B B U U G GGG G GGG Y + B B U U G G G G Y + BBBBBB UUUUU GGGGG GGGGG YY + +<<< OUTPUT ABRIDGED >>> +---- + +. You can now play the Moon Buggy game, which is a text-based version of the +popular Moon Patrol. When you are finished, use the `q` command to quit the +game, which will terminate the container. + ++ +Alternatively, you can use `podman` to kill the running container from +*Terminal 2*. + ++ +[source,bash] +---- +podman kill $(podman ps | grep -v CONTAINER | cut -f1 -d" " ) +---- diff --git a/content/modules/ROOT/pages/module-02.adoc b/content/modules/ROOT/pages/module-02.adoc new file mode 100644 index 0000000..f92086a --- /dev/null +++ b/content/modules/ROOT/pages/module-02.adoc @@ -0,0 +1,138 @@ += Managing an Application from GitHub + +In the first half of this workshop, we packaged an application into this portable container format manually using rpms. +In the second half, we will consider that you may want to manage software from GitHub or some kind of software versioning application. +Rather than installing rpms, we have individual software files and pull them out of that version control into a group of systems. + +== Install RHEL 8 UBI + +In this lab, we will be using a different Red Hat Enterprise Linux version in my container. + +. Verify the host system release + ++ +[source,bash] +---- +cat /etc/redhat-release +---- ++ +NOTE: The `bastion` system is Red Hat Enterprise Linux 9, and when you built the previous container, you used the UBI9 image. This means both the image and the container were built off the same Red Hat Enterprise Linux packages. + +. As we did previously in this lab, Use `buildah from` to pull down the Red Hat Enterprise Linux 8 UBI. + ++ +[source,bash] +---- +buildah from registry.access.redhat.com/ubi8/ubi +---- + +NOTE: Because you already pulled one image named `ubi-working-container` this one is called `ubi-working-container-1`. + +[#prerequisites] +== Install Prerequisites + +Now that you have a working container, you will use the same process as before installing all the prerequisites, changing config files, and manipulating the contents of this container to be in the desired state. + +The software you will install is a JavaScript-based game that runs on a web browser. As before in the lab, use dnf to install software inside the container. + +. Use `buildah run` and install Apache (`httpd`) into the `ubi-working-container-1` container. ++ +[source,bash] +---- +buildah run ubi-working-container-1 -- dnf -y install httpd +---- + +== Enable Service + +The next thing to do is to use a systemctl to enable the service. The ubi-init provides full systemd service to the container. +This will start up any of the services that are enabled. + +. Enable the `httpd` service using `buildah run` + ++ +[source,bash] +---- +buildah run ubi-working-container-1 -- systemctl enable httpd +---- + +NOTE: The UBI standard image doesn't have systemd installed on it by default. The `ubi-init` container image does include systemd. Plan accordingly to which image you use to build applications. + +== Explore Source Materials + +A GitHub repository has already been synchronized to `/home/devops/clumsy-bird/` This repository contains the configurations for your application. + +. Verify the repository is cloned inside the `/home/devops/` directory ++ +[source,bash] +---- +cd /home/devops/ +---- + ++ +[source,bash] +---- +git clone https://github.com/ellisonleao/clumsy-bird +---- ++ +NOTE: The output states that the software has already been checked out. ++ +. Explore the JavaScript contents, index files, and everything else that we need for this web-based JavaScript software. ++ +[source,bash,role=execute] +---- +ls clumsy-bird +---- + +== Add Source Materials to Container + +. Now that you have verified the source materials exist, you will put the software inside of my container image using the `buildah copy` command. ++ +[source,bash] +---- +buildah copy ubi-working-container-1 clumsy-bird /var/www/html +---- + +[#container] +== Enable Container in Background + +In the previous section of this lab, you ran the game natively through interactive mode. Because you are now building a web application you will need to run the container in the background and access it through a web address. + +. Execute `buildah config` to specify a port and initialize the container. + ++ +[source,bash] +---- +buildah config --port 80 --cmd "/usr/sbin/init" ubi-working-container-1 +---- + +NOTE: The command makes a configuration change to this container. I'm configuring this container to accept connections to its port 80. When the container starts up, it should run the init command, which, in this case, is going to be the Apache daemon right from earlier when I enabled it. + +== Commit Container and Deploy + +. Now that we have a container in a working configured state, it is time to make that permanent by committing it to a container image called `clumsy-bird` ++ +[source,bash] +---- +buildah commit ubi-working-container-1 clumsy-bird +---- + +. Verify that the image was created with `podman` ++ +[source,bash] +---- +podman images +---- ++ +. Run the container Now it's time to run the container. ++ +[source,bash] +---- +podman run -d -p 8500:80 clumsy-bird +---- + +== Verify Application + +Verify that the application is running by navigating to + +http://bastion.{guid}.example.opentlc.com:8500 + diff --git a/default-site.yml b/default-site.yml new file mode 100644 index 0000000..df324a0 --- /dev/null +++ b/default-site.yml @@ -0,0 +1,32 @@ +--- +site: + title: Showroom Template Demo + url: https://redhat-scholars.github.io/course-template + start_page: modules::index.adoc + +content: + sources: + - url: . + start_path: content + +ui: + bundle: + url: https://github.com/rhpds/rhdp_showroom_theme/releases/download/v0.0.1/ui-bundle.zip + snapshot: true + supplemental_files: + - path: ./content/supplemental-ui + - path: ./content/lib + - path: .nojekyll + - path: ui.yml + contents: "static_files: [ .nojekyll ]" + +runtime: + cache_dir: ./.cache/antora + +antora: + extensions: + - require: ./content/lib/dev-mode.js + enabled: true + +output: + dir: ./www diff --git a/dev-mode.png b/dev-mode.png new file mode 100644 index 0000000..4e7195b Binary files /dev/null and b/dev-mode.png differ diff --git a/ui-links.png b/ui-links.png new file mode 100644 index 0000000..fb77e9c Binary files /dev/null and b/ui-links.png differ diff --git a/utilities/lab-build b/utilities/lab-build new file mode 100755 index 0000000..9896550 --- /dev/null +++ b/utilities/lab-build @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# + +echo "Starting build process..." +echo "Removing old site..." +rm -rf ./www/* +echo "Building new site..." + +podman run --rm --name showroom-builder --platform linux/amd64 \ + -v "./:/antora:z" \ + docker.io/antora/antora --stacktrace default-site.yml + +echo "Build process complete. Check the ./www folder for the generated site." +echo "To view the site locally, run the following command: utilities/lab-serve" +echo "If already running then browse to http://localhost:8080/index.html" diff --git a/utilities/lab-clean b/utilities/lab-clean new file mode 100755 index 0000000..a726f11 --- /dev/null +++ b/utilities/lab-clean @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# + +echo "Removing old site..." +rm -rf ./www/* +echo "Old site removed" diff --git a/utilities/lab-serve b/utilities/lab-serve new file mode 100755 index 0000000..3b4f8df --- /dev/null +++ b/utilities/lab-serve @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# + +echo "Starting serve process..." +# TODO: Add case statement to allow stopping, starting, and restarting +# TODO: Add logic to detect both podman and docker, if both are installed, use podman as default "first found" + +podman run -d --rm --name showroom-httpd -p 8080:8080 \ + -v "./www:/var/www/html/:z" \ + registry.access.redhat.com/ubi9/httpd-24:1-301 + +echo "Serving lab content on http://localhost:8080/index.html" \ No newline at end of file diff --git a/utilities/lab-stop b/utilities/lab-stop new file mode 100755 index 0000000..cc97e36 --- /dev/null +++ b/utilities/lab-stop @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# + +echo "Stopping serve process..." +podman kill showroom-httpd +echo "Stopped serve process." \ No newline at end of file