Skip to content

Commit

Permalink
Devcontainer - Change Ansible to 2.16 and fix CMCI int test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Latham authored and andrewhughes101 committed Oct 30, 2024
1 parent 0579e81 commit 48ca977
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
19 changes: 4 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
"remoteUser": "root",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/collections/ansible_collections/ibm/ibm_zos_cics,type=bind",
"workspaceFolder": "/workspace/collections",
"postAttachCommand": "bash /workspace/collections/ansible_collections/ibm/ibm_zos_cics/.devcontainer/setup.sh",
"postCreateCommand": {
"gitMarkSafe": "git config --global --add safe.directory /workspaces/collections/ansible_collections/ibm/ibm_zos_cics"
},
"postAttachCommand": "bash /workspace/collections/ansible_collections/ibm/ibm_zos_cics/.devcontainer/setup.sh",
"initializeCommand": "eval \"$(ssh-agent -s)\" > /dev/null && grep -slR \"PRIVATE\" ~/.ssh | xargs ssh-add",
"mounts" : [
"source=vscode-shell-history,target=/commandhistory,type=volume",
"source=${localEnv:HOME}/.ssh,target=/root/.ssh-local,type=bind,consistency=cached"
Expand All @@ -23,17 +21,8 @@
"redhat.ansible",
"ms-python.python",
"eamodio.gitlens",
"charliermarsh.ruff"
],
"settings": {
"extensions.verifySignature": false,
"ruff.format.args": [
"--config=/workspace/collections/ansible_collections/ibm/ibm_zos_cics/.devcontainer/pyproject.toml"
],
"ruff.lint.args": [
"--config=/workspace/collections/ansible_collections/ibm/ibm_zos_cics/.devcontainer/pyproject.toml"
]
}
"ms-vsliveshare.vsliveshare"
]
}
}
}
22 changes: 9 additions & 13 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ if [ -e /root/.ssh/config ]; then
rm ~/.ssh/config-local
fi

eval "$(ssh-agent)"
ssh-add

python_ver=$(python -c 'import platform; major, minor, patch = platform.python_version_tuple(); print("{0}.{1}".format(major,minor))')

python3 -m pip install --user ansible-core==2.17.4
python3 -m pip install --user ansible-core==2.16

ansible-galaxy collection install ibm.ibm_zos_core:==1.9.1 -p /workspace/collections
ansible-galaxy collection install community.general -p /workspace/collections
Expand All @@ -24,17 +19,18 @@ echo -e "[defaults]\nstdout_callback=community.general.yaml\nCOLLECTIONS_PATHS=/
pip install -r /workspace/collections/ansible_collections/ibm/ibm_zos_cics/dev-requirements.txt
pip install -r /workspace/collections/ansible_collections/ibm/ibm_zos_cics/doc-requirements.txt

# Remove additional pythons from bin so we can use shorthand ansible commands
find /usr/bin/python* -type f -not -name python"${python_ver}" -exec rm -v {} +

mkdir -p /commandhistory
touch /commandhistory/.zsh_history
chown -R root /commandhistory
echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.zsh_history" >> "/root/.zshrc"

#Make this ansible_cics_collection repo the default repo when opening a new zsh terminal or running 'cd'
echo "cd /workspace/collections/ansible_collections/ibm/ibm_zos_cics/" >> "/root/.zshrc"
echo "export HOME=/workspace/collections/ansible_collections/ibm/ibm_zos_cics/"
{
# Add history to zsh shell
echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.zsh_history"

# Make this ansible_cics_collection repo the default repo when opening a new zsh terminal
echo "cd /workspace/collections/ansible_collections/ibm/ibm_zos_cics/"
echo "git config --global --add safe.directory /workspaces/collections/ansible_collections/ibm/ibm_zos_cics"
} >> "/root/.zshrc"



Expand Down

0 comments on commit 48ca977

Please sign in to comment.