From 2fc2ffc527251616b4eb388a186e9cfc2ebf3e89 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 19:55:30 +0530 Subject: [PATCH 01/10] Added GVM,NVM,PYENV,Rupa/z,Mcfly in Ansika --- .gitignore | 9 ++- one_installer.yml | 184 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 156 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 04cff44..23b9596 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ .gitlab-ci.yml ext.yml -requirement.txt \ No newline at end of file +requirement.txt +executor.build +executor.dist +executor.onefile-build +executor.bin +__pycache__ +.git +get-docker.sh diff --git a/one_installer.yml b/one_installer.yml index c4f04ee..df5cae8 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -1,4 +1,3 @@ ---- - name: Onboarding Tasks hosts: localhost become: yes @@ -9,47 +8,143 @@ tasks: - name: Update package repository shell: sudo apt update + ignore_errors: yes - - name: install necessary tools + + - name: Install necessary tools shell: sudo apt-get install -y "{{ item }}" with_items: - gpg - wget - software-properties-common - - name: Download the content and setup keys - shell: "wget -qO- {{ item.pkg }}" - loop: - - {name: "lama2", pkg: "https://hexmos.com/lama2/install.sh | bash -s" } - - {name: "python poetry", pkg: "https://install.python-poetry.org | python3 -" } - - {name: "nvm", pkg: "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash -s" } - - {name: "zotero", pkg: "https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | sudo bash" } - - {name: "vscode", pkg: "https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg" } - - {name: "google chrome", pkg: "https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -" } + - name: Get the current username + shell: echo $SUDO_USER || echo $USER + register: current_user + changed_when: false + - name: Install required dependencies + become: yes + apt: + name: + - apt-transport-https + - ca-certificates + - curl + - gnupg + - lsb-release + state: present + update_cache: yes + ignore_errors: yes + + - name: Update the apt package index + become: yes + apt: + update_cache: yes + ignore_errors: yes + + + - name: Install Podman and podman-docker + become: yes + become_user: "{{ current_user.stdout }}" + shell: | + sudo apt-get update + sudo apt-get install -y podman + sudo apt-get install -y podman-docker + args: + executable: /bin/bash + register: podman_status + + - name: Install pyenv + become: yes + become_user: "{{ current_user.stdout }}" + shell: | + curl https://pyenv.run | bash + echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc + echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc + echo 'eval "$(pyenv init --path)"' >> ~/.bashrc + echo 'eval "$(pyenv init -)"' >> ~/.bashrc + echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc + source ~/.bashrc + args: + executable: /bin/bash + register: pyenv_status + + - name: Display pyenv installation status + debug: + msg: "pyenv installation status: {{ pyenv_status.stdout }}" + + - name: Install rupa/z, and mcfly + become: yes + become_user: "{{ current_user.stdout }}" + shell: | + # Install rupa/z + curl -fsSL https://raw.githubusercontent.com/rupa/z/master/z.sh -o ~/.z.sh + echo 'source ~/z/.z.sh' >> ~/.bashrc + + # Install mcfly + brew tap cantino/mcfly https://github.com/cantino/mcfly + brew install mcfly + if [[ -f "$(brew --prefix)/opt/mcfly/mcfly.bash" ]]; then + source "$(brew --prefix)/opt/mcfly/mcfly.bash" + fi + + # Apply changes + source ~/.bashrc + args: + executable: /bin/bash + + + - name: Install GVM dependencies + shell: sudo apt-get install -y "{{ item }}" + with_items: + - curl + - git + - mercurial + - make + - binutils + - bison + - gcc + - build-essential + - bsdmainutils + ignore_errors: yes + + - name: Download and install tools via shell scripts + shell: "{{ item.pkg }}" + loop: + - { name: "lama2", pkg: "curl -sSL https://hexmos.com/lama2/install.sh | bash -s" } + - { name: "python poetry", pkg: "curl -sSL https://install.python-poetry.org | python3 -" } + - { name: "nvm", pkg: "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -s" } + - { name: "zotero", pkg: "curl -sSL https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | sudo bash" } + - { name: "vscode", pkg: "curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg" } + - { name: "google chrome", pkg: "curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -" } + - name: Configure apt repositories shell: sudo add-apt-repository -y "{{ item }}" with_items: - ppa:deadsnakes/ppa - ppa:phoerious/keepassxc - - name: add lines + ignore_errors: yes + + - name: Add environment variable paths lineinfile: - dest: ~/.bashrc + dest: ~/.bashrc line: '{{ item }}' with_items: - export PATH="$HOME/.poetry/bin:$PATH" - export PATH="$HOME/.local/bin:$PATH" - - name: Setup vs code + + - name: Setup VS Code shell: | sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' rm -f packages.microsoft.gpg - - name: Setup google chrome + - name: Setup Google Chrome shell: sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' - + - name: Update package repository shell: sudo apt update + ignore_errors: yes - name: Install Packages shell: sudo apt install -y "{{ item }}" @@ -58,39 +153,41 @@ - python3.10 - python3-pip - git - - golang - keepassxc - zotero - ripgrep - apt-transport-https - code - google-chrome-stable + + - name: Install NVM (Node Version Manager) become: yes - - - name: Install node and set version - become: yes - become_user: root - shell: "source /root/.nvm/nvm.sh && nvm install 16.15.0" + become_user: "{{ current_user.stdout }}" + shell: | + source ~/.bashrc + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc + echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc + echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bashrc + source ~/.bashrc args: executable: /bin/bash + register: nvm_status - - name: Install npm packages - become: yes - become_user: root - shell: "source /root/.nvm/nvm.sh && nvm exec 16 npm install -g {{ item }}" - with_items: - - prettier - - yarn - args: - executable: /bin/bash - - - name: Install python packages + - name: Display NVM installation status + debug: + msg: "NVM installation status: {{ nvm_status.stdout }}" + + + + - name: Install Python packages shell: pip3 install "{{ item }}" with_items: - black - - mypy - + - mypy + - name: Install VSCode extensions + become_user: "{{ current_user.stdout }}" shell: code --install-extension "{{ item }}" with_items: - ms-python.python @@ -103,7 +200,22 @@ - hexmos.Lama2 - golang.Go - ryanluker.vscode-coverage-gutters - become: no + - name: Install GVM (Go Version Manager) + become: yes + become_user: "{{ current_user.stdout }}" + shell: | + source ~/.bashrc + curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | bash + echo 'source ~/.gvm/scripts/gvm' >> ~/.bashrc + source ~/.bashrc + args: + executable: /bin/bash + register: gvm_status + + + - name: Display GVM installation status + debug: + msg: "GVM installation status: {{ gvm_status.stdout }}" From 2566a6139eebdf1faa7ff13cf2b5ee731b0d3868 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 20:15:27 +0530 Subject: [PATCH 02/10] Testing from my branch --- .github/workflows/build-and-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f4f4f4b..f73cf37 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -2,6 +2,8 @@ name: Binary Build And Release run-name: ${{ github.actor }} building the binary using nuitka 🚀 on: push: + branches: + - jishnu/AnsikaVersionManagements tags: - '*' workflow_dispatch: From 9b06aad9dc89b76ba3b19d3f3420db97d49a4684 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 20:55:17 +0530 Subject: [PATCH 03/10] Adding missing dependencies --- one_installer.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/one_installer.yml b/one_installer.yml index df5cae8..84119c4 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -54,6 +54,11 @@ executable: /bin/bash register: podman_status + - name: Install Git + package: + name: git + state: present + - name: Install pyenv become: yes become_user: "{{ current_user.stdout }}" @@ -72,6 +77,12 @@ - name: Display pyenv installation status debug: msg: "pyenv installation status: {{ pyenv_status.stdout }}" + - name: Install Homebrew + shell: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc + eval "$(/opt/homebrew/bin/brew shellenv)" + become: yes - name: Install rupa/z, and mcfly become: yes @@ -117,7 +128,8 @@ - { name: "zotero", pkg: "curl -sSL https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | sudo bash" } - { name: "vscode", pkg: "curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg" } - { name: "google chrome", pkg: "curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -" } - + ignore_errors : yes + - name: Configure apt repositories shell: sudo add-apt-repository -y "{{ item }}" with_items: From 936cc989f52bd68640c221fbc0275013faad74a5 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 21:12:56 +0530 Subject: [PATCH 04/10] Adding missing dependencies 2 --- one_installer.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/one_installer.yml b/one_installer.yml index 84119c4..d925917 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -129,7 +129,7 @@ - { name: "vscode", pkg: "curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg" } - { name: "google chrome", pkg: "curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -" } ignore_errors : yes - + - name: Configure apt repositories shell: sudo add-apt-repository -y "{{ item }}" with_items: @@ -157,10 +157,12 @@ - name: Update package repository shell: sudo apt update ignore_errors: yes - - name: Install Packages - shell: sudo apt install -y "{{ item }}" - with_items: + become: yes + apt: + name: "{{ item }}" + state: present + loop: - python3-apt - python3.10 - python3-pip From 2abe36997051941f56365afc51b2db70117a8234 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 21:27:12 +0530 Subject: [PATCH 05/10] Adding missing dependencies 3 --- one_installer.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/one_installer.yml b/one_installer.yml index d925917..95c6727 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -82,6 +82,7 @@ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc eval "$(/opt/homebrew/bin/brew shellenv)" + source ~/.bashrc become: yes - name: Install rupa/z, and mcfly @@ -90,7 +91,7 @@ shell: | # Install rupa/z curl -fsSL https://raw.githubusercontent.com/rupa/z/master/z.sh -o ~/.z.sh - echo 'source ~/z/.z.sh' >> ~/.bashrc + echo 'source ~/.z.sh' >> ~/.bashrc # Install mcfly brew tap cantino/mcfly https://github.com/cantino/mcfly @@ -173,6 +174,7 @@ - apt-transport-https - code - google-chrome-stable + ignore_errors : yes - name: Install NVM (Node Version Manager) become: yes @@ -214,7 +216,8 @@ - hexmos.Lama2 - golang.Go - ryanluker.vscode-coverage-gutters - + ignore_errors : yes + - name: Install GVM (Go Version Manager) become: yes become_user: "{{ current_user.stdout }}" From 6def484a4313e3f4ce5aae1c4a7fedf20f9b3b30 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 21:37:31 +0530 Subject: [PATCH 06/10] Adding missing dependencies 3.5 --- one_installer.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/one_installer.yml b/one_installer.yml index 95c6727..d294d43 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -78,12 +78,17 @@ debug: msg: "pyenv installation status: {{ pyenv_status.stdout }}" - name: Install Homebrew + become: no shell: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc - eval "$(/opt/homebrew/bin/brew shellenv)" - source ~/.bashrc - become: yes + if ! command -v brew &> /dev/null; then + echo "Homebrew not found. Installing Homebrew." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bash_profile + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + else + echo "Homebrew is already installed." + fi + ignore_errors : yes - name: Install rupa/z, and mcfly become: yes @@ -217,7 +222,7 @@ - golang.Go - ryanluker.vscode-coverage-gutters ignore_errors : yes - + - name: Install GVM (Go Version Manager) become: yes become_user: "{{ current_user.stdout }}" From 3a679a083c2755ef3ad08e4135665ab13e67f260 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Tue, 13 Aug 2024 21:54:05 +0530 Subject: [PATCH 07/10] Adding missing dependencies 4 --- one_installer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/one_installer.yml b/one_installer.yml index d294d43..597a9e7 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -206,6 +206,7 @@ with_items: - black - mypy + ignore_errors : yes - name: Install VSCode extensions become_user: "{{ current_user.stdout }}" From bbc014a3808ee802ef8b35b3b64da0660b735607 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Thu, 15 Aug 2024 15:31:55 +0530 Subject: [PATCH 08/10] Fixing issues with mcfly --- one_installer.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/one_installer.yml b/one_installer.yml index 597a9e7..53ebfcf 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -83,14 +83,17 @@ if ! command -v brew &> /dev/null; then echo "Homebrew not found. Installing Homebrew." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bash_profile + echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + . ~/.bashrc else echo "Homebrew is already installed." fi - ignore_errors : yes + args: + executable: /bin/bash + ignore_errors: yes - - name: Install rupa/z, and mcfly + - name: Install rupa/z and mcfly become: yes become_user: "{{ current_user.stdout }}" shell: | @@ -106,7 +109,7 @@ fi # Apply changes - source ~/.bashrc + . ~/.bashrc args: executable: /bin/bash From 6399395bfd3546ef21174c808cb3c73e5fc6a821 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Thu, 15 Aug 2024 16:02:18 +0530 Subject: [PATCH 09/10] Fixing issues with mcfly 2 --- one_installer.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/one_installer.yml b/one_installer.yml index 53ebfcf..8c10bed 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -100,13 +100,10 @@ # Install rupa/z curl -fsSL https://raw.githubusercontent.com/rupa/z/master/z.sh -o ~/.z.sh echo 'source ~/.z.sh' >> ~/.bashrc - + # Install mcfly - brew tap cantino/mcfly https://github.com/cantino/mcfly - brew install mcfly - if [[ -f "$(brew --prefix)/opt/mcfly/mcfly.bash" ]]; then - source "$(brew --prefix)/opt/mcfly/mcfly.bash" - fi + curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sudo sh -s -- --git cantino/mcfly + echo 'eval "$(mcfly init bash)"' >> ~/.bashrc # Apply changes . ~/.bashrc From ed75f45cf4f8969ced55afbf42a49eee5c1d88a3 Mon Sep 17 00:00:00 2001 From: jishnupn04 Date: Thu, 15 Aug 2024 19:36:15 +0530 Subject: [PATCH 10/10] Adressed the comments --- .github/workflows/build-and-release.yml | 2 -- .gitignore | 1 - requirement.txt | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 requirement.txt diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f73cf37..f4f4f4b 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -2,8 +2,6 @@ name: Binary Build And Release run-name: ${{ github.actor }} building the binary using nuitka 🚀 on: push: - branches: - - jishnu/AnsikaVersionManagements tags: - '*' workflow_dispatch: diff --git a/.gitignore b/.gitignore index 23b9596..577dd9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .gitlab-ci.yml ext.yml -requirement.txt executor.build executor.dist executor.onefile-build diff --git a/requirement.txt b/requirement.txt new file mode 100644 index 0000000..e96bf6b --- /dev/null +++ b/requirement.txt @@ -0,0 +1,2 @@ +ansible==7.0.0 +nutika==1.7.5 \ No newline at end of file