Commit b16d57eb authored by Vesa Vertainen's avatar Vesa Vertainen

Private registry pipeline enabled in setup-pipeline.sh, updated build.sh

parent 85f289e1
......@@ -394,14 +394,13 @@ Now you should be able to build the pilot environment using following commands o
.. or if you want to use dns-proxy
1. cd ${BUILD_PATH}/build
2. docker-compose up -d db ci worker gitlab dns
.. or with Docker private registry
1. cd ${BUILD_PATH}/build
2. docker-compose up -d db ci worker gitlab reg
3. docker login https://${EXTERNAL_URL_REGISTRY}:5000
3. sudo bash ./setup-private-registry.sh
Use and login to the services on the pilot environment with following credentials:
* username: $USER_NAME
......@@ -414,6 +413,7 @@ Local Gitlab credentials:
Services:
* Concourse CI: https://${EXTERNAL_URL_CONCOURSE}:443 or https://${ALT_EXTERNAL_URL_CONCOURSE} (if proxy is enabled)
* CinCan Gitlab: https://${EXTERNAL_URL_GITLAB}:5443 or https://${ALT_EXTERNAL_URL_GITLAB} (if proxy is enabled)
* Private registry https://${EXTERNAL_URL_REGISTRY}:5000 (if enabled)
EOL
echo -e "$CHECK cat ${BUILD_PATH}/build/README"
......
......@@ -29,7 +29,6 @@ echo -e "$CHECK Cloning the pipelines.git"
# Get available pipelines
PIPELINES=$(find pipelines/ \( -name "setup.sh" \) | grep -oP './\K.*?(?=/)')
PS3="Your choice: "
# Help, list available pipelines
[ "$1" = "-h" ] || [ "$1" = "--help" ] &&
......@@ -40,14 +39,26 @@ PS3="Your choice: "
# Pipeline selection menu
[ "$1" = "" ] &&
echo -e "\nAvailable pipelines" &&
i=0 &&
# Get pipelines with setup.sh, and possible private registry versions
echo -e "\nAvailable pipelines"
i=0 && j=0
while [ $i -lt "$(echo "$PIPELINES" | wc -l)" ]; do
i=$((i+1))
OPTIONS[i]=$(echo "$PIPELINES" |awk NR==$i)
done &&
OPTIONS[$((i+1))]="Quit" &&
i=$((i+1)) && j=$((j+1))
OPTIONS[j]=$(echo "$PIPELINES" |awk NR==$i)
if [ -f pipelines/${OPTIONS[$j]}/pipeline-private-registry.sh ]; then
j=$((j+1))
REGISTRY_VERSION="Private registry version"
OPTIONS[j]=$(echo "$PIPELINES" |awk NR==$i)" $REGISTRY_VERSION"
fi
done
# Add quit option
OPTIONS[$((j+1))]="Quit"
# Menu
PS3="Your choice: "
select CHOSEN_PIPELINE in "${OPTIONS[@]}"; do
if [[ -n "$CHOSEN_PIPELINE" ]]; then
PIPELINE="$CHOSEN_PIPELINE"
......@@ -58,8 +69,15 @@ PS3="Your choice: "
fi
done
# Check if private registry was chosen
if [[ $CHOSEN_PIPELINE == *"Private"* ]]; then
CHOSEN_PIPELINE="${CHOSEN_PIPELINE/" $REGISTRY_VERSION"/""}"
fi
# Change directory and launch pipeline setup.sh, if exists
[ "$CHOSEN_PIPELINE" != "Quit" ] &&
cd pipelines || exit &&
[ -d "$PIPELINE" ] && ( cd "$PIPELINE" && echo -e "$CHECK Run $PIPELINE/setup.sh" && [ -f "./setup.sh" ] && ./setup.sh "$BUILD_PATH" "$2" \
|| echo -e "$ERROR $PIPELINE/setup.sh not found or script interrupted" ) || echo -e "$ERROR Pipeline $PIPELINE not found"
[ -d "$CHOSEN_PIPELINE" ] && ( cd "$CHOSEN_PIPELINE" && echo -e "$CHECK Run $CHOSEN_PIPELINE/setup.sh $2 $REGISTRY_VERSION" \
&& [ -f "./setup.sh" ] && ./setup.sh "$BUILD_PATH" "$2" "$REGISTRY_VERSION" \
|| echo -e "$ERROR $CHOSEN_PIPELINE/setup.sh not found or script interrupted" ) || echo -e "$ERROR Pipeline $CHOSEN_PIPELINE not found"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment