wait for teleport to be configured
Build and Push Docker Images / build-and-push (push) Successful in 20s
Build and Push Docker Images / build-and-push (push) Successful in 20s
This commit is contained in:
@@ -76,6 +76,39 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Change to the repository directory
|
||||||
|
cd /workspace
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
yarn install
|
||||||
|
|
||||||
|
# Copy the environment file to the repository's environments directory
|
||||||
|
if [ -f /environment/.dev.env ]; then
|
||||||
|
mkdir -p /workspace/environments
|
||||||
|
cp /environment/.dev.env /workspace/environments/.dev.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the git user and email
|
||||||
|
git config --global user.name "$GIT_USER"
|
||||||
|
git config --global user.email "$GIT_EMAIL"
|
||||||
|
|
||||||
|
# Get the hostname of the machine
|
||||||
|
HOSTNAME=$(hostname)
|
||||||
|
|
||||||
|
# If teleport token is set and there is no teleport.yaml file, create one
|
||||||
|
if [ -n "$TELEPORT_TOKEN" ] && [ ! -f /etc/teleport.yaml ]; then
|
||||||
|
teleport configure --roles=node --token="$TELEPORT_TOKEN" --proxy="$TELEPORT_URL" --no-acme -o file
|
||||||
|
echo "Created teleport configuration file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# File path
|
||||||
|
CONFIG_FILE="/etc/teleport.yaml"
|
||||||
|
|
||||||
|
# Edit the teleport.yaml file to update the nodename
|
||||||
|
sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" "$CONFIG_FILE"
|
||||||
|
|
||||||
# Function to add labels to teleport.yaml
|
# Function to add labels to teleport.yaml
|
||||||
# Function to add labels to teleport.yaml
|
# Function to add labels to teleport.yaml
|
||||||
add_teleport_labels() {
|
add_teleport_labels() {
|
||||||
@@ -156,37 +189,6 @@ add_teleport_labels() {
|
|||||||
# Add labels to teleport configuration
|
# Add labels to teleport configuration
|
||||||
add_teleport_labels
|
add_teleport_labels
|
||||||
|
|
||||||
# Change to the repository directory
|
|
||||||
cd /workspace
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# Copy the environment file to the repository's environments directory
|
|
||||||
if [ -f /environment/.dev.env ]; then
|
|
||||||
mkdir -p /workspace/environments
|
|
||||||
cp /environment/.dev.env /workspace/environments/.dev.env
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set the git user and email
|
|
||||||
git config --global user.name "$GIT_USER"
|
|
||||||
git config --global user.email "$GIT_EMAIL"
|
|
||||||
|
|
||||||
# Get the hostname of the machine
|
|
||||||
HOSTNAME=$(hostname)
|
|
||||||
|
|
||||||
# If teleport token is set and there is no teleport.yaml file, create one
|
|
||||||
if [ -n "$TELEPORT_TOKEN" ] && [ ! -f /etc/teleport.yaml ]; then
|
|
||||||
teleport configure --roles=node --token="$TELEPORT_TOKEN" --proxy="$TELEPORT_URL" --no-acme -o file
|
|
||||||
echo "Created teleport configuration file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# File path
|
|
||||||
CONFIG_FILE="/etc/teleport.yaml"
|
|
||||||
|
|
||||||
# Edit the teleport.yaml file to update the nodename
|
|
||||||
sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" "$CONFIG_FILE"
|
|
||||||
|
|
||||||
# Start Teleport in the background
|
# Start Teleport in the background
|
||||||
nohup teleport start &
|
nohup teleport start &
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user