Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instruct engine to download files to a temporary path #206

Merged
merged 3 commits into from
Jan 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ codex.tags
_Dangerfile.tmp
hscope.out
TAGS

# Tests and dev stuff
Carthage/
Cartfile
Cartfile.resolved
Romefile
engine.sh
rome-local-cache/
server-cache/
travis/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- travis_wait 60 bats integration-tests/static-frameworks-engine-yml.bats

env:
- ARGS="--resolver=lts-13.10"
- ARGS="--resolver=lts-14.14"

cache:
directories:
Expand Down
5 changes: 4 additions & 1 deletion Rome.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Rome
version: 0.23.1.61
version: 0.23.2.62
synopsis: A cache for Carthage
description: Please see README.md
homepage: https://github.com/blender/Rome
Expand Down Expand Up @@ -74,6 +74,7 @@ library
, extra >= 1.5.3
, yaml >= 0.9.0
, safe >= 0.3.17
, uuid >= 1.3.13

ghc-options: -Wall -fno-warn-unused-do-bind

Expand All @@ -89,6 +90,8 @@ executable rome
, Rome
, mtl >= 2.2.1
, optparse-applicative >= 0.12
, uuid >= 1.3.13




Expand Down
2 changes: 1 addition & 1 deletion Rome.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Rome'
s.version = '0.23.1.61'
s.version = '0.23.2.62'
s.summary = 'A cache tool for Carthage'
s.homepage = 'https://github.com/blender/Rome'
s.source = { :http => "#{s.homepage}/releases/download/v#{s.version}/rome.zip" }
Expand Down
26 changes: 11 additions & 15 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
module Main where

import CommandParsers (parseRomeOptions)
import CommandParsers ( parseRomeOptions )
import Control.Monad.Except
import Data.Monoid ((<>))
import Control.Monad.Reader ( runReaderT )
import Data.Monoid ( (<>) )
import Data.UUID.V4 as UUID
( nextRandom )
import Lib
import Options.Applicative as Opts
import Options.Applicative as Opts
import System.Exit



romeVersion :: RomeVersion
romeVersion = (0, 23, 1, 61)
romeVersion = (0, 23, 2, 62)



Expand All @@ -19,24 +22,17 @@ main :: IO ()
main = do
let opts = info
( Opts.helper
<*> Opts.flag'
Nothing
( Opts.long "version"
<> Opts.help "Prints the version information"
<> Opts.hidden
)
<*> Opts.flag' Nothing (Opts.long "version" <> Opts.help "Prints the version information" <> Opts.hidden)
<|> Just
<$> parseRomeOptions
)
(header "Cache tool for Carthage")
cmd <- execParser opts
case cmd of
Nothing ->
putStrLn
$ romeVersionToString romeVersion
++ " - Romam uno die non fuisse conditam."
Nothing -> putStrLn $ romeVersionToString romeVersion ++ " - Romam uno die non fuisse conditam."
Just romeOptions -> do
p <- runExceptT $ runRomeWithOptions romeOptions romeVersion
globalUUID <- UUID.nextRandom
p <- runReaderT (runExceptT (runRomeWithOptions romeOptions romeVersion)) globalUUID
case p of
Right _ -> return ()
Left e -> die e
2 changes: 2 additions & 0 deletions brittany.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conf_layout:
lconfig_cols: 120
2 changes: 1 addition & 1 deletion integration-tests/current-framework-named-yml.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ currentMap:
EOF

mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/current-framework-yml.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ currentMap:
EOF

mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/dynamic-frameworks-engine-yml.bats
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ teardown() {

rm -rf Carthage/Build
run rome download --concurrently --skip-local-cache --cache-prefix travis

[ "$status" -eq 0 ]

# Version file
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/dynamic-frameworks-ini.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ setup() {
cp ../_Cartfile.resolved_bkp Cartfile.resolved
fi

printf "[Cache]\n S3-Bucket = rome\n local = rome-local-cache" >> Romefile
printf "[Cache]\n S3-Bucket = rome\n local = rome-local-cache" > Romefile
mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down
6 changes: 4 additions & 2 deletions integration-tests/dynamic-frameworks-yml.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ignoreMap:
platforms: [Mac]
EOF
mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down Expand Up @@ -238,7 +238,9 @@ teardown() {
}

@test "rome downloads all artifacts from the local cache (dynamic, yml)" {


skip

if [ -d "../_rome-local-cache_bkp" ]; then
echo "# Rome local cache restored" >&3
cp -R ../_rome-local-cache_bkp/ rome-local-cache
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ STORAGE_DIR="server-cache"
if [ "$ACTION" == "upload" ]; then
LOCAL_PATH="$2"
REMOTE_PATH="$3"
echo "🚂 Engine invocation: upload $LOCAL_PATH to $REMOTE_PATH"
# create directory structure if it doesn't exist yet
mkdir -p $STORAGE_DIR/$(dirname $REMOTE_PATH)
# fake the upload of a file by just copying binary to the storage directory
Expand All @@ -17,6 +18,7 @@ if [ "$ACTION" == "upload" ]; then
elif [ "$ACTION" == "download" ]; then
REMOTE_PATH="$2"
OUTPUT_PATH="$3"
echo "🚂 Engine invocation: download $REMOTE_PATH to $OUTPUT_PATH"
# create directory structure if it doesn't exist yet
mkdir -p $(dirname $OUTPUT_PATH)
# fake download by just copying binary from the storage directory
Expand All @@ -27,7 +29,7 @@ elif [ "$ACTION" == "download" ]; then

elif [ "$ACTION" == "list" ]; then
REMOTE_PATH="$2"

echo "🚂 Engine invocation: list $REMOTE_PATH"
# verify that the list command contains the cache prefix
if [[ ! "$REMOTE_PATH" =~ "travis" ]]; then
exit 1
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/static-frameworks-ini.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ setup() {
cp ../_Cartfile.resolved_bkp Cartfile.resolved
fi

printf "[Cache]\n S3-Bucket = rome\n local = rome-local-cache\n[RepositoryMap]\n Staticfire = static/Alamofire" >> Romefile
printf "[Cache]\n S3-Bucket = rome\n local = rome-local-cache\n[RepositoryMap]\n Staticfire = static/Alamofire" > Romefile
mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/static-frameworks-yml.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ignoreMap:
platforms: [iOS,Mac,tvOS,watchOS]
EOF
mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config
printf "[default]\n region = us-east-1" > ~/.aws/config

# minio

Expand Down
Loading