Skip to content

Commit

Permalink
merge changes from onboard devcontainer setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Mar 25, 2024
1 parent c91a8c4 commit 9f33389
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/ansible/roles/setup-container/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dotfiles_url: "{{ lookup('env', 'DOTFILES_URL') | default('https://github.com/ilude/dotfiles.git') }}"
dotfiles_path: "{{ lookup('env', 'HOME') + '/.dotfiles' }}"
dotfiles_url: "{{ lookup('env', 'DOTFILES_URL') }}"
dotfiles_path: "{{ lookup('env', 'HOME') + '/.dotfiles' }}"
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
- name: Clone/Update Dotfiles Repository
- name: Clone/Update git repo {{ dotfiles_url }} to {{ dotfiles_path }}
git:
repo: "{{ dotfiles_url }}"
dest: "{{ dotfiles_path }}"
recursive: yes # Recursively clone submodules
update: yes
force: yes
accept_hostkey: yes
ignore_errors: yes

- name: Execute {{ dotfiles_path }}/install
command: "{{ dotfiles_path }}/install"
ignore_errors: yes
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"PROJECT_PATH": "${containerWorkspaceFolder}"
}
},
"initializeCommand": "touch ${localWorkspaceFolder}/.devcontainer/.env",
"updateContentCommand": "LC_ALL=C.UTF-8 ansible-playbook --inventory 127.0.0.1 --connection=local ${containerWorkspaceFolder}/.devcontainer/ansible/setup-container.yml",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"runArgs": ["--name", "${localWorkspaceFolderBasename}_devcontainer", "--hostname", "${localWorkspaceFolderBasename}","--env-file",".devcontainer/.env" ],
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ RUN echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} && \
ARG PROJECT_NAME
ENV PROJECT_NAME=${PROJECT_NAME}

ENV DOTFILES_URL=https://github.com/ilude/dotfiles.git

USER ${USER}

# https://code.visualstudio.com/remote/advancedcontainers/start-processes#_adding-startup-commands-to-the-docker-image-instead
Expand Down

0 comments on commit 9f33389

Please sign in to comment.