Skip to content

Commit

Permalink
move script to container image
Browse files Browse the repository at this point in the history
  • Loading branch information
marshall007 committed Jul 1, 2024
1 parent 49599db commit 5e02c2c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 26 deletions.
4 changes: 4 additions & 0 deletions plugins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ USER root
ADD https://github.com/mattermost/mattermost-plugin-ai/releases/download/v$MATTERMOST_AI_PLUGIN_VERSION/mattermost-plugin-ai-v$MATTERMOST_AI_PLUGIN_VERSION-linux-amd64.tar.gz /extra-plugins/
ADD https://github.com/mattermost/mattermost-plugin-gitlab/releases/download/v$MATTERMOST_GITLAB_PLUGIN_VERSION/com.github.manland.mattermost-plugin-gitlab-$MATTERMOST_GITLAB_PLUGIN_VERSION.tar.gz /extra-plugins/

COPY ./entrypoint.sh /bin/entrypoint.sh

RUN chmod -R 777 /extra-plugins/*.tar.gz

ENTRYPOINT [ "/bin/entrypoint.sh" ]
16 changes: 16 additions & 0 deletions plugins/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/sh

set -e

PLUGINS_TAR=$(ls /extra-plugins)

cd /mattermost/plugins/

for plugin_tar in ${PLUGINS_TAR};
do
plugin_tar="/extra-plugins/${plugin_tar##*/}"
echo "extracting $plugin_tar ..."
tar -xf $plugin_tar
done

echo "finished loading plugins"
31 changes: 24 additions & 7 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ includes:
- cleanup: ./tasks/cleanup.yaml
- dependencies: ./tasks/dependencies.yaml
- test: ./tasks/test.yaml
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.0/tasks/create.yaml
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.0/tasks/lint.yaml
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.0/tasks/pull.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.0/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.6.0/tasks/setup.yaml
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/create.yaml
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/lint.yaml
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/pull.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.5.0/tasks/setup.yaml

tasks:
- name: default
Expand Down Expand Up @@ -53,8 +53,8 @@ tasks:
- task: create-mm-test-bundle
- task: setup:k3d-test-cluster
- task: deploy:test-bundle
- task: setup:create-doug-user
- task: test:all
# - task: setup:create-doug-user
# - task: test:all

- name: test-upgrade
description: Test an upgrade from the latest released package to the current branch
Expand All @@ -68,3 +68,20 @@ tasks:
- cmd: ./uds zarf tools kubectl delete pods --all --namespace mattermost
description: "Workaround - restart the pods so the sso configuration will take effect"
- task: test:all

- name: starlink
description: Setup k3d cluster, deploy Mattermost not pulling uds-core from oci
actions:
- task: create-mm-test-bundle
# - task: starlink-k3d-test-cluster
- task: deploy:test-bundle

- name: starlink-k3d-test-cluster
description: Setup k3d cluster, deploy Mattermost
actions:
- cmd: ./uds deploy uds-bundle-k3d-core-slim-dev-*-0.22.2.tar.zst --confirm --set INSECURE_ADMIN_PASSWORD_GENERATION=true

- name: starlink-pull
description: pull bundle locally for lackluster internet
actions:
- cmd: ./uds pull oci://defenseunicorns/uds/bundles/k3d-core-slim-dev:0.22.2
20 changes: 1 addition & 19 deletions values/common-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,9 @@ mattermostApp:
runAsGroup: 2000
extraInitContainers:
# Extra Container to install plugins
- name: init-plugins-config
- name: mattermost-extra-plugins
image: uds-package-mattermost/mattermost-extra-plugins:latest
imagePullPolicy: Always
command:
- sh
- "-c"
- |
set -e
PLUGINS_TAR=$(ls /extra-plugins)
cd /mattermost/plugins/
for plugin_tar in ${PLUGINS_TAR};
do
plugin_tar="/extra-plugins/${plugin_tar##*/}"
echo "extracting $plugin_tar ..."
tar -xf $plugin_tar
done
echo "finished loading plugins"
volumeMounts:
# Must match plugins volumes from chart

Expand Down

0 comments on commit 5e02c2c

Please sign in to comment.