- Open Visual Studio Code
- Press CTRL + SHIFT + P to open the Command Palette
- Search for “Terminal: Select Default Profile”
- Select your preferred shell. In my case I selected “WLinux (WSL)”
#!/bin/bash | |
set -e | |
TEST_OUTPUT=`docker run --rm -v $WORKSPACE:/src/ mcr.microsoft.com/dotnet/sdk:3.1 bash -c "cd /src/; dotnet test --logger 'trx;logfilename=testResults.trx';"` | |
sudo chown -R jenkins:jenkins . | |
FAIL_STR="Failed:" | |
There is a known issue (as of 4/5/2022) with using the Role-based Authorization Strategy Jenkins plugin with the depedent Matrix Authorization plugin 3.0+
To fix the issue you have to add a record for every "No type prefix" error you see with users assigned to a role. Added the following to fix the "functionality":
USER:some-user
There will be two entry and the red error text will still display but the plugins should function properly otherwise.
Fix The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.
This is relevant to Amazon Linux 2018.03
From the references basically:
wget https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
mv ./RPM-GPG-KEY-mysql-2022 /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
#!/bin/bash | |
BITBUCKET_USERNAME=someperson | |
BITBUCKET_PASSWORD=somepassword | |
mkdir some-dir | |
# The follow command works by default in Amazon Linux 2 out of the box for Python 2.7.x | |
# App passwords need to be URL encoded to work | |
URL_ENCODED_PASSWORD=$(python -c "import urllib;print urllib.quote(raw_input())" <<< "${BITBUCKET_PASSWORD}") | |
git clone https://${BITBUCKET_USERNAME}:${URL_ENCODED_PASSWORD}@bitbucket.org/sometreamorg/somerepo.git some-dir |
#!/bin/bash | |
git clone [email protected]:whatever directory-name |
These examples were compiled from Best Practices for Writing Bash Scripts and Use the Unofficial Bash Strict Mode (Unless You Looove Debugging).
Another resource of note: Bash 3 Boilerplate.
As a single snippet, start your bash script with:
set -euo pipefail
From the references listed below the most important thing to note is that the Java version must match for the controller and the node/agent.
#!/bin/bash | |
curl -L -b "oraclelicense=a" -O https://download.oracle.com/otn-pub/java/jdk/11.0.14%2B8/7e5bbbfffe8b45e59d52a96aacab2f04/jdk-11.0.14_linux-x64_bin.rpm | |
sudo rpm -Uvh jdk-11.0.14_linux-x64_bin.rpm | |
java -version | |
# If 11 does not display use the alternatives tool to set the version of java | |
sudo update-alternatives --config 'java' |