Skip to content

abort script if any error#68

Open
vvitayau wants to merge 2 commits intohashicorp:masterfrom
vvitayau:patch-4
Open

abort script if any error#68
vvitayau wants to merge 2 commits intohashicorp:masterfrom
vvitayau:patch-4

Conversation

@vvitayau
Copy link
Copy Markdown
Contributor

avoid issues ( e.g. sudo: unzip: command not found ) yet the script reported it completed successfully

curl https://raw.githubusercontent.com/hashicorp/guides-configuration/master/nomad/scripts/install-nomad.sh | VERSION=0.8.6 bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1307  100  1307    0     0   3956      0 --:--:-- --:--:-- --:--:--  3960
+ echo Running
Running
+ NOMAD_VERSION=0.8.6
+ NOMAD_ZIP=nomad_0.8.6_linux_amd64.zip
+ NOMAD_URL=https://releases.hashicorp.com/nomad/0.8.6/nomad_0.8.6_linux_amd64.zip
+ NOMAD_DIR=/usr/local/bin
+ NOMAD_PATH=/usr/local/bin/nomad
+ NOMAD_CONFIG_DIR=/etc/nomad.d
+ NOMAD_DATA_DIR=/opt/nomad/data
+ NOMAD_TLS_DIR=/opt/nomad/tls
+ NOMAD_ENV_VARS=/etc/nomad.d/nomad.conf
+ NOMAD_PROFILE_SCRIPT=/etc/profile.d/nomad.sh
+ echo 'Downloading Nomad 0.8.6'
Downloading Nomad 0.8.6
++ curl --write-out '%{http_code}' --silent --output /tmp/nomad_0.8.6_linux_amd64.zip https://releases.hashicorp.com/nomad/0.8.6/nomad_0.8.6_linux_amd64.zip
+ '[' 200 -ne 200 ']'
+ echo 'Installing Nomad'
Installing Nomad
+ sudo unzip -o /tmp/nomad_0.8.6_linux_amd64.zip -d /usr/local/bin
sudo: unzip: command not found
+ sudo chmod 0755 /usr/local/bin/nomad
chmod: cannot access '/usr/local/bin/nomad': No such file or directory
+ sudo chown root: /usr/local/bin/nomad
chown: cannot access '/usr/local/bin/nomad': No such file or directory
++ /usr/local/bin/nomad --version
bash: line 24: /usr/local/bin/nomad: No such file or directory
+ echo ''

+ echo 'Configuring Nomad 0.8.6'
Configuring Nomad 0.8.6
+ sudo mkdir -pm 0755 /etc/nomad.d /opt/nomad/data /opt/nomad/tls
+ echo 'Start Nomad in -dev mode'
Start Nomad in -dev mode
+ sudo tee /etc/nomad.d/nomad.conf
+ echo 'Update directory permissions'
Update directory permissions
+ sudo chown -R root: /etc/nomad.d /opt/nomad/data /opt/nomad/tls
+ sudo chmod -R 0644 /etc/nomad.d/nomad_client.hcl /etc/nomad.d/nomad.conf
+ echo 'Set Nomad profile script'
Set Nomad profile script
+ sudo tee /etc/profile.d/nomad.sh
+ echo Complete
Complete

@bensojona
Copy link
Copy Markdown
Contributor

@vvitayau - the merge to master seemed to have caused CI to fail here.

@hashicorp-cla
Copy link
Copy Markdown

hashicorp-cla commented Dec 6, 2019

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


0 out of 2 committers have signed the CLA.

  • vvitayau
  • bensojona

Have you signed the CLA already but the status is still pending? Recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants