Skip to content

Commit

Permalink
Add run template script
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
  • Loading branch information
adam-stokes committed Oct 6, 2020
1 parent a143f02 commit 58d07ef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion jobs/build-debs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
venv/bin/pip-sync requirements.txt
bin/lxd-launcher build \
--container-name deb-build \
--playbook jobs/infra/debuilder-playbook.yml
--playbook jobs/build-debs/debuilder-playbook.yml
lxc exec deb-build -- "cd jenkins && bash run.sh"
bin/lxd-launcher teardown --container-name deb-build
- job:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
ubuntu-dev-tools \
wget \
python3-dev \
python3-pip
python3-pip \
tox
- name: copy bashrc
copy:
src: "fixtures/bashrc"
Expand Down Expand Up @@ -62,12 +63,9 @@
- name: clone jenkins repo
shell: |
git clone https://github.com/charmed-kubernetes/jenkins
- name: run build
shell: |
export CDKBOT_GH_USR="{{ lookup('env', 'CDKBOT_GH_USER') }}"
export CDKBOT_GH_PSW="{{ lookup('env', 'CDKBOT_GH_PSW') }}"
pip3 install -rrequirements.txt
python3 jobs/build-debs/build-debs.py build-debs \
--version "{{ lookup('env', 'K8S_VERSION') }}"
args:
chdir: /root/jenkins
- name: copy run script
template:
src: "run.sh.j2"
dest: "/root/jenkins/run.sh"
owner: root
mode: 775
7 changes: 7 additions & 0 deletions jobs/build-debs/run.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

export CDKBOT_GH_USR="{{ lookup('env', 'CDKBOT_GH_USER') }}"
export CDKBOT_GH_PSW="{{ lookup('env', 'CDKBOT_GH_PSW') }}"
K8S_VERSION="{{ lookup('env', 'K8S_VERSION') }}"
TOX_WORK_DIR=.tox tox -e py3 -- python jobs/build-debs/build-debs.py build-debs \
--version "$K8S_VERSION"

0 comments on commit 58d07ef

Please sign in to comment.