Skip to content

Commit

Permalink
Improve curl commands so they fail when they should on build (#1451)
Browse files Browse the repository at this point in the history
* Improve curl commands so they fail when they should on build
* Simplify ghr extraction more and put it in /usr/local/bin
  • Loading branch information
rfay committed Feb 15, 2019
1 parent 93c03fa commit 23d8d36
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -466,7 +466,7 @@ jobs:
version=$(make version)
version="${version#*:}" # Remove the VERSION: in front of make version
echo "GITHUB_TOKEN provided, pushing release $RELEASE_TAG"
/home/circleci/ghr \
ghr \
-prerelease \
-r $CIRCLE_PROJECT_REPONAME \
-u $CIRCLE_PROJECT_USERNAME \
Expand Down
16 changes: 5 additions & 11 deletions .circleci/linux_circle_vm_setup.sh
Expand Up @@ -15,16 +15,11 @@ if [ ! -d /home/linuxbrew/.linuxbrew/bin ] ; then
fi
export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/bin/brew update
/home/linuxbrew/.linuxbrew/bin/brew install osslsigncode golang
/home/linuxbrew/.linuxbrew/bin/brew install osslsigncode golang docker-compose

sudo bash -c "printf '/home 10.0.0.0/255.0.0.0(rw,sync,no_subtree_check) 172.16.0.0/255.240.0.0(rw,sync,no_subtree_check) 192.168.0.0/255.255.0.0(rw,sync,no_subtree_check)\n/tmp 10.0.0.0/255.0.0.0(rw,sync,no_subtree_check) 172.16.0.0/255.240.0.0(rw,sync,no_subtree_check) 192.168.0.0/255.255.0.0(rw,sync,no_subtree_check)' >>/etc/exports"
sudo service nfs-kernel-server restart

# docker-compose
sudo rm -f /usr/local/bin/docker-compose
sudo curl -s -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

# Remove existing docker and install from their apt package
sudo apt-get remove docker docker-engine docker.io
sudo apt-get install \
Expand All @@ -45,8 +40,7 @@ GOTESTSUM_VERSION=0.3.2
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v$GOTESTSUM_VERSION/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum && sudo chmod +x /usr/local/bin/gotestsum

# Install ghr
GHR_RELEASE="ghr_v0.12.0_linux_amd64"
curl -sL https://github.com/tcnksm/ghr/releases/download/v0.12.0/${GHR_RELEASE}.tar.gz > /home/circleci/${GHR_RELEASE}.tar.gz
tar -xzf /home/circleci/${GHR_RELEASE}.tar.gz -C /home/circleci
ln -s /home/circleci/${GHR_RELEASE}/ghr /home/circleci/ghr
/home/circleci/ghr -v
GHR_RELEASE="v0.12.0"
curl -fsL -o /tmp/ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/${GHR_RELEASE}/ghr_${GHR_RELEASE}_linux_amd64.tar.gz
sudo tar -C /usr/local/bin --strip-components=1 -xzf /tmp/ghr.tar.gz ghr_${GHR_RELEASE}_linux_amd64/ghr
ghr -v
4 changes: 2 additions & 2 deletions .circleci/macos_circle_vm_setup.sh
Expand Up @@ -16,11 +16,11 @@ brew tap drud/ddev
brew install mysql-client zip nsis jq expect coreutils golang ddev
brew link --force mysql-client

curl -sSL -o /tmp/gotestsum.tgz https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_darwin_amd64.tar.gz && tar -C /usr/local/bin -zxf /tmp/gotestsum.tgz gotestsum
curl -fsSL -o /tmp/gotestsum.tgz https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_darwin_amd64.tar.gz && tar -C /usr/local/bin -zxf /tmp/gotestsum.tgz gotestsum

# gotestsum
GOTESTSUM_VERSION=0.3.2
curl -sSL -o /tmp/gotestsum.tgz https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_darwin_amd64.tar.gz && tar -C /usr/local/bin -zxf /tmp/gotestsum.tgz gotestsum
curl -fsSL -o /tmp/gotestsum.tgz https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_darwin_amd64.tar.gz && tar -C /usr/local/bin -zxf /tmp/gotestsum.tgz gotestsum

sudo bash -c "cat <<EOF >/etc/exports
/Users -alldirs -mapall=$(id -u):$(id -g) localhost
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -129,12 +129,12 @@ chocolatey: $(GOTMP)/bin/windows_amd64/ddev_windows_installer.$(VERSION).exe


$(GOTMP)/bin/windows_amd64/sudo.exe $(GOTMP)/bin/windows_amd64/sudo_license.txt:
curl -sSL -o /tmp/sudo.zip -O https://github.com/mattn/sudo/releases/download/$(WINDOWS_SUDO_VERSION)/sudo-x86_64.zip
curl --fail -sSL -o /tmp/sudo.zip -O https://github.com/mattn/sudo/releases/download/$(WINDOWS_SUDO_VERSION)/sudo-x86_64.zip
unzip -o -d $(GOTMP)/bin/windows_amd64 /tmp/sudo.zip
curl -sSL -o $(GOTMP)/bin/windows_amd64/sudo_license.txt https://raw.githubusercontent.com/mattn/sudo/master/LICENSE
curl --fail -sSL -o $(GOTMP)/bin/windows_amd64/sudo_license.txt https://raw.githubusercontent.com/mattn/sudo/master/LICENSE

$(GOTMP)/bin/windows_amd64/nssm.exe $(GOTMP)/bin/windows_amd64/winnfsd_license.txt $(GOTMP)/bin/windows_amd64/winnfsd.exe :
curl -sSL -o $(GOTMP)/bin/windows_amd64/winnfsd.exe https://github.com/winnfsd/winnfsd/releases/download/$(WINNFSD_VERSION)/WinNFSd.exe
curl -sSL -o /tmp/nssm.zip https://nssm.cc/ci/nssm-$(NSSM_VERSION).zip
curl --fail -sSL -o $(GOTMP)/bin/windows_amd64/winnfsd.exe https://github.com/winnfsd/winnfsd/releases/download/$(WINNFSD_VERSION)/WinNFSd.exe
curl --fail -sSL -o /tmp/nssm.zip https://nssm.cc/ci/nssm-$(NSSM_VERSION).zip
unzip -oj /tmp/nssm.zip nssm-$(NSSM_VERSION)/win64/nssm.exe -d $(GOTMP)/bin/windows_amd64
curl -sSL -o $(GOTMP)/bin/windows_amd64/winnfsd_license.txt https://www.gnu.org/licenses/gpl.txt
curl --fail -sSL -o $(GOTMP)/bin/windows_amd64/winnfsd_license.txt https://www.gnu.org/licenses/gpl.txt

0 comments on commit 23d8d36

Please sign in to comment.