Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files for building from Rocky8 #171

Merged
merged 4 commits into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ fedora:
- !regexp fedora([0-9.]+)
centos:
- !regexp centos([0-9.]+)
rockylinux:
- !regexp rockylinux([0-9.]+)
ubuntu:
- bionic
- focal
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ focal:
service: suite

el8:
build: ./packagingenv/centos8
build: ./packagingenv/rockylinux8
extends:
file: docker-compose.override.yml
service: suite
Expand All @@ -37,7 +37,7 @@ focal-test:
service: suite-test

el8-test:
build: ./testingenv/centos8
build: ./testingenv/rockylinux8
extends:
file: docker-compose.override.yml
service: suite-test
Expand Down
4 changes: 2 additions & 2 deletions packagingenv/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM {{ dist }}:{{ version }}

{% if dist in ('centos', 'fedora') -%}
{% if dist in ('centos', 'fedora', 'rockylinux') -%}

RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools

# Add NodeSource repo
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -

{%- if version in ('centos8') %}
{%- if version in ('centos8', 'rockylinux8') %}

# Install development tools
RUN yum -y module install nodejs:10
Expand Down
21 changes: 21 additions & 0 deletions packagingenv/rockylinux8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM rockylinux:8

RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools

# Add NodeSource repo
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -

# Install development tools
RUN yum -y module install nodejs:10

# Install python3 for gyp
RUN yum -y install python3

# Upgrade gyp to a python3 compatible version
RUN npm install -g node-gyp@latest

# Install development tools
RUN yum -y install nodejs

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
18 changes: 18 additions & 0 deletions packagingenv/rockylinux8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -eu
set -o pipefail

operation="${1:-build}"

case "$operation" in
pull)
;;
build)
rpmbuild -bb rpm/st2chatops.spec
cp ../*.rpm $ARTIFACT_DIR
;;
*)
[[ $# -gt 0 ]] && exec "$@"
;;
esac
2 changes: 1 addition & 1 deletion testingenv/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM {{ dist }}:{{ version }}

{% if dist in ('centos', 'fedora') -%}
{% if dist in ('centos', 'fedora', 'rockylinux') -%}

# Add NodeSource repo
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
Expand Down
10 changes: 10 additions & 0 deletions testingenv/rockylinux8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM rockylinux:8

# Add NodeSource repo
RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -

# Install development tools
RUN yum -y install nodejs

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
28 changes: 28 additions & 0 deletions testingenv/rockylinux8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -eu
set -o pipefail

operation="${1:-test}"

case "$operation" in
pull)
;;
test)
yum install -y $ARTIFACT_DIR/*.rpm
cd /opt/stackstorm/chatops
sed -i.bak -r "s/^# (export HUBOT_ADAPTER=slack)/\1/" st2chatops.env
sed -i.bak -r "s/^# (export HUBOT_SLACK_TOKEN.).*/\1$SLACK_TOKEN/" st2chatops.env
sed -i.bak -r "s/^(export ST2_AUTH_USERNAME.).*/\1$ST2_USERNAME/" st2chatops.env
sed -i.bak -r "s/^(export ST2_AUTH_PASSWORD.).*/\1$ST2_PASSWORD/" st2chatops.env
bin/hubot &> /tmp/hubot.log &
sleep 15
cat /tmp/hubot.log
grep -rq "INFO Connected to Slack RTM" /tmp/hubot.log && \
grep -rq "INFO [[:digit:]]\+ commands are loaded" /tmp/hubot.log
exit $?
;;
*)
[[ $# -gt 0 ]] && exec "$@"
;;
esac