UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Plugins
Mattermost Admin Plugin
Commits
6f14fa79
Commit
6f14fa79
authored
May 27, 2021
by
Ajith Gudem
Browse files
Trying variable substitution in Docker and supporting shell scripts
parent
c0d4e93a
Pipeline
#281300
failed with stages
in 1 minute and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
30 deletions
+27
-30
Dockerfile
Dockerfile
+23
-23
install-mattermost-plugin.sh
install-mattermost-plugin.sh
+4
-7
No files found.
Dockerfile
View file @
6f14fa79
ARG
BASE_REGISTRY=registry1.dso.mil/ironbank
ARG
BASE_IMAGE=redhat/ubi/ubi8
ARG
BASE_TAG=8.3
#
ARG BASE_REGISTRY=registry1.dso.mil/ironbank
#
ARG BASE_IMAGE=redhat/ubi/ubi8
#
ARG BASE_TAG=8.3
FROM
${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS builder
ARG
MM_SERVER_VERSION=5.34.2
ARG
PLUGIN_ID=mil.dso.p1.mattermost-admin-plugin
ARG
PLUGIN_VERSION=1.0.3-rc
ARG
PLUGIN_ARTIFACT=mil.dso.p1.mattermost-admin-plugin-1.0.3-rc.tar.gz
# FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS builder
WORKDIR
/tmp
#
WORKDIR /tmp
COPY
call_mm_plugin_installer.sh .
COPY
install-mattermost-plugin.sh .
COPY
mil.dso.p1.mattermost-admin-plugin-1.0.3-rc.tar.gz .
#
COPY call_mm_plugin_installer.sh .
#
COPY install-mattermost-plugin.sh .
#
COPY mil.dso.p1.mattermost-admin-plugin-1.0.3-rc.tar.gz .
# RUN tar xvf linux_amd64.tar
FROM
registry1.dso.mil/ironbank/opensource/mattermost/mattermost:
5.34.2
FROM
registry1.dso.mil/ironbank/opensource/mattermost/mattermost:
${MM_SERVER_VERSION}
# FROM registry1.dso.mil/ironbank/docker/scratch:ironbank
#
ENV TARGET_URL="URL IS UNDEFINED"
# ENV
TARGET_TOKEN="TARGET TOKEN IS UNDEFINED"
#
RUN echo $PLUGIN_ID
# ENV
PLUGIN_ID=${PLUGIN_ID}
# ENV PLUGIN_VERSION=${PLUGIN_VERSION}
# WORKDIR mattermost/bin
# COPY --from=builder /tmp/mmctl .
WORKDIR
/scripts
COPY
--from=builder /tmp/mil.dso.p1.mattermost-admin-plugin-1.0.3-rc.tar.gz .
COPY
--from=builder /tmp/install-mattermost-plugin.sh .
COPY
--from=builder /tmp/call_mm_plugin_installer.sh .
COPY
call_mm_plugin_installer.sh .
COPY
install-mattermost-plugin.sh .
COPY
${PLUGIN_ARTIFACT}.tar.gz .
# COPY --from=builder /tmp/${PLUGIN_ID}-${PLUGIN_VERSION}}.tar.gz .
# COPY --from=builder /tmp/install-mattermost-plugin.sh .
# COPY --from=builder /tmp/call_mm_plugin_installer.sh .
USER
root
RUN
mkdir
-p
/home/mattermost
&&
chown
2000:2000 /home/mattermost
USER
2000
# RUN ln -s /tmp /home/mattermost
# The base image sets the UID to mattermost
# USER 1001
# USER 2000
# the entrypoint script calls the main installer which uses ENV vars for token and url to contact the target and install the plugin
# The entrypoint script calls the main installer which uses ENV vars for token and url to contact the target and install the plugin
ENTRYPOINT
[ "./call_mm_plugin_installer.sh" ]
# ENTRYPOINT [ "./install-mattermost-plugin.sh" ]
# ENTRYPOINT ["tail", "-f", "/dev/null"]
...
...
install-mattermost-plugin.sh
View file @
6f14fa79
...
...
@@ -33,15 +33,12 @@ echo " using Token: $token";
# look for th word "stored" for success, "Invalid" as failure
# if creds successfully stored, then delete the plugin by ID (we don't care if it fails or not)
result
=
$(
/mattermost/bin/mmctl plugin delete
com.mattermost.p1-admin-mattermost-plugin
)
result
=
$(
/mattermost/bin/mmctl plugin delete
${
PLUGIN_ID
}
)
# install the plugin with the tar.gz file
result
=
$(
/mattermost/bin/mmctl plugin add
mattermost-admin-plugin-1.0.2-rc
.tar.gz
--format
json
)
result
=
$(
/mattermost/bin/mmctl plugin add
${
PLUGIN_ID
}
-
${
PLUGIN_VERSION
}
.tar.gz
--format
json
)
# if the install was successful, then enable it
result
=
$(
/mattermost/bin/mmctl plugin
enable
com.mattermost.p1-admin-mattermost-plugin
--format
json
)
echo
$result
result
=
$(
/mattermost/bin/mmctl plugin
enable
${
PLUGIN_ID
}
--format
json
)
echo
"result:
$result
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment