Skip to content

Commit 7775559

Browse files
author
Gregory Schofield
committed
Refactor to not use expeditor.
Signed-off-by: Gregory Schofield <[email protected]>
1 parent b83f579 commit 7775559

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.buildkite/hooks/pre-command

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
if [[ $BUILDKITE_ORGANIZATION_SLUG != "chef-oss" ]]; then
6+
export VAULT_ADDR="https://vault.ps.chef.co"
7+
export VAULT_TOKEN=$(vault login -method=aws -path=aws/private-cd -token-only header_value=vault.ps.chef.co role=ci)
8+
export ARTIFACTORY_PASSWORD=$(vault kv get -field password account/static/artifactory/buildkite)
9+
fi
+14-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
---
22
steps:
33
- label: ":file_folder: upload software to internal sources"
4-
command: export PATH=/opt/omnibus-toolchain/bin/:$PATH && ./scripts/internal_sources.rb ./scripts/internal_sources.yml
5-
expeditor:
6-
executor:
7-
docker:
8-
image: chefes/omnibus-toolchain-ubuntu-2204-x86
9-
secrets:
10-
ARTIFACTORY_TOKEN:
11-
path: account/static/artifactory/buildkite
12-
field: token
13-
4+
agents:
5+
queue: default
6+
plugins:
7+
- docker#v3.5.0:
8+
image: chefes/omnibus-toolchain-ubuntu-2204-x86
9+
shell:
10+
- "/bin/bash"
11+
- "-e"
12+
- "-c"
13+
propagate-environment: true
14+
commands:
15+
- export PATH=/opt/omnibus-toolchain/bin/:/app/bin:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
16+
&& ./scripts/internal_sources.rb ./scripts/internal_sources.yml
17+
timeout_in_minutes: 20

scripts/internal_sources.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require "yaml"
66

77
ARTIFACTORY_REPO_URL = ENV["ARTIFACTORY_REPO_URL"] || "https://artifactory-internal.ps.chef.co/artifactory/omnibus-software-local"
8-
ARTIFACTORY_TOKEN = ENV["ARTIFACTORY_TOKEN"]
8+
ARTIFACTORY_PASSWORD = ENV["ARTIFACTORY_PASSWORD"]
99

1010
def print_usage
1111
puts "Must provide path to internal_sources.yml file."
@@ -48,7 +48,7 @@ def maybe_upload(name, source)
4848
downloaded_file = File.join(dir, file_name)
4949
repo_url = File.join(ARTIFACTORY_REPO_URL, name, file_name)
5050
puts "Uploading #{downloaded_file} to #{repo_url}"
51-
raise "Failed to upload" unless system("curl -s -H 'X-JFrog-Art-Api:#{ARTIFACTORY_TOKEN}' -T '#{downloaded_file}' #{repo_url}")
51+
raise "Failed to upload" unless system("curl -s -H 'X-JFrog-Art-Api:#{ARTIFACTORY_PASSWORD}' -T '#{downloaded_file}' #{repo_url}")
5252

5353
puts ""
5454
end

0 commit comments

Comments
 (0)