Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devcontainer - Change Ansible to 2.16 and fix CMCI int test issue #146

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Tom-Latham marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading