Skip to content

Commit

Permalink
copy plugins works
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjien committed Nov 16, 2023
1 parent 0e8a4aa commit e0685f8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"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": ".."
Expand Down
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

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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 install 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 foler **.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 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
```

0 comments on commit e0685f8

Please sign in to comment.