File tree 3 files changed +25
-12
lines changed
3 files changed +25
-12
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
1
---
2
2
steps :
3
3
- 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
Original file line number Diff line number Diff line change 5
5
require "yaml"
6
6
7
7
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 " ]
9
9
10
10
def print_usage
11
11
puts "Must provide path to internal_sources.yml file."
@@ -48,7 +48,7 @@ def maybe_upload(name, source)
48
48
downloaded_file = File . join ( dir , file_name )
49
49
repo_url = File . join ( ARTIFACTORY_REPO_URL , name , file_name )
50
50
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 } " )
52
52
53
53
puts ""
54
54
end
You can’t perform that action at this time.
0 commit comments