Skip to content

Commit

Permalink
Add private key
Browse files Browse the repository at this point in the history
  • Loading branch information
hakusaro committed Oct 15, 2016
1 parent cf69fc6 commit c4788fe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: csharp
solution: ./TShockAPI/TShockAPI.csproj
solution: "./TShockAPI/TShockAPI.csproj"
install:
- nuget restore
- nuget restore
script: python ./scripts/create_release.py
notifications:
slack:
secure: O4Nibe2fdaUa2ZxuETUg6WEoQKvNM2CotnfaIVgm3fjfe61dfE1P+EgTpbwDG8646jSmpTqMDw8Z6I/WJwGTlXV/ZQsbwu63Cps4MgOTvPHZ0Lsye5azySlJZs1iI4ItYSj2czXfcnJ+qAl1SOOkXJrjB5uyTMWtDpCrSCFB3MA=
before_install:
- openssl aes-256-cbc -K $encrypted_1d7cd15ffdb4_key -iv $encrypted_1d7cd15ffdb4_iv
-in ssh_private_key.enc -out ssh_private_key -d
21 changes: 19 additions & 2 deletions scripts/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,30 @@ def package_debug():
def delete_files():
os.chdir(release_dir)
os.remove(mysql_bin_name)
os.remove(sqlite_bin_name)
os.remove(sqlite_dep)
# os.remove(sqlite_bin_name)
# os.remove(sqlite_dep)
os.remove(json_bin_name)
os.remove(bcrypt_bin_name)
os.remove(http_bin_name)
os.remove(geoip_db_name)
os.chdir(cur_wd)

def upload_artifacts():
if os.environ.get('TRAVIS_PULL_REQUEST', 'false') == 'false':
os.chdir(cur_wd)
os.mkdir(os.environ.get('TRAVIS_BRANCH', 'test-branch'))
os.chdir(os.environ.get('TRAVIS_BRANCH', 'test-branch'))
os.mkdir(os.environ.get('TRAVIS_BUILD_NUMBER', 'test-0407'))
os.chdir(cur_wd)
shutil.copy(os.path.join(release_dir, 'tshock_release.zip'), os.path.join(os.environ.get('TRAVIS_BRANCH', 'test-branch'), os.environ.get('TRAVIS_BUILD_NUMBER', 'test-0407')))
shutil.copy(os.path.join(release_dir, 'tshock_debug.zip'), os.path.join(os.environ.get('TRAVIS_BRANCH', 'test-branch'), os.environ.get('TRAVIS_BUILD_NUMBER', 'test-0407')))
target = open('./id_rsa', 'w')
target.write(os.environ.get('SECRET_SSH_KEY', 'nokey'))
target.close()
os.chmod('./id_rsa', 0600)
upload_process = subprocess.Popen(['scp', '-i', './id_rsa', '-r', os.environ.get('TRAVIS_BRANCH', 'test-branch'), 'tshock-travis@arc.shanked.me:/usr/share/nginx/tshock-travis/'])
upload_process.wait()

def update_terraria_source():
subprocess.check_call(['/usr/bin/git', 'submodule', 'init'])
subprocess.check_call(['/usr/bin/git', 'submodule', 'update'])
Expand All @@ -122,3 +138,4 @@ def build_software():
package_release()
package_debug()
delete_files()
upload_artifacts()
Binary file added scripts/ssh_private_key.enc
Binary file not shown.

0 comments on commit c4788fe

Please sign in to comment.