Bertrand Chenal 7 년 전
부모
커밋
d7d83c4c56
5개의 변경된 파일179개의 추가작업 그리고 179개의 파일을 삭제
  1. 59 59
      pkg/az.yaml
  2. 12 12
      pkg/git.yaml
  3. 82 82
      pkg/os.yaml
  4. 19 19
      pkg/pg.yaml
  5. 7 7
      pkg/py.yaml

+ 59 - 59
pkg/az.yaml

@@ -1,59 +1,59 @@
-tasks:
-  # Creation, deletion and mgmt of VM
-  create-vm:
-     desc: Create a new azure VM
-     local: >
-       az vm create -n "bio-pm-prove-{vm_name}" -g "{ressource_group}"
-       --image UbuntuLTS  --admin-username deploy --ssh-key-value deploy_rsa.pub
-       --data-disk-sizes-gb 100 --public-ip-address "" --subnet "{subnet}"
-     once: true
-  delete-vm-only:
-     desc: Delete azure VM
-     local: az vm delete -n "bio-pm-prove-{vm_name}"  -g "RG-DC-BUS-QUANTS" -y
-     once: true
-  show-disk:
-     desc: Read disk id
-     local: >-
-       az vm show -g "RG-DC-BUS-QUANTS" --query "{query}"
-       -n "bio-pm-prove-{vm_name}"
-     once: true
-  delete-disk:
-     desc: Delete azure disk
-     local: az disk delete -n "{disk_name}" -g "RG-DC-BUS-QUANTS" -y
-     once: true
-  delete-vm:
-     desc: Delete both VM and attached disk
-     multi:
-      - task: az-show-disk
-        export: os_disk
-        env:
-          query: "storageProfile.osDisk.name"
-      - task: az-show-disk
-        export: data_disk
-        env:
-          query: "storageProfile.dataDisks[0].name"
-      - task: az-delete-vm-only
-      - task: az-delete-disk
-        env:
-          disk_name: "{data_disk}"
-      - task: az-delete-disk
-        env:
-          disk_name: "{os_disk}"
-  show-ip:
-     desc: Query azure vm by name for ip
-     local: >
-       az vm list-ip-addresses
-       --query "[?virtualMachine.name=='bio-pm-prove-{vm_name}']
-       .virtualMachine.network.privateIpAddresses[0]"
-     once: true
-  vm-info:
-     desc: Query azure vm by name for info
-     local: az vm list --query "[?name=='bio-pm-prove-{vm_name}']"
-     once: true
-  fix-hosts:
-    desc: "See: https://github.com/Microsoft/WSL/issues/491"
-    run: |
-      if grep -q $(hostname) /etc/hosts
-      then true
-      else sudo sed -i "s/127.0.0.1 localhost/127.0.0.1 localhost $(hostname)/g" /etc/hosts
-      fi
+tasks:
+  # Creation, deletion and mgmt of VM
+  create-vm:
+     desc: Create a new azure VM
+     local: >
+       az vm create -n "bio-pm-prove-{vm_name}" -g "{ressource_group}"
+       --image UbuntuLTS  --admin-username deploy --ssh-key-value deploy_rsa.pub
+       --data-disk-sizes-gb 100 --public-ip-address "" --subnet "{subnet}"
+     once: true
+  delete-vm-only:
+     desc: Delete azure VM
+     local: az vm delete -n "bio-pm-prove-{vm_name}"  -g "RG-DC-BUS-QUANTS" -y
+     once: true
+  show-disk:
+     desc: Read disk id
+     local: >-
+       az vm show -g "RG-DC-BUS-QUANTS" --query "{query}"
+       -n "bio-pm-prove-{vm_name}"
+     once: true
+  delete-disk:
+     desc: Delete azure disk
+     local: az disk delete -n "{disk_name}" -g "RG-DC-BUS-QUANTS" -y
+     once: true
+  delete-vm:
+     desc: Delete both VM and attached disk
+     multi:
+      - task: az-show-disk
+        export: os_disk
+        env:
+          query: "storageProfile.osDisk.name"
+      - task: az-show-disk
+        export: data_disk
+        env:
+          query: "storageProfile.dataDisks[0].name"
+      - task: az-delete-vm-only
+      - task: az-delete-disk
+        env:
+          disk_name: "{data_disk}"
+      - task: az-delete-disk
+        env:
+          disk_name: "{os_disk}"
+  show-ip:
+     desc: Query azure vm by name for ip
+     local: >
+       az vm list-ip-addresses
+       --query "[?virtualMachine.name=='bio-pm-prove-{vm_name}']
+       .virtualMachine.network.privateIpAddresses[0]"
+     once: true
+  vm-info:
+     desc: Query azure vm by name for info
+     local: az vm list --query "[?name=='bio-pm-prove-{vm_name}']"
+     once: true
+  fix-hosts:
+    desc: "See: https://github.com/Microsoft/WSL/issues/491"
+    run: |
+      if grep -q $(hostname) /etc/hosts
+      then true
+      else sudo sed -i "s/127.0.0.1 localhost/127.0.0.1 localhost $(hostname)/g" /etc/hosts
+      fi

+ 12 - 12
pkg/git.yaml

@@ -1,12 +1,12 @@
-tasks:
-  clone:
-    desc: Clone git repo
-    run: |
-      if test ! -d {path}
-        then  git clone {repo_uri} {path}
-      fi
-  pull:
-    desc: Update codebase
-    run: cd src/prove && git pull
-    env:
-      ssh_user: prove
+tasks:
+  clone:
+    desc: Clone git repo
+    run: |
+      if test ! -d {path}
+        then  git clone {repo_uri} {path}
+      fi
+  pull:
+    desc: Update codebase
+    run: cd src/prove && git pull
+    env:
+      ssh_user: prove

+ 82 - 82
pkg/os.yaml

@@ -1,82 +1,82 @@
-tasks:
-  # Generic tasks
-  bash:
-    desc: Interactive prompt
-    run: "bash"
-  create-dir:
-    desc: Add a new directory
-    run: "mkdir -p {path}"
-  symlink:
-    desc: Create symlink
-    run: |
-      if test ! -e {to}
-      then ln -s {from} {to}
-      fi
-  mount:
-    run: mount | grep ' {path} ' &> /dev/null || mount {path}
-  move:
-    desc: Move a file or directory
-    run: |
-      if test ! -e {to}
-      then mv {from} {to}
-      fi
-  copy:
-    desc: Copy a file or directory
-    run: |
-      if test -f {from}
-      then cp {from} {to}
-      else cp -Tr {from} {to}
-      fi
-  remove:
-    desc: Remove (-r) path
-    run: "rm -r {path}"
-  chown:
-    desc: Chown a file or directory
-    run: "chown -R {user}. {path}"
-  chmod:
-    desc: Chmod a file or directory
-    run: "chmod -R {mode} {path}"
-  apt-install:
-    desc: Run apt install
-    run: apt update && apt install -y {packages}
-    sudo: true
-  systemctl:
-    desc: Call systemctl
-    run: systemctl {action} {service}
-    sudo: true
-  send:
-    desc: Send a file or a directory
-    send: "{send}"
-    to: "{to}"
-  sudo-send:
-    desc: Combine send & sudo-move
-    multi:
-      - task: send
-        env:
-          to: "/tmp/{tmppath}"
-      - task: copy
-        sudo: true
-        env:
-          from: "/tmp/{tmppath}"
-      - task: remove
-        env:
-          path: "/tmp/{tmppath}"
-  parted:
-    desc: Create primary partition && mkfs
-    sudo: true
-    run: |
-      if test ! -e {device}1
-      then
-      parted {device} -a optimal --script mklabel gpt mkpart primary 0% 100%
-      sleep 1
-      mkfs -t ext4 {device}1
-      fi
-
-  append-line:
-    desc: Append line to file
-    run: >-
-      grep {guard} {file} &> /dev/null
-      || echo {line} >> {file}
-  add-user:
-    desc: Add a new user
-    run: id {user} || sudo adduser {user} --disabled-login --gecos ""
+tasks:
+  # Generic tasks
+  bash:
+    desc: Interactive prompt
+    run: "bash"
+  create-dir:
+    desc: Add a new directory
+    run: "mkdir -p {path}"
+  symlink:
+    desc: Create symlink
+    run: |
+      if test ! -e {to}
+      then ln -s {from} {to}
+      fi
+  mount:
+    run: mount | grep ' {path} ' &> /dev/null || mount {path}
+  move:
+    desc: Move a file or directory
+    run: |
+      if test ! -e {to}
+      then mv {from} {to}
+      fi
+  copy:
+    desc: Copy a file or directory
+    run: |
+      if test -f {from}
+      then cp {from} {to}
+      else cp -Tr {from} {to}
+      fi
+  remove:
+    desc: Remove (-r) path
+    run: "rm -r {path}"
+  chown:
+    desc: Chown a file or directory
+    run: "chown -R {user}. {path}"
+  chmod:
+    desc: Chmod a file or directory
+    run: "chmod -R {mode} {path}"
+  apt-install:
+    desc: Run apt install
+    run: apt update && apt install -y {packages}
+    sudo: true
+  systemctl:
+    desc: Call systemctl
+    run: systemctl {action} {service}
+    sudo: true
+  send:
+    desc: Send a file or a directory
+    send: "{send}"
+    to: "{to}"
+  sudo-send:
+    desc: Combine send & sudo-move
+    multi:
+      - task: send
+        env:
+          to: "/tmp/{tmppath}"
+      - task: copy
+        sudo: true
+        env:
+          from: "/tmp/{tmppath}"
+      - task: remove
+        env:
+          path: "/tmp/{tmppath}"
+  parted:
+    desc: Create primary partition && mkfs
+    sudo: true
+    run: |
+      if test ! -e {device}1
+      then
+      parted {device} -a optimal --script mklabel gpt mkpart primary 0% 100%
+      sleep 1
+      mkfs -t ext4 {device}1
+      fi
+
+  append-line:
+    desc: Append line to file
+    run: >-
+      grep {guard} {file} &> /dev/null
+      || echo {line} >> {file}
+  add-user:
+    desc: Add a new user
+    run: id {user} || sudo adduser {user} --disabled-login --gecos ""

+ 19 - 19
pkg/pg.yaml

@@ -1,19 +1,19 @@
-tasks:
-  createuser:
-    desc: Add postgres user
-    sudo: postgres
-    run: |
-      if ! psql -c "SELECT usename FROM pg_user" | grep {pg_user} &> /dev/null
-      then createuser {pg_user} -d
-      fi
-  createdb:
-    desc: Create a new db
-    run: |
-      if ! psql -l | grep {db_name} &> /dev/null
-      then createdb {db_name}
-      fi
-
-  alter-passwd:
-    desc: Alter user password
-    sudo: postgres
-    run: psql -c "ALTER USER {pg_user} WITH PASSWORD '{pg_password}'"
+tasks:
+  createuser:
+    desc: Add postgres user
+    sudo: postgres
+    run: |
+      if ! psql -c "SELECT usename FROM pg_user" | grep {pg_user} &> /dev/null
+      then createuser {pg_user} -d
+      fi
+  createdb:
+    desc: Create a new db
+    run: |
+      if ! psql -l | grep {db_name} &> /dev/null
+      then createdb {db_name}
+      fi
+
+  alter-passwd:
+    desc: Alter user password
+    sudo: postgres
+    run: psql -c "ALTER USER {pg_user} WITH PASSWORD '{pg_password}'"

+ 7 - 7
pkg/py.yaml

@@ -1,7 +1,7 @@
-tasks:
-  create-venv:
-    desc: Create python venv
-    run: |
-      if ! -e {venv_path}
-      then python3 -m venv {venv_path}
-      fi
+tasks:
+  create-venv:
+    desc: Create python venv
+    run: |
+      if ! -e {venv_path}
+      then python3 -m venv {venv_path}
+      fi