Skip to content

Commit

Permalink
Minor update to cli consts, new build with PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsleuth committed Jan 9, 2023
1 parent fcac256 commit 8adf01c
Show file tree
Hide file tree
Showing 3 changed files with 958 additions and 483 deletions.
7 changes: 4 additions & 3 deletions mat-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ const saltCheckVersion = (path, value) => {

const setupSalt = async () => {
if (cli['--dev'] === false) {
const baseUrl = 'https://repo.saltproject.io/salt/py3/ubuntu'
const aptSourceList = '/etc/apt/sources.list.d/saltstack.list'
const aptDebString = `deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg, arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/${osVersion}/amd64/${saltstackVersion} ${osCodename} main`
const aptDebString = `deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg, arch=amd64] ${baseUrl}/${osVersion}/amd64/${saltstackVersion} ${osCodename} main`

const aptExists = await fileExists(aptSourceList)
const saltExists = await fileExists('/usr/bin/salt-call')
Expand All @@ -225,7 +226,7 @@ const setupSalt = async () => {
console.log('Installing and configuring SaltStack...')
await child_process.execAsync('apt-get remove -y --allow-change-held-packages salt-minion salt-common')
await fs.writeFileAsync(aptSourceList, aptDebString)
await child_process.execAsync(`wget -O /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/salt/py3/ubuntu/${osVersion}/amd64/${saltstackVersion}/salt-archive-keyring.gpg`)
await child_process.execAsync(`wget -O /usr/share/keyrings/salt-archive-keyring.gpg ${baseUrl}/${osVersion}/amd64/${saltstackVersion}/salt-archive-keyring.gpg`)
await child_process.execAsync('apt-get update')
await child_process.execAsync('apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y --allow-change-held-packages salt-common', {
env: {
Expand All @@ -236,7 +237,7 @@ const setupSalt = async () => {
} else if (aptExists === false || saltExists === false) {
console.log('Installing and configuring SaltStack...')
await fs.writeFileAsync(aptSourceList, aptDebString)
await child_process.execAsync(`wget -O /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/salt/py3/ubuntu/${osVersion}/amd64/${saltstackVersion}/salt-archive-keyring.gpg`)
await child_process.execAsync(`wget -O /usr/share/keyrings/salt-archive-keyring.gpg ${baseUrl}/${osVersion}/amd64/${saltstackVersion}/salt-archive-keyring.gpg`)
await child_process.execAsync('apt-get update')
await child_process.execAsync('apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y --allow-change-held-packages salt-common', {
env: {
Expand Down
Loading

0 comments on commit 8adf01c

Please sign in to comment.