-
-
Notifications
You must be signed in to change notification settings - Fork 272
psake on Linux #262
Copy link
Copy link
Closed
Description
Here's a small instruction how to use psake on Linux.
-
Install PowerShell Core
-
Clone psake repository
git clone https://github.com/psake/psake /opt/psake
-
Create wrapper
sudo sh -c 'echo "#!/bin/env sh\npwsh -Command \"& /opt/psake/src/psake.ps1 \$@; if (\\\$psake.build_success -eq \\\$false) { exit 1 } else { exit 0 }\"" > /usr/bin/psake' sudo chmod +x /usr/bin/psakeIt will create following script:
#!/usr/bin/env sh pwsh -Command "& /opt/psake/src/psake.ps1 $@; if (\$psake.build_success -eq \$false) { exit 1 } else { exit 0 }"
I used Ansible to do the actions above. Tested on Ubuntu Server 18.04 and CentOS 7.
- hosts: buildserver
roles:
- brentwg.powershell
vars:
ansible_become: true
tasks:
- name: Clone psake repository
git:
repo: 'https://github.com/psake/psake'
dest: /opt/psake
- name: Create psake wrapper
copy:
content: |
#!/usr/bin/env sh
pwsh -Command "& /opt/psake/src/psake.ps1 $@; if (\$psake.build_success -eq \$false) { exit 1 } else { exit 0 }"
dest: /usr/bin/psake
mode: 0755
pre_tasks:
- name: Enable Universe repository
apt_repository:
repo: deb http://archive.ubuntu.com/ubuntu bionic universe
become: yes
when: ansible_os_family == 'Debian'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels