From 7f38a08f21bd6dd493c4d04cecf21873af673fa6 Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 16:21:53 +0000 Subject: [PATCH 01/17] [WIP]Node 20 --- dev/Dockerfile | 2 +- packagingenv/Dockerfile.template | 2 +- packagingenv/focal/Dockerfile | 2 +- packagingenv/rockylinux8/Dockerfile | 2 +- testingenv/Dockerfile.template | 2 +- testingenv/focal/Dockerfile | 2 +- testingenv/rockylinux8/Dockerfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/Dockerfile b/dev/Dockerfile index 2c40003..469f971 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,4 +1,4 @@ -FROM node:10.15-slim +FROM node:20.11.1-slim RUN apt-get update && apt-get install -y \ python \ diff --git a/packagingenv/Dockerfile.template b/packagingenv/Dockerfile.template index 96eb47b..67f11a9 100755 --- a/packagingenv/Dockerfile.template +++ b/packagingenv/Dockerfile.template @@ -5,7 +5,7 @@ FROM {{ dist }}:{{ version }} 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 - +RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - {%- if version in ('centos8', 'rockylinux8') %} diff --git a/packagingenv/focal/Dockerfile b/packagingenv/focal/Dockerfile index 322bf20..34fcb46 100644 --- a/packagingenv/focal/Dockerfile +++ b/packagingenv/focal/Dockerfile @@ -8,7 +8,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd # Add NodeSource repo -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - # Install node RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index d96bfde..2010f8e 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -3,7 +3,7 @@ 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 - +RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools RUN yum -y module install nodejs:10 diff --git a/testingenv/Dockerfile.template b/testingenv/Dockerfile.template index cfe14da..0b7e0b1 100644 --- a/testingenv/Dockerfile.template +++ b/testingenv/Dockerfile.template @@ -3,7 +3,7 @@ FROM {{ dist }}:{{ version }} {% if dist in ('centos', 'fedora', 'rockylinux') -%} # Add NodeSource repo -RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash - +RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools RUN yum -y install nodejs diff --git a/testingenv/focal/Dockerfile b/testingenv/focal/Dockerfile index 1567a0e..2fdafa4 100644 --- a/testingenv/focal/Dockerfile +++ b/testingenv/focal/Dockerfile @@ -5,7 +5,7 @@ RUN apt-get clean && apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install curl gnupg # Add NodeSource repo -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - # Install node RUN apt-get update && \ diff --git a/testingenv/rockylinux8/Dockerfile b/testingenv/rockylinux8/Dockerfile index 426db9a..6b58e7b 100755 --- a/testingenv/rockylinux8/Dockerfile +++ b/testingenv/rockylinux8/Dockerfile @@ -1,7 +1,7 @@ FROM rockylinux:8 # Add NodeSource repo -RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash - +RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools RUN yum -y install nodejs From c1fe0c6068ca38ea0e17d691967d5d2bcde792fb Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 16:25:36 +0000 Subject: [PATCH 02/17] Missed update to 20 --- packagingenv/rockylinux8/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index 2010f8e..401d5a7 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -6,7 +6,7 @@ RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools -RUN yum -y module install nodejs:10 +RUN yum -y module install nodejs:20 # Install python3 for gyp RUN yum -y install python3 From 59265a8b7e47cdec8486ffafa3822318ade52cba Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 16:36:51 +0000 Subject: [PATCH 03/17] Coffeescript from PR#186 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ad8d6d..6e43234 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "botbuilder": "^3.30.0", "coffee-register": "1.0.0", "coffee-script": "1.12.7", + "coffeescript": "1.12.7", "hubot": "^3.5.0", "hubot-botframework": "git+https://github.com/microsoft/BotFramework-Hubot.git#01d5be9", "hubot-diagnostics": "0.0.2", @@ -25,6 +26,6 @@ "hubot-xmpp": "^0.2.6" }, "engines": { - "node": ">=10.0 <=14.0" + "node": ">=20.0" } } From 9544a33b93e460749b3ac37b1dd4d5d6b2d39a3d Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 17:05:00 +0000 Subject: [PATCH 04/17] Stealing from PR #186 --- packagingenv/Dockerfile.template | 29 ++++++++++++++++------------- packagingenv/focal/Dockerfile | 13 +++++-------- packagingenv/rockylinux8/Dockerfile | 15 ++++++--------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/packagingenv/Dockerfile.template b/packagingenv/Dockerfile.template index 67f11a9..ac7d01d 100755 --- a/packagingenv/Dockerfile.template +++ b/packagingenv/Dockerfile.template @@ -9,38 +9,41 @@ RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - {%- if version in ('centos8', 'rockylinux8') %} -# Install development tools -RUN yum -y module install nodejs:10 +# Install node +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ + source ~/.bashrc && \ + nvm install 20.8.1 && \ + node -v && npm -v # Install python3 for gyp RUN yum -y install python3 # Upgrade gyp to a python3 compatible version -RUN npm install -g node-gyp@latest +RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest {%- endif %} -# Install development tools -RUN yum -y install nodejs +# Install node +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ + source ~/.bashrc && \ + nvm install 20.8.1 && \ + node -v && npm -v {% else -%} # Install prerequisites RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - build-essential curl gnupg devscripts debhelper dh-make git libicu-dev + build-essential curl gnupg devscripts debhelper dh-make git libicu-dev curl {%- if version in ('focal') %} RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd {% endif %} -# Add NodeSource repo -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - -# Install node -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs - -RUN apt-get clean +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \ + . ~/.bashrc && \ + nvm install 20.8.1 && \ + node -v && npm -v {% endif -%} diff --git a/packagingenv/focal/Dockerfile b/packagingenv/focal/Dockerfile index 34fcb46..8d34ac8 100644 --- a/packagingenv/focal/Dockerfile +++ b/packagingenv/focal/Dockerfile @@ -3,17 +3,14 @@ FROM ubuntu:focal # Install prerequisites RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - build-essential curl gnupg devscripts debhelper dh-make git libicu-dev + build-essential curl gnupg devscripts debhelper dh-make git libicu-dev curl RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd -# Add NodeSource repo -RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - - -# Install node -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs - -RUN apt-get clean +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \ + . ~/.bashrc && \ + nvm install 20.8.1 && \ + node -v && npm -v COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index 401d5a7..4883cc5 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -2,20 +2,17 @@ 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_20.x | bash - - -# Install development tools -RUN yum -y module install nodejs:20 +# Install node +RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ + source ~/.bashrc && \ + nvm install 20.8.1 && \ + node -v && npm -v # 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 +RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] From f40240e1fcaa84157a1de974fb735dc98fc4451c Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 17:12:57 +0000 Subject: [PATCH 05/17] Amendments --- .circleci/config.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f186708..2a8648c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ jobs: echo "Cloning ${ST2_DOCKER_BRANCH:-DEPRECATED/all-in-one} branch of st2-docker" git clone --branch ${ST2_DOCKER_BRANCH:-DEPRECATED/all-in-one} --depth 1 ${ST2_TEST_ENVIRONMENT} ~/st2-docker make -C ~/st2-docker env - sudo apt-get update -qq && sudo apt-get install -y rpm jq nodejs net-tools + sudo apt-get update -qq && sudo apt-get install -y rpm jq nodejs net-tools npm gem install package_cloud sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose diff --git a/Dockerfile b/Dockerfile index bb5889d..35c232d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14.17-slim +FROM node:20.11.1-slim RUN apt update && apt install --yes \ python \ From a187b737eb704d0c5f8633933d20497f55368989 Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 17:21:35 +0000 Subject: [PATCH 06/17] Add npm to Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 35c232d..d31a170 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM node:20.11.1-slim RUN apt update && apt install --yes \ python \ + npm \ libicu-dev \ libxml2-dev \ libexpat1-dev \ From f89024894d7fbd7b8b344a287d23165605789511 Mon Sep 17 00:00:00 2001 From: amanda Date: Mon, 18 Mar 2024 18:04:38 +0000 Subject: [PATCH 07/17] Go back to setup_env --- packagingenv/focal/Dockerfile | 11 +++++++---- packagingenv/rockylinux8/Dockerfile | 13 ++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packagingenv/focal/Dockerfile b/packagingenv/focal/Dockerfile index 8d34ac8..1ea1d50 100644 --- a/packagingenv/focal/Dockerfile +++ b/packagingenv/focal/Dockerfile @@ -6,11 +6,14 @@ RUN apt-get update && \ build-essential curl gnupg devscripts debhelper dh-make git libicu-dev curl RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd +# Add NodeSource repo +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - + +# Install node +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs + +RUN apt-get clean -RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \ - . ~/.bashrc && \ - nvm install 20.8.1 && \ - node -v && npm -v COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index 4883cc5..1395853 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -2,17 +2,20 @@ 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_20.x | bash - + # Install node -RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ - source ~/.bashrc && \ - nvm install 20.8.1 && \ - node -v && npm -v +RUN yum -y module install nodejs:20.1.1 # Install python3 for gyp RUN yum -y install python3 # Upgrade gyp to a python3 compatible version -RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest +RUN npm install -g node-gyp@latest + +# Install development tools +RUN yum -y install nodejs:20.1.1 COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] From b9d0741f56b361c5bf494fd67974d05ba7e9ac2d Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 13:41:47 +0100 Subject: [PATCH 08/17] Auth problem comes as npm-shrinkwrap generated by npm6 so needs login creds to re-generate, so try using npm 6 and node 20 --- .circleci/config.yml | 2 ++ Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a8648c..a8e529b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,9 +34,11 @@ jobs: sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose rm -rf node_modules + npm install npm@6 # print versions docker-compose version nodejs -v + npm --version jq --version - run: name: Ensure Docker running diff --git a/Dockerfile b/Dockerfile index d31a170..0f7051e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:20.11.1-slim RUN apt update && apt install --yes \ - python \ + python3 \ npm \ libicu-dev \ libxml2-dev \ @@ -12,6 +12,7 @@ RUN apt update && apt install --yes \ COPY . /app WORKDIR /app +RUN npm install npm@6 -g RUN npm install --production && npm cache verify RUN apt remove --yes \ From ad7e88cd82df72d1d6f3daab906dd223267ebbdc Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 13:49:10 +0100 Subject: [PATCH 09/17] Undo npm change in circleci --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a8e529b..a48ad00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,6 @@ jobs: sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose rm -rf node_modules - npm install npm@6 # print versions docker-compose version nodejs -v From 51686c1b775e4c6083a05d39d16014da819ea00e Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 14:05:31 +0100 Subject: [PATCH 10/17] Downgrade npm and amendments on rockylinux --- packagingenv/focal/Dockerfile | 1 + packagingenv/rockylinux8/Dockerfile | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packagingenv/focal/Dockerfile b/packagingenv/focal/Dockerfile index 1ea1d50..c6b0c89 100644 --- a/packagingenv/focal/Dockerfile +++ b/packagingenv/focal/Dockerfile @@ -13,6 +13,7 @@ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs RUN apt-get clean +RUN npm install -g npm@6 COPY docker-entrypoint.sh /entrypoint.sh diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index 1395853..336156f 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -3,10 +3,11 @@ 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_20.x | bash - +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install node -RUN yum -y module install nodejs:20.1.1 +RUN yum -y module install nodejs:20 +RUN node --version # Install python3 for gyp RUN yum -y install python3 @@ -15,7 +16,10 @@ RUN yum -y install python3 RUN npm install -g node-gyp@latest # Install development tools -RUN yum -y install nodejs:20.1.1 +#RUN yum -y install nodejs:20.1.1 + +# Downgrade npm +RUN npm install -g npm@6 COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] From fe8ce57c370e179146e5a5c3ad23b25b3e7d82c7 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 14:23:57 +0100 Subject: [PATCH 11/17] Update debian control version and updating testingenv for rockylinux8 --- debian/control | 2 +- packagingenv/rockylinux8/Dockerfile | 4 ---- testingenv/rockylinux8/Dockerfile | 7 +++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/debian/control b/debian/control index 878d453..ebe97b9 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Browser: https://github.com/stackstorm/st2chatops Package: st2chatops Architecture: any Pre-Depends: dpkg (>= 1.16.16) -Depends: nodejs (>= 10.0.0), nodejs (< 15.0.0) +Depends: nodejs (>= 20.0.0) Description: St2Chatops - StackStorm ChatOps. Package providing StackStorm ChatOps functionality: bundled, tested and ready to use Hubot with hubot-stackstorm plugin and additional chat adapters diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index 336156f..b799c9e 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -7,7 +7,6 @@ RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools # Install node RUN yum -y module install nodejs:20 -RUN node --version # Install python3 for gyp RUN yum -y install python3 @@ -15,9 +14,6 @@ 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:20.1.1 - # Downgrade npm RUN npm install -g npm@6 diff --git a/testingenv/rockylinux8/Dockerfile b/testingenv/rockylinux8/Dockerfile index 6b58e7b..e3bf8b7 100755 --- a/testingenv/rockylinux8/Dockerfile +++ b/testingenv/rockylinux8/Dockerfile @@ -1,10 +1,13 @@ FROM rockylinux:8 # Add NodeSource repo -RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools -RUN yum -y install nodejs +RUN yum -y module install nodejs:20 + +# Downgrade npm +RUN npm install -g npm@6 COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] From f43af74a7e9e90df3b57d11c21a362b7d3e8f0af Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 14:32:54 +0100 Subject: [PATCH 12/17] Add EL9 and update templates and do not downgrade npm on test containers --- .circleci/config.yml | 6 ++-- packagingenv/Dockerfile.template | 27 +++++++++--------- packagingenv/rockylinux9/Dockerfile | 25 +++++++++++++++++ packagingenv/rockylinux9/docker-entrypoint.sh | 18 ++++++++++++ testingenv/Dockerfile.template | 4 +-- testingenv/rockylinux8/Dockerfile | 3 -- testingenv/rockylinux9/Dockerfile | 10 +++++++ testingenv/rockylinux9/docker-entrypoint.sh | 28 +++++++++++++++++++ 8 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 packagingenv/rockylinux9/Dockerfile create mode 100755 packagingenv/rockylinux9/docker-entrypoint.sh create mode 100755 testingenv/rockylinux9/Dockerfile create mode 100755 testingenv/rockylinux9/docker-entrypoint.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index a48ad00..80019ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,10 +9,10 @@ jobs: machine: image: "ubuntu-2204:2023.04.2" working_directory: ~/StackStorm/st2chatops - parallelism: 2 + parallelism: 3 shell: /bin/bash --login environment: - DISTROS: focal el8 + DISTROS: focal el8 el9 ST2_PACKAGES_REPO: https://github.com/StackStorm/st2-packages ST2_TEST_ENVIRONMENT: https://github.com/StackStorm/st2-docker DEPLOY_PACKAGES: 1 @@ -122,7 +122,7 @@ jobs: - image: circleci/ruby:2.7 working_directory: ~/packages environment: - DISTROS: "focal el8" + DISTROS: "focal el8 el9" steps: - attach_workspace: at: /home/circleci diff --git a/packagingenv/Dockerfile.template b/packagingenv/Dockerfile.template index ac7d01d..d8e7411 100755 --- a/packagingenv/Dockerfile.template +++ b/packagingenv/Dockerfile.template @@ -5,23 +5,19 @@ FROM {{ dist }}:{{ version }} RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools # Add NodeSource repo -RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - - -{%- if version in ('centos8', 'rockylinux8') %} +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install node -RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ - source ~/.bashrc && \ - nvm install 20.8.1 && \ - node -v && npm -v +RUN yum -y module install nodejs:20 # Install python3 for gyp RUN yum -y install python3 # Upgrade gyp to a python3 compatible version -RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest +RUN npm install -g node-gyp@latest -{%- endif %} +# Downgrade npm +RUN npm install -g npm@6 # Install node RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ @@ -40,10 +36,15 @@ RUN apt-get update && \ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd {% endif %} -RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \ - . ~/.bashrc && \ - nvm install 20.8.1 && \ - node -v && npm -v +# Add NodeSource repo +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - + +# Install node +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs + +RUN apt-get clean +RUN npm install -g npm@6 + {% endif -%} diff --git a/packagingenv/rockylinux9/Dockerfile b/packagingenv/rockylinux9/Dockerfile new file mode 100644 index 0000000..4b285e4 --- /dev/null +++ b/packagingenv/rockylinux9/Dockerfile @@ -0,0 +1,25 @@ +FROM rockylinux:9 + +RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools + +# Add NodeSource repo +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - + +# Install node +RUN yum -y module install nodejs:20 +RUN node --version + +# 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:20.1.1 + +# Downgrade npm +RUN npm install -g npm@6 + +COPY docker-entrypoint.sh /entrypoint.sh +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/packagingenv/rockylinux9/docker-entrypoint.sh b/packagingenv/rockylinux9/docker-entrypoint.sh new file mode 100755 index 0000000..7745d54 --- /dev/null +++ b/packagingenv/rockylinux9/docker-entrypoint.sh @@ -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 diff --git a/testingenv/Dockerfile.template b/testingenv/Dockerfile.template index 0b7e0b1..4305f34 100644 --- a/testingenv/Dockerfile.template +++ b/testingenv/Dockerfile.template @@ -3,10 +3,10 @@ FROM {{ dist }}:{{ version }} {% if dist in ('centos', 'fedora', 'rockylinux') -%} # Add NodeSource repo -RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools -RUN yum -y install nodejs +RUN yum -y module install nodejs:20 {% else -%} diff --git a/testingenv/rockylinux8/Dockerfile b/testingenv/rockylinux8/Dockerfile index e3bf8b7..59b97ba 100755 --- a/testingenv/rockylinux8/Dockerfile +++ b/testingenv/rockylinux8/Dockerfile @@ -6,8 +6,5 @@ FROM rockylinux:8 # Install development tools RUN yum -y module install nodejs:20 -# Downgrade npm -RUN npm install -g npm@6 - COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/testingenv/rockylinux9/Dockerfile b/testingenv/rockylinux9/Dockerfile new file mode 100755 index 0000000..367a419 --- /dev/null +++ b/testingenv/rockylinux9/Dockerfile @@ -0,0 +1,10 @@ +FROM rockylinux:9 + +# Add NodeSource repo +#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - + +# Install development tools +RUN yum -y module install nodejs:20 + +COPY docker-entrypoint.sh /entrypoint.sh +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/testingenv/rockylinux9/docker-entrypoint.sh b/testingenv/rockylinux9/docker-entrypoint.sh new file mode 100755 index 0000000..a4fdaf1 --- /dev/null +++ b/testingenv/rockylinux9/docker-entrypoint.sh @@ -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 From 1289cc1c931bf89b6ee429cd9085842137bf5d62 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 14:40:58 +0100 Subject: [PATCH 13/17] Update rpm spec --- docker-compose.yml | 12 ++++++++++++ rpm/st2chatops.spec | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6d9e5c3..3349bb7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,12 @@ el8: file: docker-compose.override.yml service: suite +el9: + build: ./packagingenv/rockylinux9 + extends: + file: docker-compose.override.yml + service: suite + # Testing environments focal-test: build: ./testingenv/focal @@ -24,3 +30,9 @@ el8-test: file: docker-compose.override.yml service: suite-test +el9-test: + build: ./testingenv/rockylinux9 + extends: + file: docker-compose.override.yml + service: suite-test + diff --git a/rpm/st2chatops.spec b/rpm/st2chatops.spec index f92ca50..053b752 100644 --- a/rpm/st2chatops.spec +++ b/rpm/st2chatops.spec @@ -8,7 +8,7 @@ Name: st2chatops Version: %{version} Release: %{release} -Requires: nodejs >= 2:10.0, nodejs < 2:15.0 +Requires: nodejs >= 2:20.0 Summary: St2Chatops - StackStorm ChatOps From bde6371bab8cd7e44b102170135b89177a6a1320 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 15:40:28 +0100 Subject: [PATCH 14/17] Amend spec file --- rpm/st2chatops.spec | 5 ++++- testingenv/rockylinux8/Dockerfile | 2 +- testingenv/rockylinux9/Dockerfile | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rpm/st2chatops.spec b/rpm/st2chatops.spec index 053b752..a35ac92 100644 --- a/rpm/st2chatops.spec +++ b/rpm/st2chatops.spec @@ -8,7 +8,7 @@ Name: st2chatops Version: %{version} Release: %{release} -Requires: nodejs >= 2:20.0 +Requires: nodejs >= 20.0 Summary: St2Chatops - StackStorm ChatOps @@ -30,6 +30,9 @@ Requires: /bin/bash Requires: /bin/sh Requires: /usr/bin/env %endif +%if 0%{?rhel} >= 9 +BuildRequires: systemd-rpm-macros +%endif # Cat debian/package.dirs, set buildroot prefix and create directories. %define debian_dirs cat debian/%{name}.dirs | grep -v '^\\s*#' | sed 's~^~%{buildroot}/~' | \ diff --git a/testingenv/rockylinux8/Dockerfile b/testingenv/rockylinux8/Dockerfile index 59b97ba..e06b5db 100755 --- a/testingenv/rockylinux8/Dockerfile +++ b/testingenv/rockylinux8/Dockerfile @@ -4,7 +4,7 @@ FROM rockylinux:8 #RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools -RUN yum -y module install nodejs:20 +RUN yum -y module install nodejs:20 COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/testingenv/rockylinux9/Dockerfile b/testingenv/rockylinux9/Dockerfile index 367a419..d08a7d0 100755 --- a/testingenv/rockylinux9/Dockerfile +++ b/testingenv/rockylinux9/Dockerfile @@ -4,7 +4,7 @@ FROM rockylinux:9 #RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - # Install development tools -RUN yum -y module install nodejs:20 +RUN yum -y module install nodejs:20 COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] From 0de4641f0baa0ef3408def3263de389908971bc9 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 15:48:06 +0100 Subject: [PATCH 15/17] EL9 change --- packagingenv/Dockerfile.template | 4 ++++ packagingenv/rockylinux9/Dockerfile | 1 + 2 files changed, 5 insertions(+) diff --git a/packagingenv/Dockerfile.template b/packagingenv/Dockerfile.template index d8e7411..07945e7 100755 --- a/packagingenv/Dockerfile.template +++ b/packagingenv/Dockerfile.template @@ -4,6 +4,10 @@ FROM {{ dist }}:{{ version }} RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools +{%- if version in ('centos9', 'rockylinux9') %} +RUN yum -y install systemd-rpm-macros +{% endif %} + # Add NodeSource repo #RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - diff --git a/packagingenv/rockylinux9/Dockerfile b/packagingenv/rockylinux9/Dockerfile index 4b285e4..d99b4de 100644 --- a/packagingenv/rockylinux9/Dockerfile +++ b/packagingenv/rockylinux9/Dockerfile @@ -1,6 +1,7 @@ FROM rockylinux:9 RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools +RUN yum -y install systemd-rpm-macros # Add NodeSource repo #RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - From 09903142228ef668014c0d2ac2d0b22c4c83cee4 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 15:55:38 +0100 Subject: [PATCH 16/17] Tidy up --- packagingenv/Dockerfile.template | 3 --- packagingenv/rockylinux8/Dockerfile | 3 --- packagingenv/rockylinux9/Dockerfile | 4 +--- testingenv/Dockerfile.template | 3 --- testingenv/rockylinux8/Dockerfile | 3 --- testingenv/rockylinux9/Dockerfile | 3 --- 6 files changed, 1 insertion(+), 18 deletions(-) diff --git a/packagingenv/Dockerfile.template b/packagingenv/Dockerfile.template index 07945e7..7eeb212 100755 --- a/packagingenv/Dockerfile.template +++ b/packagingenv/Dockerfile.template @@ -8,9 +8,6 @@ RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools RUN yum -y install systemd-rpm-macros {% endif %} -# Add NodeSource repo -#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - - # Install node RUN yum -y module install nodejs:20 diff --git a/packagingenv/rockylinux8/Dockerfile b/packagingenv/rockylinux8/Dockerfile index b799c9e..b972227 100644 --- a/packagingenv/rockylinux8/Dockerfile +++ b/packagingenv/rockylinux8/Dockerfile @@ -2,9 +2,6 @@ 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_20.x | bash - - # Install node RUN yum -y module install nodejs:20 diff --git a/packagingenv/rockylinux9/Dockerfile b/packagingenv/rockylinux9/Dockerfile index d99b4de..499afb0 100644 --- a/packagingenv/rockylinux9/Dockerfile +++ b/packagingenv/rockylinux9/Dockerfile @@ -1,10 +1,8 @@ FROM rockylinux:9 RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools -RUN yum -y install systemd-rpm-macros -# Add NodeSource repo -#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - +RUN yum -y install systemd-rpm-macros # Install node RUN yum -y module install nodejs:20 diff --git a/testingenv/Dockerfile.template b/testingenv/Dockerfile.template index 4305f34..c21aaf3 100644 --- a/testingenv/Dockerfile.template +++ b/testingenv/Dockerfile.template @@ -2,9 +2,6 @@ FROM {{ dist }}:{{ version }} {% if dist in ('centos', 'fedora', 'rockylinux') -%} -# Add NodeSource repo -#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - - # Install development tools RUN yum -y module install nodejs:20 diff --git a/testingenv/rockylinux8/Dockerfile b/testingenv/rockylinux8/Dockerfile index e06b5db..a7a91ed 100755 --- a/testingenv/rockylinux8/Dockerfile +++ b/testingenv/rockylinux8/Dockerfile @@ -1,8 +1,5 @@ FROM rockylinux:8 -# Add NodeSource repo -#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - - # Install development tools RUN yum -y module install nodejs:20 diff --git a/testingenv/rockylinux9/Dockerfile b/testingenv/rockylinux9/Dockerfile index d08a7d0..8ca44a3 100755 --- a/testingenv/rockylinux9/Dockerfile +++ b/testingenv/rockylinux9/Dockerfile @@ -1,8 +1,5 @@ FROM rockylinux:9 -# Add NodeSource repo -#RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash - - # Install development tools RUN yum -y module install nodejs:20 From 9b101c848a1db038b5b5b44b6ecc3f98ebfcb524 Mon Sep 17 00:00:00 2001 From: amanda Date: Tue, 23 Apr 2024 16:12:08 +0100 Subject: [PATCH 17/17] Add changelog --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6e0c05e..e70d314 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,9 @@ Added * A changelog file. Contributed by @nzlosh +* EL9 support and node20 support + + Contributed by @amanda11 Fixed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~