From f40a9f08a4cc4a7af955e1584a7ea3ae0db712f4 Mon Sep 17 00:00:00 2001 From: JP Bourget Date: Thu, 16 Jan 2020 17:04:11 -0500 Subject: [PATCH 1/5] update perms in makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 78feb36..6316ca6 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ endif all: build build: + chown -R root:root /root/st2chatops/ npm install --production npm cache verify && npm cache clean --force From 00563d544205e57075926a2025eb94b72b7a0108 Mon Sep 17 00:00:00 2001 From: JP Bourget Date: Thu, 16 Jan 2020 23:25:47 -0500 Subject: [PATCH 2/5] switch dpkg/rpm to apt-get and yum --- testingenv/bionic/docker-entrypoint.sh | 2 +- testingenv/centos6/docker-entrypoint.sh | 2 +- testingenv/centos7/docker-entrypoint.sh | 2 +- testingenv/trusty/docker-entrypoint.sh | 2 +- testingenv/xenial/docker-entrypoint.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testingenv/bionic/docker-entrypoint.sh b/testingenv/bionic/docker-entrypoint.sh index 98f9b30..484b92e 100755 --- a/testingenv/bionic/docker-entrypoint.sh +++ b/testingenv/bionic/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - dpkg -i $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/centos6/docker-entrypoint.sh b/testingenv/centos6/docker-entrypoint.sh index 628f093..38e2ba6 100755 --- a/testingenv/centos6/docker-entrypoint.sh +++ b/testingenv/centos6/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - rpm -i $ARTIFACT_DIR/*.rpm + 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 diff --git a/testingenv/centos7/docker-entrypoint.sh b/testingenv/centos7/docker-entrypoint.sh index 628f093..38e2ba6 100755 --- a/testingenv/centos7/docker-entrypoint.sh +++ b/testingenv/centos7/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - rpm -i $ARTIFACT_DIR/*.rpm + 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 diff --git a/testingenv/trusty/docker-entrypoint.sh b/testingenv/trusty/docker-entrypoint.sh index 98f9b30..484b92e 100755 --- a/testingenv/trusty/docker-entrypoint.sh +++ b/testingenv/trusty/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - dpkg -i $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/xenial/docker-entrypoint.sh b/testingenv/xenial/docker-entrypoint.sh index 98f9b30..484b92e 100755 --- a/testingenv/xenial/docker-entrypoint.sh +++ b/testingenv/xenial/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - dpkg -i $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 From bb117c66da5e46ed91700f7a3a1f5474027288ac Mon Sep 17 00:00:00 2001 From: JP Bourget Date: Thu, 16 Jan 2020 23:35:35 -0500 Subject: [PATCH 3/5] try sudo for apt-get --- testingenv/bionic/docker-entrypoint.sh | 2 +- testingenv/trusty/docker-entrypoint.sh | 2 +- testingenv/xenial/docker-entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testingenv/bionic/docker-entrypoint.sh b/testingenv/bionic/docker-entrypoint.sh index 484b92e..24570b9 100755 --- a/testingenv/bionic/docker-entrypoint.sh +++ b/testingenv/bionic/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - apt-get install -y $ARTIFACT_DIR/*.deb + sudo apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/trusty/docker-entrypoint.sh b/testingenv/trusty/docker-entrypoint.sh index 484b92e..24570b9 100755 --- a/testingenv/trusty/docker-entrypoint.sh +++ b/testingenv/trusty/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - apt-get install -y $ARTIFACT_DIR/*.deb + sudo apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/xenial/docker-entrypoint.sh b/testingenv/xenial/docker-entrypoint.sh index 484b92e..24570b9 100755 --- a/testingenv/xenial/docker-entrypoint.sh +++ b/testingenv/xenial/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - apt-get install -y $ARTIFACT_DIR/*.deb + sudo apt-get install -y $ARTIFACT_DIR/*.deb 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 From 03c27f7e783da0f1a458ef61f427fdcfa47cdab5 Mon Sep 17 00:00:00 2001 From: JP Bourget Date: Thu, 16 Jan 2020 23:44:55 -0500 Subject: [PATCH 4/5] remove sudo apt-get --- testingenv/bionic/docker-entrypoint.sh | 2 +- testingenv/trusty/docker-entrypoint.sh | 2 +- testingenv/xenial/docker-entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testingenv/bionic/docker-entrypoint.sh b/testingenv/bionic/docker-entrypoint.sh index 24570b9..484b92e 100755 --- a/testingenv/bionic/docker-entrypoint.sh +++ b/testingenv/bionic/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - sudo apt-get install -y $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/trusty/docker-entrypoint.sh b/testingenv/trusty/docker-entrypoint.sh index 24570b9..484b92e 100755 --- a/testingenv/trusty/docker-entrypoint.sh +++ b/testingenv/trusty/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - sudo apt-get install -y $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 diff --git a/testingenv/xenial/docker-entrypoint.sh b/testingenv/xenial/docker-entrypoint.sh index 24570b9..484b92e 100755 --- a/testingenv/xenial/docker-entrypoint.sh +++ b/testingenv/xenial/docker-entrypoint.sh @@ -6,7 +6,7 @@ case "$operation" in pull) ;; test) - sudo apt-get install -y $ARTIFACT_DIR/*.deb + apt-get install -y $ARTIFACT_DIR/*.deb 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 From df834b14dca6ff5ac158a195038cbde14bbc96d8 Mon Sep 17 00:00:00 2001 From: Eugen C Date: Fri, 17 Jan 2020 11:13:12 +0000 Subject: [PATCH 5/5] Include code comment about npm permissions workaround --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 6316ca6..f39fefe 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ endif all: build build: + # Permissions workaround for global `npm install` chown -R root:root /root/st2chatops/ npm install --production npm cache verify && npm cache clean --force