当存在共享组件目录时,如何基于路径条件化Concourse git-resource触发器?

时间:2017-06-28 21:11:05

标签: git concourse

我的git repo有3个顶级目录:

-\ |- ComponentA |- ComponentB |- SharedLib

我可以使用具有不同路径的单独git-resources来触发组件A,组件B和共享库的构建。但SharedLib是ComponentA和ComponentB的构建依赖项,有时会在ComponentA和SharedLib中提交包含文件。

我想要的是确保跨ComponentA和sharedlib(也许还有ComponentB)的提交首先构建SharedLib,然后构建组件。

在Concourse中构建管道的最佳方法是什么? (我知道我可以把shareLib拉成一个单独的仓库,但是有理由这会很尴尬。)

我考虑过将git-resource扩展为具有“unless_path”属性。但是考虑一下管道如何处理不同的可能提交序列以及提交重叠管道运行会让我头疼。

1 个答案:

答案 0 :(得分:0)

在我看来,您的一般愿望就是使用此单一仓库并使用它来构建三个模块,package com.example.amitjoshi.am6; import android.graphics.Color; import android.support.v4.view.GestureDetectorCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import android.widget.Button; import android.widget.RelativeLayout; import android.view.MotionEvent; import android.view.GestureDetector; public class MainActivity extends AppCompatActivity implements GestureDetector.OnGestureListener{ private TextView message; private Button button; private GestureDetectorCompat gestureDetector; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); RelativeLayout layout = (RelativeLayout)findViewById(R.id.layout); layout.setBackgroundColor(Color.RED); RelativeLayout.LayoutParams buttonDetails = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT ); buttonDetails.addRule(RelativeLayout.CENTER_HORIZONTAL); buttonDetails.addRule(RelativeLayout.CENTER_VERTICAL); message = (TextView)findViewById(R.id.message); button = (Button)findViewById(R.id.button); this.gestureDetector = new GestureDetectorCompat(this, this); button.setOnClickListener(new ButtonListener()); //gestureDetector.setOnDoubleTapListener(this); } private class ButtonListener implements View.OnClickListener{ @Override public void onClick(View view) { MainActivity.this.message.setText("Clicked"); } } @Override public boolean onDown(MotionEvent motionEvent) { //message.setText("onDown"); return false; } @Override public void onShowPress(MotionEvent motionEvent) { //message.setText("onShowPress"); } @Override public boolean onSingleTapUp(MotionEvent motionEvent) { message.setText("onSingleTapUp"); return true; } @Override public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent1, float v, float v1) { message.setText("Swiped"); return true; } @Override public void onLongPress(MotionEvent motionEvent) { //message.setText("onLogPress"); } @Override public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent1, float v, float v1) { message.setText("Swiped"); return true; } @Override public boolean onTouchEvent(MotionEvent event) { this.gestureDetector.onTouchEvent(event); return super.onTouchEvent(event); } } 和/或SharedLib之前构建ComponentA。< / p>

在这种情况下,我会将其模型化为:

ComponentB