Skip to content

Commit

Permalink
[ALS-7065] All-In-One PSAMA initial configuration environment file (#139
Browse files Browse the repository at this point in the history
)

* Add scripts for MySQL config and Auth0 integration
Enhanced MySQL instance configuration with additional JDBC replacement commands in `config.xml` files. Introduced a new job for exporting Jenkins build configurations with archiving functionality. Updated the Auth0 integration script to include replacements for client secret, client ID, and tenant.

* Update Docker MySQL volume paths to use configuration directory
Changed all paths for the MySQL Docker volume from `/root/.my.cnf` to `$DOCKER_CONFIG_DIR/.my.cnf` across multiple Jenkins jobs. This improves the maintenance and flexibility of the project's configuration files.

* Update MySQL configuration directory usage
Changed references from $DOCKER_CONFIG_DIR to $MYSQL_CONFIG_DIR across multiple Jenkins job config files and setup scripts to better organize and separate MySQL-specific configurations. This improves clarity and management of MySQL configuration settings.

* Add script to reset development environment
This script stops running services, prunes Docker images, and clears configuration directories. It ensures no critical directories are set incorrectly and resets specific paths with proper permissions.

* Update config.xml in Jenkins pipelines to fix array syntax
Added missing commas in the build_hashes array for three Jenkins pipeline configurations. This ensures proper syntax and prevents potential issues during pipeline execution.

* Update README for additional MySQL config directory parameter
Adjusted the install command to include a MySQL config directory. Updated documentation to reflect the new `MYSQL_CONFIG_DIR` variable, clarifying its usage and importance.

* Ignore and remove sensitive temp files
Added 'pass.tmp' and 'initial-configuration/pass.tmp' to .gitignore to avoid accidental commits of sensitive files. Deleted the existing 'initial-configuration/pass.tmp' file from the repository.

* Refactor MySQL connection settings in config.xml
Removed unnecessary MySQL connection string replacement for 'picsure' in psama/.env and 'auth' in wildfly/standalone.xml.

* Update MySQL config directory in Jenkins and install script
Changed the MySQL configuration directory path from `/root/` to `/usr/local/docker-config/picsure-db/` in the Jenkins config file and the install dependencies script.
  • Loading branch information
Gcolon021 authored and Luke Sikina committed Sep 5, 2024
1 parent a7c1507 commit 300bd7b
Show file tree
Hide file tree
Showing 27 changed files with 228 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.project
*.iml
initial-configuration/mysql-docker/.env
pass.tmp
initial-configuration/pass.tmp
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ you exact instructions. If you're following the legacy install instructions, you
`cd pic-sure-all-in-one/initial-configuration`
Choose one of the following use cases:
- *Fully dockerized install.* Our current happy path.
`sudo ./install-dependencies-docker.sh /path/to/desired/config/dir/ && source ~/.bashrc`
`sudo ./install-dependencies-docker.sh /path/to/desired/config/dir/ /path/to/desired/mysql/cnf/dir && source ~/.bashrc`
- *Legacy install.* I know what I'm doing. `sudo ./install-dependencies.sh`
- *Jenkins on https.* This is rare:
```shell
Expand All @@ -131,6 +131,7 @@ Once you have logged into Jenkins and have set up your admin account, you need t
system variables:

- `DOCKER_CONFIG_DIR`: `/path/to/config/dir` This is the path you passed to `install-dependencies-docker`
- `MYSQL_CONFIG_DIR`: `/path/to/mysql/cnf/dir` This is the path you passed to `install-dependencies-docker`
- `MYSQL_NETWORK`: `picsure` If you plan to switch to a remote database, this needs to be changed back to `host`

6. Run the Initial Configuration Pipeline job.
Expand Down
30 changes: 26 additions & 4 deletions initial-configuration/install-dependencies-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/usr/bin/env bash

sed_inplace() {
Expand Down Expand Up @@ -44,7 +43,28 @@ function set_docker_config_dir {
echo 'alias picsure-db="docker exec -ti picsure-db bash -c '\''mysql -uroot -p\$MYSQL_ROOT_PASSWORD'\''"' >> "$rc_file"
}

function set_mysql_config_dir() {
local mysql_config_dir=$1
if [ -z "$mysql_config_dir" ]; then
mysql_config_dir="$DOCKER_CONFIG_DIR/picsure-db/"
fi
#Check if mysql_config_dir is a dir and exists
if [ ! -d "$mysql_config_dir" ]; then
echo "Creating dir $mysql_config_dir and setting MYSQL_CONFIG_DIR in $rc_file"
mkdir -p $mysql_config_dir
export MYSQL_CONFIG_DIR=$mysql_config_dir
echo "export MYSQL_CONFIG_DIR=$mysql_config_dir" >> "$rc_file"
else
echo "dir $mysql_config_dir exists, just setting MYSQL_CONFIG_DIR in $rc_file"
# If the config dir exists, we still want to clean up old settings for it
export MYSQL_CONFIG_DIR=$1
grep 'MYSQL_CONFIG_DIR' "$rc_file" && sed_inplace '/MYSQL_CONFIG_DIR/d' "$rc_file"
echo "export MYSQL_CONFIG_DIR=$mysql_config_dir" >> "$rc_file"
fi
}

set_docker_config_dir "$1"
set_mysql_config_dir "$2"

#-------------------------------------------------------------------------------------------------#
# Docker Install #
Expand All @@ -55,7 +75,7 @@ echo "Starting update"
echo "Installing docker"
if [ -n "$(command -v yum)" ] && [ -z "$(command -v docker)" ]; then
echo "Yum detected. Assuming RHEL. Install commands will use yum"
set_docker_config_dir $1 "$HOME/.zshrc"
set_docker_config_dir $1 "$HOME/.zshrc"
yum -y update
# This repo can be removed after we move away from centos 7 I think
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Expand Down Expand Up @@ -89,7 +109,7 @@ if [ -n "$(command -v apt-get)" ] && [ -z "$(command -v docker)" ]; then
fi

if [[ "$OSTYPE" =~ ^darwin ]]; then
echo "Darwin detected. Assuming macOS. Install commands will use brew."
echo "Darwin detected. Assuming macOS. Install commands will use brew."
#check for brew
if [ -z "$(command -v brew)" ]; then
echo "Brew not detected. Please install brew and rerun this script."
Expand All @@ -111,7 +131,7 @@ fi
if [ -n "$(command -v apk)" ]; then
echo "apk detected. Assuming alpine. Install commands will use apk"
apk update && apk add --no-cache wget
fi
fi

if [ -z "$(command -v docker)" ]; then
echo "You dont have docker installed and we cant detect a supported package manager."
Expand Down Expand Up @@ -171,11 +191,13 @@ export APP_ID=`uuidgen | tr '[:upper:]' '[:lower:]'`
export APP_ID_HEX=`echo $APP_ID | awk '{ print toupper($0) }'|sed 's/-//g'`
sed_inplace "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" $DOCKER_CONFIG_DIR/httpd/picsureui_settings.json
sed_inplace "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" $DOCKER_CONFIG_DIR/wildfly/standalone.xml
sed_inplace "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" $DOCKER_CONFIG_DIR/psama/.env

export RESOURCE_ID=`uuidgen | tr '[:upper:]' '[:lower:]'`
export RESOURCE_ID_HEX=`echo $RESOURCE_ID | awk '{ print toupper($0) }'|sed 's/-//g'`
sed_inplace "s/__STACK_SPECIFIC_RESOURCE_UUID__/$RESOURCE_ID/g" $DOCKER_CONFIG_DIR/httpd/picsureui_settings.json


echo $APP_ID > $DOCKER_CONFIG_DIR/APP_ID_RAW
echo $APP_ID_HEX > $DOCKER_CONFIG_DIR/APP_ID_HEX
echo $RESOURCE_ID > $DOCKER_CONFIG_DIR/RESOURCE_ID_RAW
Expand Down
1 change: 1 addition & 0 deletions initial-configuration/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export APP_ID=`uuidgen -r`
export APP_ID_HEX=`echo $APP_ID | awk '{ print toupper($0) }'|sed 's/-//g'`
sed -i "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" /usr/local/docker-config/httpd/picsureui_settings.json
sed -i "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" /usr/local/docker-config/wildfly/standalone.xml
sed -i "s/__STACK_SPECIFIC_APPLICATION_ID__/$APP_ID/g" /usr/local/docker-config/psama/.env

export RESOURCE_ID=`uuidgen -r`
export RESOURCE_ID_HEX=`echo $RESOURCE_ID | awk '{ print toupper($0) }'|sed 's/-//g'`
Expand Down
4 changes: 3 additions & 1 deletion initial-configuration/jenkins/jenkins-docker/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<default>
<comparator class="hudson.util.CaseInsensitiveComparator" reference="../../../../../../views/listView/jobNames/comparator"/>
</default>
<int>6</int>
<int>7</int>
<string>project_specific_override_repo</string>
<string>__PROJECT_SPECIFIC_OVERRIDE_REPO__</string>
<string>release_control_branch</string>
Expand All @@ -209,6 +209,8 @@
<string>/usr/local/docker-config/</string>
<string>MYSQL_NETWORK</string>
<string>host</string>
<string>MYSQL_CONFIG_DIR</string>
<string>/usr/local/docker-config/picsure-db/</string>
</tree-map>
</envVars>
</hudson.slaves.EnvironmentVariablesNodeProperty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
<hudson.tasks.Shell>
<command># Get the resource from the db if it exists
export SQL=&quot;SELECT LOWER(CONCAT(SUBSTR(HEX(uuid), 1, 8), &apos;-&apos;, SUBSTR(HEX(uuid), 9, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 13, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 17, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 21))) from picsure.resource where name = &apos;$service_name&apos;&quot;;
export resource_uuid=$(docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -se &quot;$SQL&quot; picsure);
export resource_uuid=$(docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -se &quot;$SQL&quot; picsure);

# Add the resource to the database if it doesn&apos;t already exist
if [ -z &quot;$resource_uuid&quot; ]; then
echo &apos;This is the first time building this resource. Adding to db&apos;
echo &apos;&apos;
export SQL=&quot;INSERT IGNORE INTO picsure.resource (uuid, name, resourceRSPath, description) \
VALUES (UUID(), &apos;$service_name&apos;, &apos;http://$service_name/&apos;, &apos;$service_description&apos;)&quot;;
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure
fi

# Get the resource from the db
export SQL=&quot;SELECT LOWER(CONCAT(SUBSTR(HEX(uuid), 1, 8), &apos;-&apos;, SUBSTR(HEX(uuid), 9, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 13, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 17, 4), &apos;-&apos;, SUBSTR(HEX(uuid), 21))) from picsure.resource where name = &apos;$service_name&apos;&quot;;
export resource_uuid=$(docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -se &quot;$SQL&quot; picsure);
export resource_uuid=$(docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -se &quot;$SQL&quot; picsure);
echo &apos;&apos;
echo &quot;Done adding to db. Using $resource_uuid as uuid&quot;;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ sed -i &quot;s/$old_client_id/$AUTH0_CLIENT_ID/g&quot; /usr/local/docker-config/
sed -i &quot;s/$old_tenant/$AUTH0_TENANT/g&quot; /usr/local/docker-config/httpd/picsureui_settings.json
sed -i &quot;s/$old_tenant/$AUTH0_TENANT/g&quot; /usr/local/docker-config/wildfly/standalone.xml

sed -i &quot;s/$old_client_secret/$AUTH0_CLIENT_SECRET/g&quot; /usr/local/docker-config/psama/.env
sed -i &quot;s/$old_client_id/$AUTH0_CLIENT_ID/g&quot; /usr/local/docker-config/psama/.env
sed -i &quot;s/$old_tenant/$AUTH0_TENANT/g&quot; /usr/local/docker-config/psama/.env
</command>
</hudson.tasks.Shell>
</builders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export old_token_introspection_token=`cat /usr/local/docker-config/jupyterhub_co

sed -i &quot;s/$old_token_introspection_token/$new_token_introspection_token/g&quot; /usr/local/docker-config/jupyterhub_config.py

docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;update application set token=&apos;$new_token_introspection_token&apos; where uuid=$application_id;&quot; auth
</command>
</hudson.tasks.Shell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sed -i &quot;s/$old_token_introspection_token/$new_token_introspection_token/g&q

sed -i &quot;s/$old_token_introspection_token/$new_token_introspection_token/g&quot; /usr/local/docker-config/psama/.env

docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;update application set token=&apos;$new_token_introspection_token&apos;;&quot; auth
</command>
</hudson.tasks.Shell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ AIRFLOW_PASSWORD=`grep &quot;password&quot; /usr/local/docker-config/flyway/auth
PICSURE_PASSWORD=`sed -n &apos;s/&lt;password&gt;\(.*\)&lt;\/password&gt;/\1/p&apos; picsure.tmp | xargs`
AUTH_PASSWORD=`sed -n &apos;s/&lt;password&gt;\(.*\)&lt;\/password&gt;/\1/p&apos; auth.tmp | xargs`

docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on auth.* to &apos;airflow&apos;@&apos;%&apos; identified by &apos;$AIRFLOW_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on picsure.* to &apos;airflow&apos;@&apos;%&apos; identified by &apos;$AIRFLOW_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on picsure.* to &apos;picsure&apos;@&apos;%&apos; identified by &apos;$PICSURE_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on auth.* to &apos;auth&apos;@&apos;%&apos; identified by &apos;$AUTH_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on auth.* to &apos;airflow&apos;@&apos;%&apos; identified by &apos;$AIRFLOW_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on picsure.* to &apos;airflow&apos;@&apos;%&apos; identified by &apos;$AIRFLOW_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on picsure.* to &apos;picsure&apos;@&apos;%&apos; identified by &apos;$PICSURE_PASSWORD&apos;;flush privileges;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;grant all privileges on auth.* to &apos;auth&apos;@&apos;%&apos; identified by &apos;$AUTH_PASSWORD&apos;;flush privileges;&quot; mysql

if [ &quot;$DROP_EXISTING_TABLES&quot; = &quot;TRUE&quot;]; then
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &amp;quot;drop database IF EXISTS auth;&amp;quot; mysql
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &amp;quot;drop database IF EXISTS picsure;&amp;quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &amp;quot;drop database IF EXISTS auth;&amp;quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &amp;quot;drop database IF EXISTS picsure;&amp;quot; mysql
fi

docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;create database auth;&quot; mysql
docker run -i -v /root/.my.cnf:/root/.my.cnf mysql mysql -e &quot;create database picsure;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;create database auth;&quot; mysql
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf mysql mysql -e &quot;create database picsure;&quot; mysql
</command>
<configuredLocalRules/>
</hudson.tasks.Shell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<hudson.tasks.Shell>
<command>export USER_ID=`uuidgen -r`
export USER_ID_HEX=`echo $USER_ID | awk &apos;{ print toupper($0) }&apos;|sed &apos;s/-//g&apos;`
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;INSERT INTO auth.user VALUES (unhex(&apos;$USER_ID_HEX&apos;), null, &apos;{\&quot;email\&quot;:\&quot;$EMAIL\&quot;}&apos;, null, (select uuid from connection where label=&apos;$CONNECTION_LABEL&apos;),&apos;$EMAIL&apos;,0,null,1,null);&quot; auth
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;INSERT INTO auth.user_role VALUES (unhex(&apos;$USER_ID_HEX&apos;), unhex(&apos;002DC366B0D8420F998F885D0ED797FD&apos;));&quot; auth
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;INSERT INTO auth.user_role VALUES (unhex(&apos;$USER_ID_HEX&apos;), unhex(&apos;797FD002DC366B0D8420F998F885D0ED&apos;));&quot; auth
</command>
</hudson.tasks.Shell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
<hudson.tasks.Shell>
<command>CONNECTION_ID=`uuidgen -r`
CONNECTION_ID_HEX=`echo $CONNECTION_ID | awk &apos;{ print toupper($0) }&apos;|sed &apos;s/-//g&apos;;`
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;INSERT INTO auth.connection (uuid, label, id, subprefix, requiredFields) VALUES (unhex(&apos;$CONNECTION_ID_HEX&apos;), &apos;$CONNECTION_LABEL&apos;, &apos;$ID&apos;, &apos;$SUBPREFIX&apos;, &apos;$requiredFields&apos;);&quot; auth
USER_MAPPING_ID=`uuidgen -r`
USER_MAPPING_ID_HEX=`echo $USER_MAPPING_ID | awk &apos;{ print toupper($0) }&apos;|sed &apos;s/-//g&apos;;`
docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \
&quot;INSERT INTO auth.userMetadataMapping (uuid, auth0MetadataJsonPath, connectionId, generalMetadataJsonPath) VALUES (unhex(&apos;$USER_MAPPING_ID_HEX&apos;), &apos;\$.email&apos;, unhex(&apos;$CONNECTION_ID_HEX&apos;), &apos;\$.email&apos;);&quot; auth</command>

echo &quot;Please now edit the connections.json file in the httpd container and add your IDP button there. For more instructions see: https://pic-sure.gitbook.io/pic-sure/&quot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ RESOURCE_ID_HEX=`echo $RESOURCE_ID | awk &apos;{ print toupper($0) }&apos;|sed &
export SQL=&quot;INSERT INTO resource (uuid, targetURL, resourceRSPath, description, name, token) \
VALUES (unhex(&apos;$RESOURCE_ID_HEX&apos;), NULL, &apos;http://wildfly:8080/$RESOURCE_PATH/pic-sure/aggregate-data-sharing/&apos;, &apos;$RESOURCE_DESC&apos;, &apos;$RESOURCE_NAME&apos;, NULL);&quot;

docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure</command>
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ RESOURCE_ID_HEX=`echo $RESOURCE_ID | awk &apos;{ print toupper($0) }&apos;|sed &
export SQL=&quot;INSERT INTO resource (uuid, targetURL, resourceRSPath, description, name, token) \
VALUES (unhex(&apos;$RESOURCE_ID_HEX&apos;), NULL, &apos;http://wildfly:8080/$RESOURCE_PATH/pic-sure/passthru/&apos;, &apos;$RESOURCE_DESC&apos;, &apos;$RESOURCE_NAME&apos;, NULL);&quot;

docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure</command>
docker run -i -v $MYSQL_CONFIG_DIR/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e &quot;$SQL&quot; picsure</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@
<builders>
<hudson.tasks.Shell>
<command>
<!--Remove existing wildfly trust store so it doesn't break-->
rm -f /usr/local/docker-config/wildfly/application.truststore

<!--Download certs-->
curl https://letsencrypt.org/certs/isrgrootx1.der -o isrgrootx1.der
curl https://letsencrypt.org/certs/lets-encrypt-r3.der -o lets-encrypt-r3.der

<!--Import Certs to trust store-->
keytool -import -keystore /usr/local/docker-config/wildfly/application.truststore -storepass password -noprompt -trustcacerts -alias letsencryptauthority1 -file isrgrootx1.der -storetype JKS
keytool -import -keystore /usr/local/docker-config/wildfly/application.truststore -storepass password -noprompt -trustcacerts -alias letsencryptauthority2 -file lets-encrypt-r3.der -storetype JKS

<!--Remove existing psama trust store so it doesn't break-->
rm -rf /usr/local/docker-config/psama/application.truststore

curl https://letsencrypt.org/certs/isrgrootx1.der -o isrgrootx1.der
curl https://letsencrypt.org/certs/lets-encrypt-r3.der -o lets-encrypt-r3.der

keytool -import -keystore /usr/local/docker-config/psama/application.truststore -storepass password -noprompt -trustcacerts -alias letsencryptauthority1 -file isrgrootx1.der -storetype JKS
keytool -import -keystore /usr/local/docker-config/psama/application.truststore -storepass password -noprompt -trustcacerts -alias letsencryptauthority2 -file lets-encrypt-r3.der -storetype JKS
</command>
</hudson.tasks.Shell>
</builders>
Expand Down
Loading

0 comments on commit 300bd7b

Please sign in to comment.