Skip to content

Commit

Permalink
AMW-103 Devfile for Ansible Middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
RanabirChakraborty authored and rpelisse committed Jul 15, 2024
1 parent 8e22a47 commit 71b7eeb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
4 changes: 0 additions & 4 deletions README

This file was deleted.

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# wildfly-cluster-demo

A demo to setup a simple Wildfly (or EAP) cluster using the Ansible Wildfly collection.

## How to use devfile to setup your dev environment

To use the `devfile.yaml` and set up your development environment with OpenShift Dev Spaces or Visual Studio Code, follow these steps:

1. **Clone the Repository**

```sh
git clone https://github.com/ansible-middleware/wildfly-cluster-demo.git
cd wildfly-cluster-demo
```
2. **Install OpenShift Dev Spaces or Visual Studio Code**

- Download and install [OpenShift Dev Spaces](https://access.redhat.com/products/red-hat-openshift-dev-spaces), else you can directly use Dev Spaces from [Red Hat Developer Snadbox](https://console.redhat.com/openshift/sandbox) as well.
- Download and install [Visual Studio Code](https://code.visualstudio.com/).

3. 1. **Open the Red Hat Dev Spaces(If you Red Hat subscription use this)**

- Select `Red Hat Dev Spaces` option from above provided Red hat Developer Sandbox link.
- Put [wildfly-cluster-demo](https://github.com/ansible-middleware/wildfly-cluster-demo.git) Git repo URL in the `Import from Git` option and click on `Create & Open`.

2. **Open the Project in Visual Studio Code**

- Open Visual Studio Code.
- Open the project folder you cloned: `File > Open Folder...` and select the project directory.
- Once the folder is open, click on the green button in the bottom-left corner (`><`) and select `New Dev Container`.
Both options will use the `devfile.yaml` to configure and start the development container. You can then start coding and run the playbook within this environment, without worrying about the prerequisite setup.
36 changes: 36 additions & 0 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
schemaVersion: 2.1.0

metadata:
name: wildfly-demo
attributes:
controller.devfile.io/storage-type: ephemeral

projects:
- name: wildfly-cluster-demo
git:
remotes:
origin: "https://github.com/ansible-middleware/wildfly-cluster-demo.git"

components:
- name: tooling-container
container:
image: ghcr.io/ansible/ansible-workspace-env-reference:v24.6.3
memoryRequest: 256M
memoryLimit: 6Gi
cpuRequest: 250m
cpuLimit: 2000m
args: ['tail', '-f', '/dev/null']
env:
- name: 'ANSIBLE_COLLECTIONS_PATH'
value: '~/.ansible/collections:/usr/share/ansible/collections:/projects/ansible-devspaces-demo/collections'

commands:
- id: install-requirements
exec:
component: tooling-container
commandLine: "ansible-galaxy install -r molecule/default/requirements.yml"
workingDir: "${PROJECTS_ROOT}/wildfly-cluster-demo"
label: Install required collections.
events:
postStart:
- "install-requirements"

0 comments on commit 71b7eeb

Please sign in to comment.