Skip to content

Commit

Permalink
Add PyPI API keys to Jenkins (tlc-pack#85)
Browse files Browse the repository at this point in the history
Credentials have been added for PyPI uploading, which will persist on
redeployment of the Jenkins instance.
  • Loading branch information
Liam-Sturge committed May 31, 2023
1 parent 6ea32bc commit 2a3a860
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions jenkins/ansible/roles/setup_jenkins_head/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@
group: 1000
mode: 0600

- name: PyPI API key
ansible.builtin.copy:
content: "{{ lookup('env', 'PYPI_TOKEN') }}"
dest: "/var/jenkins/keys/pypi-api-token"
owner: 1000
group: 1000
mode: 0600

- name: test PyPI API key
ansible.builtin.copy:
content: "{{ lookup('env', 'TEST_PYPI_TOKEN') }}"
dest: "/var/jenkins/keys/test-pypi-api-token"
owner: 1000
group: 1000
mode: 0600

- name: Base configuration for Jenkins
ansible.builtin.copy:
src: "{{ lookup('env', 'GITHUB_WORKSPACE') + '/jenkins/docker/' + lookup('env', 'ENVIRONMENT') + '/base_config.yaml' }}"
Expand Down
8 changes: 8 additions & 0 deletions jenkins/docker/prod/base_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,11 @@ credentials:
owner: "octoml"
description: "GitHub App for octoml/relax repos"
privateKey: "${readFile:/key/octoml_relax_ci_github_app_key}"
- string:
id: "pypi-api-token"
description: "key for pushing TLCPack to PyPI"
secret: "${readFile:/key/pypi-api-token}"
- string:
id: "test-pypi-api-token"
description: "key for pushing TLCPack to test PyPI"
secret: "${readFile:/key/test-pypi-api-token}"

0 comments on commit 2a3a860

Please sign in to comment.