Skip to content

Commit 52f02da

Browse files
committed
ci: Move global credentials to web configuration
This commit moves a number of our encrypted credentials stored in configuration files in this repository to env vars on the web UI. This will hopefully make it easier to rotate credentials in the future as well as quickly change them if the need arises. (quicker than landing a PR that is). This also updates the travis deployment process to always use the `aws` command line tool which we're already installing on Linux and should enable us to avoid all `dpl` gem issues as well as have greater control over what's going where.
1 parent f99911a commit 52f02da

File tree

2 files changed

+48
-105
lines changed

2 files changed

+48
-105
lines changed

.travis.yml

+44-90
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ git:
1212
depth: 2
1313
submodules: false
1414

15+
DEPLOY: &DEPLOY
16+
- mkdir -p deploy/$TRAVIS_COMMIT
17+
- >
18+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
19+
rm -rf build/dist/doc &&
20+
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
21+
else
22+
rm -rf obj/build/dist/doc &&
23+
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
24+
fi
25+
- ls -la deploy/$TRAVIS_COMMIT
26+
- deploy_dir=rustc-builds
27+
- if [ "$DEPLOY_ALT" == "1" ]; then deploy_dir=rustc-builds-alt; fi
28+
- travis_retry aws s3 cp --recursive --acl public-read ./deploy s3://rust-lang-ci2/$deploy_dir
29+
1530
matrix:
1631
fast_finish: true
1732
include:
@@ -21,12 +36,14 @@ matrix:
2136

2237
- env: IMAGE=dist-x86_64-linux DEPLOY=1
2338
if: branch = try OR branch = auto
39+
after_success: *DEPLOY
2440

2541
# "alternate" deployments, these are "nightlies" but have LLVM assertions
2642
# turned on, they're deployed to a different location primarily for
2743
# additional testing.
2844
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1 CI_JOB_NAME=dist-x86_64-linux-alt
2945
if: branch = try OR branch = auto
46+
after_success: *DEPLOY
3047

3148
- env: >
3249
RUST_CHECK_TARGET=dist
@@ -41,6 +58,7 @@ matrix:
4158
os: osx
4259
osx_image: xcode9.3-moar
4360
if: branch = auto
61+
after_success: *DEPLOY
4462
4563
# macOS builders. These are placed near the beginning because they are very
4664
# slow to run.
@@ -99,6 +117,7 @@ matrix:
99117
os: osx
100118
osx_image: xcode9.3-moar
101119
if: branch = auto
120+
after_success: *DEPLOY
102121
103122
- env: >
104123
RUST_CHECK_TARGET=dist
@@ -114,6 +133,7 @@ matrix:
114133
os: osx
115134
osx_image: xcode9.3-moar
116135
if: branch = auto
136+
after_success: *DEPLOY
117137
118138
# Linux builders, remaining docker images
119139
- env: IMAGE=arm-android
@@ -122,46 +142,67 @@ matrix:
122142
if: branch = auto
123143
- env: IMAGE=dist-various-1 DEPLOY=1
124144
if: branch = auto
145+
after_success: *DEPLOY
125146
- env: IMAGE=dist-various-2 DEPLOY=1
126147
if: branch = auto
148+
after_success: *DEPLOY
127149
- env: IMAGE=dist-aarch64-linux DEPLOY=1
128150
if: branch = auto
151+
after_success: *DEPLOY
129152
- env: IMAGE=dist-android DEPLOY=1
130153
if: branch = auto
154+
after_success: *DEPLOY
131155
- env: IMAGE=dist-arm-linux DEPLOY=1
132156
if: branch = auto
157+
after_success: *DEPLOY
133158
- env: IMAGE=dist-armhf-linux DEPLOY=1
134159
if: branch = auto
160+
after_success: *DEPLOY
135161
- env: IMAGE=dist-armv7-linux DEPLOY=1
136162
if: branch = auto
163+
after_success: *DEPLOY
137164
- env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
138165
if: branch = auto
166+
after_success: *DEPLOY
139167
- env: IMAGE=dist-i686-freebsd DEPLOY=1
140168
if: branch = auto
169+
after_success: *DEPLOY
141170
- env: IMAGE=dist-i686-linux DEPLOY=1
142171
if: branch = auto
172+
after_success: *DEPLOY
143173
- env: IMAGE=dist-mips-linux DEPLOY=1
144174
if: branch = auto
175+
after_success: *DEPLOY
145176
- env: IMAGE=dist-mips64-linux DEPLOY=1
146177
if: branch = auto
178+
after_success: *DEPLOY
147179
- env: IMAGE=dist-mips64el-linux DEPLOY=1
148180
if: branch = auto
181+
after_success: *DEPLOY
149182
- env: IMAGE=dist-mipsel-linux DEPLOY=1
150183
if: branch = auto
184+
after_success: *DEPLOY
151185
- env: IMAGE=dist-powerpc-linux DEPLOY=1
152186
if: branch = auto
187+
after_success: *DEPLOY
153188
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
154189
if: branch = auto
190+
after_success: *DEPLOY
155191
- env: IMAGE=dist-powerpc64le-linux DEPLOY=1
156192
if: branch = auto
193+
after_success: *DEPLOY
157194
- env: IMAGE=dist-s390x-linux DEPLOY=1
158195
if: branch = auto
196+
after_success: *DEPLOY
159197
- env: IMAGE=dist-x86_64-freebsd DEPLOY=1
160198
if: branch = auto
199+
after_success: *DEPLOY
161200
- env: IMAGE=dist-x86_64-musl DEPLOY=1
162201
if: branch = auto
202+
after_success: *DEPLOY
163203
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
164204
if: branch = auto
205+
after_success: *DEPLOY
165206
- env: IMAGE=asmjs
166207
if: branch = auto
167208
- env: IMAGE=i686-gnu
@@ -197,23 +238,10 @@ matrix:
197238
. src/ci/docker/x86_64-gnu-tools/repo.sh;
198239
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN";
199240

200-
env:
201-
global:
202-
- SCCACHE_BUCKET=rust-lang-ci-sccache2
203-
- SCCACHE_REGION=us-west-1
204-
- AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
205-
# AWS_SECRET_ACCESS_KEY=...
206-
- secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
207-
# TOOLSTATE_REPO_ACCESS_TOKEN=...
208-
- secure: "ESfcXqv4N2VMhqi2iIyw6da9VrsA78I4iR1asouCaq4hzTTrkB4WNRrfURy6xg72gQ4nMhtRJbB0/2jmc9Cu1+g2CzXtyiL223aJ5CKrXdcvbitopQSDfp07dMWm+UED+hNFEanpErKAeU/6FM3A+J+60PMk8MCF1h9tqNRISJw="
209-
210241
before_install:
211-
# We'll use the AWS cli to download/upload cached docker layers, so install
212-
# that here.
213-
- if [ "$TRAVIS_OS_NAME" = linux ]; then
214-
pip install --user awscli;
215-
export PATH=$PATH:$HOME/.local/bin;
216-
fi
242+
# We'll use the AWS cli to download/upload cached docker layers as well as
243+
# push our deployments, so download that here.
244+
- pip install --user awscli; export PATH=$PATH:$HOME/.local/bin
217245
- mkdir -p $HOME/rustsrc
218246
# FIXME(#46924): these two commands are required to enable IPv6,
219247
# they shouldn't exist, please revert once more official solutions appeared.
@@ -322,77 +350,3 @@ after_failure:
322350

323351
notifications:
324352
email: false
325-
326-
before_deploy:
327-
- mkdir -p deploy/$TRAVIS_COMMIT
328-
- >
329-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
330-
rm -rf build/dist/doc &&
331-
cp -r build/dist/* deploy/$TRAVIS_COMMIT;
332-
else
333-
rm -rf obj/build/dist/doc &&
334-
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
335-
fi
336-
- ls -la deploy/$TRAVIS_COMMIT
337-
338-
deploy:
339-
- provider: s3
340-
bucket: rust-lang-ci2
341-
skip_cleanup: true
342-
local_dir: deploy
343-
upload_dir: rustc-builds
344-
acl: public_read
345-
region: us-west-1
346-
access_key_id: AKIAJVBODR3IA4O72THQ
347-
secret_access_key:
348-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
349-
on:
350-
branch: auto
351-
condition: $DEPLOY = 1
352-
353-
# this is the same as the above deployment provider except that it uploads to
354-
# a slightly different directory and has a different trigger
355-
- provider: s3
356-
bucket: rust-lang-ci2
357-
skip_cleanup: true
358-
local_dir: deploy
359-
upload_dir: rustc-builds-alt
360-
acl: public_read
361-
region: us-west-1
362-
access_key_id: AKIAJVBODR3IA4O72THQ
363-
secret_access_key:
364-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
365-
on:
366-
branch: auto
367-
condition: $DEPLOY_ALT = 1
368-
369-
# These two providers are the same as the two above, except deploy on the
370-
# try branch. Travis does not appear to provide a way to use "or" in these
371-
# conditions.
372-
- provider: s3
373-
bucket: rust-lang-ci2
374-
skip_cleanup: true
375-
local_dir: deploy
376-
upload_dir: rustc-builds
377-
acl: public_read
378-
region: us-west-1
379-
access_key_id: AKIAJVBODR3IA4O72THQ
380-
secret_access_key:
381-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
382-
on:
383-
branch: try
384-
condition: $DEPLOY = 1
385-
386-
- provider: s3
387-
bucket: rust-lang-ci2
388-
skip_cleanup: true
389-
local_dir: deploy
390-
upload_dir: rustc-builds-alt
391-
acl: public_read
392-
region: us-west-1
393-
access_key_id: AKIAJVBODR3IA4O72THQ
394-
secret_access_key:
395-
secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
396-
on:
397-
branch: try
398-
condition: $DEPLOY_ALT = 1

appveyor.yml

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
environment:
2-
SCCACHE_BUCKET: rust-lang-ci-sccache2
3-
SCCACHE_REGION: us-west-1
4-
AWS_ACCESS_KEY_ID: AKIAJAMV3QAMMA6AXHFQ
5-
AWS_SECRET_ACCESS_KEY:
6-
secure: 7Y+JiquYedOAgnUU26uL0DPzrxmTtR+qIwG6rNKSuWDffqU3vVZxbGXim9QpTO80
72
SCCACHE_DIGEST: f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c
8-
TOOLSTATE_REPO_ACCESS_TOKEN:
9-
secure: gKGlVktr7iuqCoYSxHxDE9ltLOKU0nYDEuQxvWbNxUIW7ri5ppn8L06jQzN0GGzN
103

114
# By default schannel checks revocation of certificates unlike some other SSL
125
# backends, but we've historically had problems on CI where a revocation
@@ -235,10 +228,8 @@ before_deploy:
235228
236229
deploy:
237230
- provider: S3
238-
skip_cleanup: true
239-
access_key_id: AKIAJVBODR3IA4O72THQ
240-
secret_access_key:
241-
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
231+
access_key_id: $(AWS_ACCESS_KEY_ID)
232+
secret_access_key: $(AWS_SECRET_ACCESS_KEY)
242233
bucket: rust-lang-ci2
243234
set_public: true
244235
region: us-west-1
@@ -252,10 +243,8 @@ deploy:
252243
# This provider is the same as the one above except that it has a slightly
253244
# different upload directory and a slightly different trigger
254245
- provider: S3
255-
skip_cleanup: true
256-
access_key_id: AKIAJVBODR3IA4O72THQ
257-
secret_access_key:
258-
secure: tQWIE+DJHjXaV4np/3YeETkEmXngtIuIgAO/LYKQaUshGLgN8cBCFGG3cHx5lKLt
246+
access_key_id: $(AWS_ACCESS_KEY_ID)
247+
secret_access_key: $(AWS_SECRET_ACCESS_KEY)
259248
bucket: rust-lang-ci2
260249
set_public: true
261250
region: us-west-1

0 commit comments

Comments
 (0)