|
|
@@ -64,117 +64,126 @@ const NewAppFlow: React.FC<Props> = ({
|
|
|
const [formState, setFormState] = useState<FormState>(INITIAL_STATE);
|
|
|
|
|
|
return (
|
|
|
- <StyledConfigureTemplate>
|
|
|
- <Back to="/apps" />
|
|
|
- <DashboardHeader
|
|
|
- prefix={
|
|
|
- <Icon
|
|
|
- src={web}
|
|
|
- />
|
|
|
- }
|
|
|
- title="Deploy a new application"
|
|
|
- capitalize={false}
|
|
|
- disableLineBreak
|
|
|
- />
|
|
|
- <DarkMatter />
|
|
|
- <VerticalSteps
|
|
|
- currentStep={currentStep}
|
|
|
- steps={[
|
|
|
- <>
|
|
|
- <Text size={16}>Application name</Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Text color="helper">
|
|
|
- Lowercase letters, numbers, and "-" only.
|
|
|
- </Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Input
|
|
|
- placeholder="ex: academic-sophon"
|
|
|
- value={formState.applicationName}
|
|
|
- width="100%"
|
|
|
- setValue={(e) => {
|
|
|
- setFormState({ ...formState, applicationName: e })
|
|
|
- if (Validators.applicationName(e)) {
|
|
|
- setCurrentStep(Math.max(currentStep, 1));
|
|
|
- }
|
|
|
- }}
|
|
|
+ <CenterWrapper>
|
|
|
+ <StyledConfigureTemplate>
|
|
|
+ <Back to="/apps" />
|
|
|
+ <DashboardHeader
|
|
|
+ prefix={
|
|
|
+ <Icon
|
|
|
+ src={web}
|
|
|
/>
|
|
|
- </>,
|
|
|
- <>
|
|
|
- <Text size={16}>Deployment method</Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Text color="helper">
|
|
|
- Deploy from a Git repository or a Docker registry.
|
|
|
- <a
|
|
|
- href="https://docs.porter.run/deploying-applications/overview"
|
|
|
- target="_blank"
|
|
|
- >
|
|
|
- Learn more.
|
|
|
- </a>
|
|
|
- </Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <SourceSelector
|
|
|
- selectedSourceType={formState.selectedSourceType}
|
|
|
- setSourceType={(type) => {
|
|
|
- setFormState({ ...formState, selectedSourceType: type })
|
|
|
- if (Validators.selectedSourceType(type)) {
|
|
|
- setCurrentStep(Math.max(currentStep, 2));
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- <SourceSettings source={formState.selectedSourceType} />
|
|
|
- </>,
|
|
|
- <>
|
|
|
- <Text size={16}>Services</Text>
|
|
|
- <Spacer y={1} />
|
|
|
- <Services
|
|
|
- setServices={
|
|
|
- (services: any[]) => {
|
|
|
- setFormState({ ...formState, serviceList: services })
|
|
|
- if (Validators.serviceList(services)) {
|
|
|
- setCurrentStep(Math.max(currentStep, 4));
|
|
|
+ }
|
|
|
+ title="Deploy a new application"
|
|
|
+ capitalize={false}
|
|
|
+ disableLineBreak
|
|
|
+ />
|
|
|
+ <DarkMatter />
|
|
|
+ <VerticalSteps
|
|
|
+ currentStep={currentStep}
|
|
|
+ steps={[
|
|
|
+ <>
|
|
|
+ <Text size={16}>Application name</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Text color="helper">
|
|
|
+ Lowercase letters, numbers, and "-" only.
|
|
|
+ </Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ placeholder="ex: academic-sophon"
|
|
|
+ value={formState.applicationName}
|
|
|
+ width="300px"
|
|
|
+ setValue={(e) => {
|
|
|
+ setFormState({ ...formState, applicationName: e })
|
|
|
+ if (Validators.applicationName(e)) {
|
|
|
+ setCurrentStep(Math.max(currentStep, 1));
|
|
|
}
|
|
|
}}
|
|
|
- services={formState.serviceList}
|
|
|
- />
|
|
|
- </>,
|
|
|
- <>
|
|
|
- <Text size={16}>Environment variables</Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Text color="helper">
|
|
|
- Specify environment variables shared among all services.
|
|
|
- </Text>
|
|
|
- <EnvGroupArray
|
|
|
- values={formState.envVariables}
|
|
|
- setValues={(x: any) => setFormState({ ...formState, envVariables: x })}
|
|
|
- fileUpload={true}
|
|
|
- />
|
|
|
- </>,
|
|
|
- <>
|
|
|
- <Text size={16}>Release command (optional)</Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Text color="helper">
|
|
|
- If specified, this command will be run before every deployment.
|
|
|
- </Text>
|
|
|
- <Spacer y={0.5} />
|
|
|
- <Input
|
|
|
- placeholder="yarn ./scripts/run-migrations.js"
|
|
|
- value={""}
|
|
|
- width="100%"
|
|
|
- setValue={(e) => { }}
|
|
|
- />
|
|
|
- </>
|
|
|
- ]}
|
|
|
- />
|
|
|
- <Spacer y={1} />
|
|
|
- <Button onClick={() => ({})}>
|
|
|
- DEPLYOY
|
|
|
- </Button>
|
|
|
- </StyledConfigureTemplate>
|
|
|
+ />
|
|
|
+ </>,
|
|
|
+ <>
|
|
|
+ <Text size={16}>Deployment method</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Text color="helper">
|
|
|
+ Deploy from a Git repository or a Docker registry.
|
|
|
+ <a
|
|
|
+ href="https://docs.porter.run/deploying-applications/overview"
|
|
|
+ target="_blank"
|
|
|
+ >
|
|
|
+ Learn more.
|
|
|
+ </a>
|
|
|
+ </Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <SourceSelector
|
|
|
+ selectedSourceType={formState.selectedSourceType}
|
|
|
+ setSourceType={(type) => {
|
|
|
+ setFormState({ ...formState, selectedSourceType: type })
|
|
|
+ if (Validators.selectedSourceType(type)) {
|
|
|
+ setCurrentStep(Math.max(currentStep, 2));
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <SourceSettings source={formState.selectedSourceType} />
|
|
|
+ </>,
|
|
|
+ <>
|
|
|
+ <Text size={16}>Services</Text>
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Services
|
|
|
+ setServices={
|
|
|
+ (services: any[]) => {
|
|
|
+ setFormState({ ...formState, serviceList: services })
|
|
|
+ if (Validators.serviceList(services)) {
|
|
|
+ setCurrentStep(Math.max(currentStep, 4));
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ services={formState.serviceList}
|
|
|
+ />
|
|
|
+ </>,
|
|
|
+ <>
|
|
|
+ <Text size={16}>Environment variables</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Text color="helper">
|
|
|
+ Specify environment variables shared among all services.
|
|
|
+ </Text>
|
|
|
+ <EnvGroupArray
|
|
|
+ values={formState.envVariables}
|
|
|
+ setValues={(x: any) => setFormState({ ...formState, envVariables: x })}
|
|
|
+ fileUpload={true}
|
|
|
+ />
|
|
|
+ </>,
|
|
|
+ <>
|
|
|
+ <Text size={16}>Release command (optional)</Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Text color="helper">
|
|
|
+ If specified, this command will be run before every deployment.
|
|
|
+ </Text>
|
|
|
+ <Spacer y={0.5} />
|
|
|
+ <Input
|
|
|
+ placeholder="yarn ./scripts/run-migrations.js"
|
|
|
+ value={""}
|
|
|
+ width="300px"
|
|
|
+ setValue={(e) => { }}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ <Spacer y={1} />
|
|
|
+ <Button onClick={() => ({})}>
|
|
|
+ DEPLYOY
|
|
|
+ </Button>
|
|
|
+ </StyledConfigureTemplate>
|
|
|
+ </CenterWrapper>
|
|
|
);
|
|
|
};
|
|
|
|
|
|
export default withRouter(NewAppFlow);
|
|
|
|
|
|
+const CenterWrapper = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+`;
|
|
|
+
|
|
|
const DarkMatter = styled.div`
|
|
|
width: 100%;
|
|
|
margin-top: -5px;
|
|
|
@@ -199,7 +208,6 @@ const Icon = styled.img`
|
|
|
`;
|
|
|
|
|
|
const StyledConfigureTemplate = styled.div`
|
|
|
- width: 100%;
|
|
|
height: 100%;
|
|
|
`;
|
|
|
|