Skip to content

Commit

Permalink
images: add workaround for smee-client issue 156 (#949)
Browse files Browse the repository at this point in the history
Add workaround for [1] by building smee-client from a fork with the fix
[2].

[1] probot/smee-client#156
[2] probot/smee-client#162
  • Loading branch information
winklerm committed Mar 25, 2021
1 parent 49ba517 commit d89ebe5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
8 changes: 8 additions & 0 deletions jenkins-slaves/ansible/data/service/smee-client-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# workaround for building the fix from https://github.com/probot/smee-client/pull/162
# to be removed after the PR ^ is merged and a new smee-client released!!

git clone -b drop-host-header https://github.com/kahowell/smee-client
cd smee-client
npm install
npm run build
4 changes: 3 additions & 1 deletion jenkins-slaves/ansible/data/service/smee.service.sh.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
export NODE_EXTRA_CA_CERTS=/etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt
smee -u {{ lookup('env','WEBHOOK_URL') }} -t {{ lookup('env','TARGET_URL') }}
# TODO revert after https://github.com/probot/smee-client/pull/162 is merged and smee-client released!!
# smee -u {{ lookup('env','WEBHOOK_URL') }} -t {{ lookup('env','TARGET_URL') }}
/root/smee-client/bin/smee.js -u {{ lookup('env','WEBHOOK_URL') }} -t {{ lookup('env','TARGET_URL') }}
39 changes: 31 additions & 8 deletions jenkins-slaves/ansible/roles/smee/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,37 @@
- debug: msg="WEBHOOK_URL \"{{ lookup('env','WEBHOOK_URL') }}\""
- debug: msg="TARGET_URL \"{{ lookup('env','TARGET_URL') }}\""

- name: Install Smee Client
npm:
name: smee-client
version: 1.1.0
global: yes
production: yes
state: present
registry: ${NPM_REGISTRY_URL}
- name: Copy Pulp repos config - RHEL 7
copy:
src: data/config/pulp/pulp-rhel7.repo
dest: /etc/yum.repos.d/pulp.repo
owner: root
group: root
mode: 0644

- name: Install packages - git
yum:
pkg: 'git'
state: latest

# TODO revert after https://github.com/probot/smee-client/pull/162 is merged and smee-client released!!
#- name: Install Smee Client
# npm:
# name: smee-client
# version: 1.1.0
# global: yes
# production: yes
# state: present
# registry: ${NPM_REGISTRY_URL}

- name: Transfer the script
copy:
src: data/service/smee-client-build.sh
dest: /root/
mode: 0777

- name: Build Smee Client from fork
command: bash /root/smee-client-build.sh

- name: Generate smee.service.sh file
template:
Expand Down

0 comments on commit d89ebe5

Please sign in to comment.