Skip to content

Commit

Permalink
Red wash (#63)
Browse files Browse the repository at this point in the history
* init

* add devcontainer

* use ms dind

* copy plugins works

* spelling and comments
  • Loading branch information
huangjien authored Nov 21, 2023
1 parent a4e9078 commit d7ee1fc
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): bookworm, buster, bullseye
ARG VARIANT="bullseye"
# FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/base:${VARIANT}
FROM mcr.microsoft.com/devcontainers/base:${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "molecule",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
//"image": "mcr.microsoft.com/devcontainers/java:8",
"runArgs": [
"--env-file", "${localWorkspaceFolder}/.devcontainer/.env"
],
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/jfrog-cli-npm:1": {},
"ghcr.io/devcontainers/features/python:1": {}
},

"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/git",
"ghcr.io/devcontainers/features/github-cli:1",
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1",
"ghcr.io/devcontainers-contrib/features/zsh-plugins",
"ghcr.io/devcontainers/features/docker-in-docker"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ play.yml
ansible_collections
.DS_Store
bin/
.devcontainer/.env

33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A collection of Middleware modules and roles required for installing Cúram Soci
## Overview

Collections are a distribution format for Ansible content. You can use collections to package and distribute playbooks, roles, modules, and plugins.
You can publish and use collections through `Ansible Galaxy <https://galaxy.ansible.com/ibm>`.
You can publish and use collections through `Ansible Galaxy <https://galaxy.ansible.com/merative>`.

Assumption for having collection as a repo, is it enable reuse of content as well, such repo can be easily used separately by just adding `ansible.cfg`.

Expand Down Expand Up @@ -41,3 +41,34 @@ and other tools need in order to package, build and publish the collection::
### Useful links

* https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html

### Use Dev Container

If you have installed docker and VS Code on your machine, please add extension **Dev Containers** to VS Code, then you can use it to quickly setup your local development environment.

1. Add **.env** file under folder **.devcontainer** , you can put environment variables in it, these env vars will appear in the docker container. And **.env** has been put in the .gitignore, so you can put secrets in it, it will not be merge to github repo. Content of it:

```
ARTIFACTORY_URL=[artifactory url]
ARTIFACTORY_REPO=[repo contains software installer]
ARTIFACTORY_TOKEN=[token of artifactory]
LOCAL_PATH=/workspaces/spm-middleware
```
2. After the dev container startup, you need to:

a. install python packages
```
pip install -r requirements.txt
```
b. copy ansible plugins for molecule test
```
mkdir -p /home/vscode/.ansible/plugins/
cp -r plugins/* /home/vscode/.ansible/plugins/
```
3. Then you can test if molecule works correctly:
```
molecule test -s websphere-v90-rockylinux8
```
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: spm_middleware

# The version of the collection. Must be compatible with semantic versioning
# Please note. version also exists in /github/workflows/release.yml and will need to be update also
version: 1.3.1
version: 1.4.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down

0 comments on commit d7ee1fc

Please sign in to comment.