Skip to content

Commit

Permalink
Dev/simplifications (#1)
Browse files Browse the repository at this point in the history
* fixing the playbooks and using microdnf to install modules

* update

* update chart version

* update default image for the chart
  • Loading branch information
fabien-sanglier-ibm authored Sep 23, 2022
1 parent ded355b commit 5a094aa
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
images: |
saggs/webmethods-devportal-configurator
tags: |
type=ref,event=tag
type=sha
type=match,pattern=v(.*),group=1
type=match,pattern=v[^-]*-(.*),group=1
Expand All @@ -42,7 +42,7 @@ jobs:
with:
context: .
build-args: |
BASE_IMAGE=redhat/ubi8
BASE_IMAGE=redhat/ubi8-minimal
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ install_artifacts/
build/
nohup.out
*.code-workspace

vault_pass
build.sh
34 changes: 10 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,10 @@
# 1. start by creating a base image
######################################################################################################

ARG BASE_IMAGE
ARG BASE_IMAGE=redhat/ubi8-minimal

FROM $BASE_IMAGE as base

## USER and HOME
ARG SAG_HOME=/opt/softwareag
ARG SAG_USER=saguser
ARG SAG_USERID=1724
ARG SAG_USER_DESC="Software AG User"
ARG SAG_GROUP=saguser
ARG SAG_GROUPID=1724

ENV SAG_HOME ${SAG_HOME}
ENV SAG_USER ${SAG_USER}
ENV SAG_USERID ${SAG_USERID}
ENV SAG_USER_DESC ${SAG_USER_DESC}
ENV SAG_GROUP ${SAG_GROUP}
ENV SAG_GROUPID ${SAG_GROUPID}

# Create saguser a process owner and group
RUN groupadd -g ${SAG_GROUPID} ${SAG_GROUP} && \
useradd -s /bin/bash -u ${SAG_USERID} -m -g ${SAG_GROUPID} -d ${SAG_HOME} -c "${SAG_USER_DESC}" ${SAG_USER} && \
mkdir -p ${SAG_HOME}/.ansible/tmp && \
chown -R ${SAG_USER}:${SAG_GROUP} ${SAG_HOME}/.ansible

# 2. start by creating an ansible base image
######################################################################################################

Expand All @@ -42,6 +21,7 @@ ENV ANSIBLE_VENV="${ANSIBLE_PATH}/venv"
ENV ANSIBLE_VERBOSITY="0"
ENV ANSIBLE_DEBUG="false"
ENV ANSIBLE_ROLES_PATH="~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles"
ENV ANSIBLE_PYTHON_INTERPRETER="${ANSIBLE_VENV}/bin/python3.9"

## ansible-specific config env vars

Expand All @@ -57,7 +37,7 @@ ENV ANSIBLE_HOST_KEY_CHECKING="False"

# Install Ansible
RUN set -x \
&& dnf -y install python39 \
&& microdnf -y install python39 \
&& python3 --version \
&& python3 -m venv ${ANSIBLE_VENV} \
&& source ${ANSIBLE_VENV}/bin/activate \
Expand Down Expand Up @@ -104,6 +84,9 @@ ARG SAG_ANSIBLE_ROLES_DEVPORTAL_FILENAME="${SAG_ANSIBLE_ROLES_DEVPORTAL}-${SAG_A
# ":" separated paths in which Ansible will search for Roles.
ENV ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${ANSIBLE_ROLES_BASEPATH}/${SAG_ANSIBLE_ROLES_COMMON_UTILS_FILENAME}/roles:${ANSIBLE_ROLES_BASEPATH}/${SAG_ANSIBLE_ROLES_DEVPORTAL_FILENAME}/roles"

# Install tools needed to extract
RUN microdnf -y install tar gzip

# add the roles
## Role 1: SAG_ANSIBLE_ROLES_COMMON_UTILS
RUN set -x \
Expand All @@ -125,7 +108,10 @@ FROM base_ansible_with_roles as final

LABEL org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.vendor="Softwareag Government Solutions" \
org.opencontainers.image.version="10.11"
org.opencontainers.image.title="webMethods Developer Portal Configurator" \
org.opencontainers.image.description="A container that can easily configure various functions of SoftwareAG webMethods Developer Portal from environment variable values passed in" \
org.opencontainers.image.version="10.11" \
org.opencontainers.image.source="https://github.com/softwareag-government-solutions/webmethods-devportal-configurator"

ENV wait_connect=true

Expand Down
3 changes: 0 additions & 3 deletions ansible/config_loadbalancer_url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
################################################################

- hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
tasks:

- ansible.builtin.debug:
Expand Down
3 changes: 0 additions & 3 deletions ansible/config_saml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
################################################################

- hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
tasks:

- ansible.builtin.debug:
Expand Down
3 changes: 0 additions & 3 deletions ansible/config_teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
################################################################

- hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
tasks:

- ansible.builtin.debug:
Expand Down
3 changes: 0 additions & 3 deletions ansible/config_usergroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
################################################################

- hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
tasks:

- ansible.builtin.debug:
Expand Down
3 changes: 0 additions & 3 deletions ansible/config_users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
################################################################

- hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
tasks:

- ansible.builtin.debug:
Expand Down
6 changes: 1 addition & 5 deletions ansible/update_password.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
## set configs via REST APIs
################################################################

- name: Reset passwords tasks
hosts: local
become: true
become_user: "{{ webmethods_user }}"
run_once: true
- hosts: local
tasks:

- name: Self Reset Main REST API User password
Expand Down
2 changes: 0 additions & 2 deletions ansible/wait_connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

- name: Check the target ports to ensure valid state
hosts: local
become: true
become_user: "{{ webmethods_user }}"
tasks:

## wait for port to be available
Expand Down
4 changes: 2 additions & 2 deletions charts/webmethods-devportal-configurator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: webmethods-devportal-configurator
description: Configure webmethods devportal using simple environment variables - Configuration as Code for webmethods-devportal-configurator.
home: https://github.com/saggs-cloudops/webmethods-devportal-configurator
version: 1.0.0-SNAPSHOT
appVersion: 1.0.0-SNAPSHOT
version: "1.0.0"
appVersion: "1.0.0"
maintainers:
- name: fabien sanglier
email: [email protected]
Expand Down
7 changes: 4 additions & 3 deletions charts/webmethods-devportal-configurator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ enabled: true
fullnameOverride: ""
nameOverride: ""

# default docker hub image at https://hub.docker.com/r/saggs/webmethods-devportal-configurator
image:
registry: ghcr.io/softwareag-government-solutions
repository: webmethods-devportal
tag: 10.11-latest
registry: ""
repository: saggs/webmethods-devportal-configurator
tag: "10.11"
pullPolicy: IfNotPresent

## Optionally specify an array of imagePullSecrets.
Expand Down

0 comments on commit 5a094aa

Please sign in to comment.